T result = _deserialize(text, ctxt); if (result != null) { return result; return (T) ob; return _deserializeEmbedded(ob, ctxt);
for (StdDeserializer<?> deser : FromStringDeserializer.all()) { add(deser);
private static String[] GetStringTypes() { ArrayList<String> l = new ArrayList<>(); l.add(Class.class.getName()); Iterator<FromStringDeserializer<?>> iter = FromStringDeserializer.all().iterator(); while (iter.hasNext()) { FromStringDeserializer fsd = iter.next(); l.add(fsd.getValueClass().getName()); } String[] a = new String[l.size()]; return l.toArray(a); }
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
for (StdDeserializer<?> deser : FromStringDeserializer.all()) { add(deser);
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
T result = _deserialize(text, ctxt); if (result != null) { return result; return (T) ob; return _deserializeEmbedded(ob, ctxt);
for (StdDeserializer<?> deser : FromStringDeserializer.all()) { add(deser);
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
T result = _deserialize(text, ctxt); if (result != null) { return result; return (T) ob; return _deserializeEmbedded(ob, ctxt);
for (StdDeserializer<?> deser : FromStringDeserializer.all()) { add(deser);
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
T result = _deserialize(text, ctxt); if (result != null) { return result; return (T) ob; return _deserializeEmbedded(ob, ctxt);