public static S3ObjectJsonUnmarshaller getInstance() { if (instance == null) instance = new S3ObjectJsonUnmarshaller(); return instance; } }
public Video unmarshall(JsonUnmarshallerContext context) throws Exception { Video video = new Video(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("S3Object", targetDepth)) { context.nextToken(); video.setS3Object(S3ObjectJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return video; }
image.setS3Object(S3ObjectJsonUnmarshaller.getInstance().unmarshall(context));
public Video unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } Video video = new Video(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("S3Object")) { video.setS3Object(S3ObjectJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return video; }
public static S3ObjectJsonUnmarshaller getInstance() { if (instance == null) instance = new S3ObjectJsonUnmarshaller(); return instance; } }
public Image unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } Image image = new Image(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Bytes")) { image.setBytes(ByteBufferJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("S3Object")) { image.setS3Object(S3ObjectJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return image; }