Package com.amazonaws.util.json

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


    }

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

      jsonWriter.key("__type").value("com.amazonaws.dynamodb.v20111205#" + 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, BatchResponse> responses = batchGetItemResult.getResponses();
View Full Code Here

                        //Begin array items (a series of items)
            jsonWriter.key("Items").array();
            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);
      jsonWriter.object();

      TableDescription table = deleteTableResult.getTableDescription();
      if (table != null) {
        jsonWriter.key("TableDescription").object();
        jsonWriter.key("TableName").value(table.getTableName());
View Full Code Here

        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

      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }
    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();
      jsonWriter.key("Attributes").object();
      for (String key : updateItemResult.getAttributes().keySet()) {
        jsonWriter.key(key).object();
        if (updateItemResult.getAttributes().get(key) != null) {
          if (updateItemResult.getAttributes().get(key).getS() != null) {
View Full Code Here

    {"TableNames":["Table1","Table2","Table3"], "LastEvaluatedTableName":"Table3"}
     */
    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      if(listTablesResult != null) {
        jsonWriter.key("TableNames").array();
        for(String tableName:listTablesResult.getTableNames()) {
          jsonWriter.value(tableName);
View Full Code Here

        }

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

            TableDescription table = createTableResult.getTableDescription();
            if (table != null) {
                jsonWriter.key("TableDescription").object();
                if (table.getCreationDateTime() != null) {
View Full Code Here

                }
                List<AttributeDefinition> attributes = table.getAttributeDefinitions();
                if (attributes != null) {
                    jsonWriter.key("AttributeDefinitions").array();
                    for (AttributeDefinition attr : attributes) {
                        jsonWriter.object();
                        if (attr.getAttributeName() != null) {
                            jsonWriter.key("AttributeName").value(attr.getAttributeName());
                        }
                        if (attr.getAttributeType() != null) {
                            jsonWriter.key("AttributeType").value(attr.getAttributeType());
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.