@Override public BigDecimal unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.getReader().nextString(); return (s == null) ? null : new BigDecimal(s); }
@Override public Float unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String floatString = unmarshallerContext.getReader().nextString(); return (floatString == null) ? null : Float.valueOf(floatString); }
@Override public Long unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String longString = unmarshallerContext.getReader().nextString(); return (longString == null) ? null : Long.parseLong(longString); }
@Override public Integer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String intString = unmarshallerContext.getReader().nextString(); return (intString == null) ? null : Integer.parseInt(intString); }
@Override public Boolean unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String booleanString = unmarshallerContext.getReader().nextString(); return (booleanString == null) ? null : Boolean.parseBoolean(booleanString); }
@Override public Byte unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String byteString = unmarshallerContext.getReader().nextString(); return (byteString == null) ? null : Byte.valueOf(byteString); }
@Override public Double unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String doubleString = unmarshallerContext.getReader().nextString(); return (doubleString == null) ? null : Double.parseDouble(doubleString); }
@Override public BigInteger unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String intString = unmarshallerContext.getReader().nextString(); return (intString == null) ? null : new BigInteger(intString); }
@Override public String unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { return unmarshallerContext.getReader().nextString(); }
@Override public Date unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String dateString = unmarshallerContext.getReader().nextString(); if (dateString == null) return null; try { Number number = NumberFormat.getInstance(new Locale("en")).parse(dateString); return new Date(number.longValue() * DATE_MULTIPLIER); } catch (ParseException e) { String errorMessage = "Unable to parse date '" + dateString + "': " + e.getMessage(); throw new AmazonClientException(errorMessage, e); } }
@Override public ByteBuffer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String base64EncodedString = unmarshallerContext.getReader().nextString(); byte[] decodedBytes = Base64.decode(base64EncodedString); return ByteBuffer.wrap(decodedBytes); }
public PutEventsResult unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } PutEventsResult putEventsResult = new PutEventsResult(); putEventsResult.setEventsResponse(EventsResponseJsonUnmarshaller.getInstance() .unmarshall(context)); return putEventsResult; }
public AdminCreateUserResult unmarshall(JsonUnmarshallerContext context) throws Exception { AdminCreateUserResult adminCreateUserResult = new AdminCreateUserResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("User")) { adminCreateUserResult.setUser(UserTypeJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return adminCreateUserResult; }
public GetKeyPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetKeyPolicyResult getKeyPolicyResult = new GetKeyPolicyResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Policy")) { getKeyPolicyResult.setPolicy(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return getKeyPolicyResult; }
public GetJobDocumentResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetJobDocumentResult getJobDocumentResult = new GetJobDocumentResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("document")) { getJobDocumentResult.setDocument(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return getJobDocumentResult; }
public DescribeKeyResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeKeyResult describeKeyResult = new DescribeKeyResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("KeyMetadata")) { describeKeyResult.setKeyMetadata(KeyMetadataJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return describeKeyResult; }
public RegisterDeviceResult unmarshall(JsonUnmarshallerContext context) throws Exception { RegisterDeviceResult registerDeviceResult = new RegisterDeviceResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("DeviceId")) { registerDeviceResult.setDeviceId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return registerDeviceResult; }