public String unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { return unmarshallerContext.readText(); }
public BigDecimal unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.readText(); return (s == null) ? null : new BigDecimal(s); }
public BigInteger unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.readText(); return (s == null) ? null : new BigInteger(s); }
public Double unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String doubleString = unmarshallerContext.readText(); return (doubleString == null) ? null : Double.parseDouble(doubleString); }
public Float unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String floatString = unmarshallerContext.readText(); return (floatString == null) ? null : Float.valueOf(floatString); }
public Long unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String longString = unmarshallerContext.readText(); return (longString == null) ? null : Long.parseLong(longString); }
public Boolean unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String booleanString = unmarshallerContext.readText(); return (booleanString == null) ? null : Boolean.parseBoolean(booleanString); }
public Short unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String shortString = unmarshallerContext.readText(); return (shortString == null) ? null : Short.valueOf(shortString); }
public Byte unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String byteString = unmarshallerContext.readText(); return (byteString == null) ? null : Byte.valueOf(byteString); }
public Integer unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String intString = unmarshallerContext.readText(); return (intString == null) ? null : Integer.parseInt(intString); }
public Character unmarshall(StaxUnmarshallerContext 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 Date unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String dateString = unmarshallerContext.readText(); if (dateString == null) return null; try { return DateUtils.parseISO8601Date(dateString); } catch (Exception e) { log.warn("Unable to parse date '" + dateString + "': " + e.getMessage(), e); return null; } }
public ByteBuffer unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String base64EncodedString = unmarshallerContext.readText(); byte[] decodedBytes = Base64.decode(base64EncodedString); return ByteBuffer.wrap(decodedBytes); }
@Override public Date unmarshall(StaxUnmarshallerContext 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); } return DateUtils.parseISO8601Date(dateString); } catch (Exception e) { log.warn("Unable to parse date '" + dateString + "': " + e.getMessage(), e); return null; } }
@Override public BigDecimal unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.readText(); return (s == null) ? null : new BigDecimal(s); }
@Override public BigInteger unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.readText(); return (s == null) ? null : new BigInteger(s); }
@Override public Float unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String floatString = unmarshallerContext.readText(); return (floatString == null) ? null : Float.valueOf(floatString); }
public BigInteger unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String s = unmarshallerContext.readText(); return (s == null) ? null : new BigInteger(s); }
@Override public Double unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String doubleString = unmarshallerContext.readText(); return (doubleString == null) ? null : Double.parseDouble(doubleString); }
@Override public Date unmarshall(StaxUnmarshallerContext unmarshallerContext) throws Exception { String dateString = unmarshallerContext.readText(); if (dateString == null) return null; try { return DateUtils.parseISO8601Date(dateString); } catch (Exception e) { log.warn("Unable to parse date '" + dateString + "': " + e.getMessage(), e); return null; } }