@Override public String unmarshall(JsonUnmarshallerContext context) throws Exception { return context.readText(); }
public String unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { return unmarshallerContext.readText(); }
public String unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { return unmarshallerContext.readText(); }
public Short unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String shortString = unmarshallerContext.readText(); return (shortString == null) ? null : Short.valueOf(shortString); }
public Double unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String doubleString = unmarshallerContext.readText(); return (doubleString == null) ? null : Double.parseDouble(doubleString); }
public BigDecimal unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.readText(); return (s == null) ? null : new BigDecimal(s); }
public Integer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String intString = unmarshallerContext.readText(); return (intString == null) ? null : Integer.parseInt(intString); }
public Float unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String floatString = unmarshallerContext.readText(); return (floatString == null) ? null : Float.valueOf(floatString); }
public BigInteger unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String intString = unmarshallerContext.readText(); return (intString == null) ? null : new BigInteger(intString); }
public Boolean unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String booleanString = unmarshallerContext.readText(); return (booleanString == null) ? null : Boolean.parseBoolean(booleanString); }
public Long unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String longString = unmarshallerContext.readText(); return (longString == null) ? null : Long.parseLong(longString); }
public Byte unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String byteString = unmarshallerContext.readText(); return (byteString == null) ? null : Byte.valueOf(byteString); }
public Character unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String charString = unmarshallerContext.readText(); if (charString == null) return null; charString = charString.trim(); if (charString.isEmpty() || charString.length() > 1) throw new SdkClientException("'" + charString + "' cannot be converted to Character"); return Character.valueOf(charString.charAt(0)); }
public ByteBuffer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String base64EncodedString = unmarshallerContext.readText(); if (base64EncodedString == null) { return null; } byte[] decodedBytes = Base64.decode(base64EncodedString); return ByteBuffer.wrap(decodedBytes); }
/** * Un marshalls the response header into the list. */ private List<T> unmarshallResponseHeaderToList( JsonUnmarshallerContext context) throws Exception { String headerValue = context.readText(); List<T> list = new ArrayList<T>(); String[] headerValues = headerValue.split("[,]"); for (final String headerVal : headerValues) { list.add(itemUnmarshaller.unmarshall(new JsonUnmarshallerContext() { @Override public String readText() { return headerVal; } })); } return list; }
public Date unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { // If value is string, assume ISO8601. Otherwise parse as epoch seconds. if (unmarshallerContext.getCurrentToken() == JsonToken.VALUE_STRING) { return DateUtils.parseISO8601Date(unmarshallerContext.readText()); } else { return DateUtils.parseServiceSpecificDate(unmarshallerContext.readText()); } }
@Override public Date unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String dateString = unmarshallerContext.readText(); if (dateString == null) { return null; } try { if (TimestampFormat.RFC_822.getFormat().equals(dateFormatType)) { return DateUtils.parseRFC822Date(dateString); } if (TimestampFormat.UNIX_TIMESTAMP.getFormat().equals(dateFormatType)) { return DateUtils.parseServiceSpecificDate(dateString); } if (TimestampFormat.UNIX_TIMESTAMP_IN_MILLIS.getFormat().equals(dateFormatType)) { return DateUtils.parseUnixTimestampInMillis(dateString); } return DateUtils.parseISO8601Date(dateString); } catch (Exception exception) { // fallback to the original behavior. return DateJsonUnmarshaller.getInstance().unmarshall(unmarshallerContext); } }
public Character unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String charString = unmarshallerContext.readText(); if (charString == null) return null; charString = charString.trim(); if (charString.isEmpty() || charString.length() > 1) throw new SdkClientException("'" + charString + "' cannot be converted to Character"); return Character.valueOf(charString.charAt(0)); }
public ByteBuffer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { String base64EncodedString = unmarshallerContext.readText(); if (base64EncodedString == null) { return null; } byte[] decodedBytes = Base64.decode(base64EncodedString); return ByteBuffer.wrap(decodedBytes); }
public Date unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception { // If value is string, assume ISO8601. Otherwise parse as epoch seconds. if (unmarshallerContext.getCurrentToken() == JsonToken.VALUE_STRING) { return DateUtils.parseISO8601Date(unmarshallerContext.readText()); } else { return DateUtils.parseServiceSpecificDate(unmarshallerContext.readText()); } }