Package com.amazonaws.util.json

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


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

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

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

      Map<String, BatchWriteResponse> responses = batchWriteItemResult.getResponses();
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

    }

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

      TableDescription table = describeTableResult.getTable();
      if (table != null) {
        jsonWriter.key("Table").object();
        jsonWriter.key("ItemCount").value(table.getItemCount());
View Full Code Here

    }

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

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

    }

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

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

    }

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

            if (queryResult.getConsumedCapacity() != null) {
                jsonWriter.key("ConsumedCapacity").object();
                jsonWriter.key("TableName").value(queryResult.getConsumedCapacity().getTableName());
                jsonWriter.key("CapacityUnits").value(queryResult.getConsumedCapacity().getCapacityUnits());
View Full Code Here

        jsonWriter.key("Count").value(queryResult.getCount());
      }
      if (queryResult.getItems() != null) {
        jsonWriter.key("Items").array();
        for (Map<String, AttributeValue> value : queryResult.getItems()) {
          jsonWriter.object();
          for (Map.Entry<String, AttributeValue> item : value.entrySet()) {
            String key = item.getKey();
            AttributeValue val = item.getValue();
            jsonWriter.key(key).object();
            if (val.getN() != null) {
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

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.