Package com.amazonaws.util.json

Examples of com.amazonaws.util.json.JSONWriter.object()


                }
                List<KeySchemaElement> keySchema = table.getKeySchema();
                if (keySchema != null) {
                    jsonWriter.key("KeySchema").array();
                    for (KeySchemaElement element : keySchema) {
                        jsonWriter.object();
                        if (element.getAttributeName() != null) {
                            jsonWriter.key("AttributeName").value(element.getAttributeName());
                        }
                        if (element.getKeyType() != null) {
                            jsonWriter.key("KeyType").value(element.getKeyType());
View Full Code Here


    }

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      Map<String, AttributeValue> attr = deleteItemResult.getAttributes();
      if (attr != null) {
        jsonWriter.key("Attributes").object();
View Full Code Here

      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }
    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();
      jsonWriter.key("Count").value(scanResult.getCount());
      jsonWriter.key("Items").array();
      for (Map<String, AttributeValue> item : scanResult.getItems()) {
        jsonWriter.object();
        for (String k : item.keySet()) {
View Full Code Here

      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();
      jsonWriter.key("Count").value(scanResult.getCount());
      jsonWriter.key("Items").array();
      for (Map<String, AttributeValue> item : scanResult.getItems()) {
        jsonWriter.object();
        for (String k : item.keySet()) {
          if (item.get(k) != null) {
            jsonWriter.key(k).object();
            if (item.get(k).getS() != null) {
              jsonWriter.key("S").value(item.get(k).getS());
View Full Code Here

    }

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      jsonWriter.key("__type").value("com.amazonaws.dynamodb.v20120810#" + exception.getClass().getSimpleName());
      jsonWriter.key("message").value(exception.getMessage());

      jsonWriter.endObject();
View Full Code Here

    }

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      if (getItemResult.getItem() != null) {
        jsonWriter.key("Item").object();
        for (String key : getItemResult.getItem().keySet()) {
          AttributeValue value = getItemResult.getItem().get(key);
View Full Code Here

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);

            //Begin whole object containing both response and unprocessed keys!
      jsonWriter.object();

            //Begin response object
      jsonWriter.key("Responses").object();

            Map<String, List<Map<String, AttributeValue>>> responses = batchGetItemResult.getResponses();
View Full Code Here

                        //Begin array items (a series of items)
            for (Map<String, AttributeValue> item : items) {

                            //Begin each objects constituting array items.No keys in these objects
              jsonWriter.object();
              for (String itemKey : item.keySet()) {

                                //Begin attribute of each item
                jsonWriter.key(itemKey).object();
                AttributeValue value = item.get(itemKey);
View Full Code Here

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);

            //Begin whole object containing responses and unprocessedItems.
      jsonWriter.object();

            //Begin unprocessedItems
      jsonWriter.key("UnprocessedItems").object();
            Map<String, List<WriteRequest>> unprocessedItems = batchWriteItemResult.getUnprocessedItems();
            if (unprocessedItems != null) {
View Full Code Here

                for (String tableKey : unprocessedItems.keySet()) {
                    //begin table
                    jsonWriter.key(tableKey).array();
                    for (WriteRequest request : unprocessedItems.get(tableKey)) {
                        //begin each object of array
                        jsonWriter.object();
                        PutRequest putRequest = request.getPutRequest();
                        DeleteRequest deleteRequest = request.getDeleteRequest();
                        if (putRequest != null) {
                            //Begin put request
                            jsonWriter.key("PutRequest").object();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.