public static JsonDeserializer<?> find(Class<?> rawType, String clsName) { if (_classNames.contains(clsName)) { JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType); if (d != null) { return d; } if (rawType == UUID.class) { return new UUIDDeserializer(); } if (rawType == StackTraceElement.class) { return new StackTraceElementDeserializer(); } if (rawType == AtomicBoolean.class) { // (note: AtomicInteger/Long work due to single-arg constructor. For now? return new AtomicBooleanDeserializer(); } if (rawType == ByteBuffer.class) { return new ByteBufferDeserializer(); } if (rawType == Void.class) { return NullifyingDeserializer.instance; } } return null; } }
Gson g = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE) .registerTypeAdapter(UUID.class, new UUIDDeserializer()) .build();
public static JsonDeserializer<?> find(Class<?> rawType, String clsName) { if (_classNames.contains(clsName)) { JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType); if (d != null) { return d; } if (rawType == UUID.class) { return new UUIDDeserializer(); } if (rawType == StackTraceElement.class) { return new StackTraceElementDeserializer(); } if (rawType == AtomicBoolean.class) { // (note: AtomicInteger/Long work due to single-arg constructor. For now? return new AtomicBooleanDeserializer(); } if (rawType == ByteBuffer.class) { return new ByteBufferDeserializer(); } } return null; } }
public static JsonDeserializer<?> find(Class<?> rawType, String clsName) { if (_classNames.contains(clsName)) { JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType); if (d != null) { return d; } if (rawType == UUID.class) { return new UUIDDeserializer(); } if (rawType == StackTraceElement.class) { return new StackTraceElementDeserializer(); } if (rawType == AtomicBoolean.class) { // (note: AtomicInteger/Long work due to single-arg constructor. For now? return new AtomicBooleanDeserializer(); } if (rawType == ByteBuffer.class) { return new ByteBufferDeserializer(); } } return null; } }
public static JsonDeserializer<?> find(Class<?> rawType, String clsName) { if (_classNames.contains(clsName)) { JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType); if (d != null) { return d; } if (rawType == UUID.class) { return new UUIDDeserializer(); } if (rawType == StackTraceElement.class) { return new StackTraceElementDeserializer(); } if (rawType == AtomicBoolean.class) { // (note: AtomicInteger/Long work due to single-arg constructor. For now? return new AtomicBooleanDeserializer(); } if (rawType == ByteBuffer.class) { return new ByteBufferDeserializer(); } } return null; } }
public static JsonDeserializer<?> find(Class<?> rawType, String clsName) { if (_classNames.contains(clsName)) { JsonDeserializer<?> d = FromStringDeserializer.findDeserializer(rawType); if (d != null) { return d; } if (rawType == UUID.class) { return new UUIDDeserializer(); } if (rawType == StackTraceElement.class) { return new StackTraceElementDeserializer(); } if (rawType == AtomicBoolean.class) { // (note: AtomicInteger/Long work due to single-arg constructor. For now? return new AtomicBooleanDeserializer(); } if (rawType == ByteBuffer.class) { return new ByteBufferDeserializer(); } } return null; } }