Search in sources :

Example 71 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class PointJsonUnmarshaller method unmarshall.

public Point unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Point point = new Point();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("X")) {
            point.setX(FloatJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Y")) {
            point.setY(FloatJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return point;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 72 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class CreateGrantResultJsonUnmarshaller method unmarshall.

public CreateGrantResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateGrantResult createGrantResult = new CreateGrantResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("GrantToken")) {
            createGrantResult.setGrantToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("GrantId")) {
            createGrantResult.setGrantId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createGrantResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 73 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class CreateKeyResultJsonUnmarshaller method unmarshall.

public CreateKeyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateKeyResult createKeyResult = new CreateKeyResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("KeyMetadata")) {
            createKeyResult.setKeyMetadata(KeyMetadataJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createKeyResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 74 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class NotificationConfigurationJsonUnmarshaller method unmarshall.

public NotificationConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    NotificationConfiguration notificationConfiguration = new NotificationConfiguration();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Status")) {
            notificationConfiguration.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DestinationConfig")) {
            notificationConfiguration.setDestinationConfig(NotificationDestinationConfigJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return notificationConfiguration;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 75 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class NotificationDestinationConfigJsonUnmarshaller method unmarshall.

public NotificationDestinationConfig unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    NotificationDestinationConfig notificationDestinationConfig = new NotificationDestinationConfig();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Uri")) {
            notificationDestinationConfig.setUri(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return notificationDestinationConfig;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Aggregations

AwsJsonReader (com.amazonaws.util.json.AwsJsonReader)1687 StringReader (java.io.StringReader)19 AwsJsonWriter (com.amazonaws.util.json.AwsJsonWriter)14 StringWriter (java.io.StringWriter)14 Test (org.junit.Test)14 JsonUnmarshallerContext (com.amazonaws.transform.JsonUnmarshallerContext)5 Date (java.util.Date)4 ListUnmarshaller (com.amazonaws.transform.ListUnmarshaller)3 HashMap (java.util.HashMap)3 IOException (java.io.IOException)2 BigInteger (java.math.BigInteger)2 AmazonWebServiceResponse (com.amazonaws.AmazonWebServiceResponse)1 ResponseMetadata (com.amazonaws.ResponseMetadata)1 CRC32MismatchException (com.amazonaws.internal.CRC32MismatchException)1 InvalidContactFlowException (com.amazonaws.services.connect.model.InvalidContactFlowException)1 InvalidContactFlowModuleException (com.amazonaws.services.connect.model.InvalidContactFlowModuleException)1 ValidationException (com.amazonaws.services.geo.model.ValidationException)1 CRC32ChecksumCalculatingInputStream (com.amazonaws.util.CRC32ChecksumCalculatingInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1