Package org.jdrupes.json
Class JsonCodec
- java.lang.Object
-
- org.jdrupes.json.JsonCodec
-
- Direct Known Subclasses:
JsonBeanDecoder,JsonBeanEncoder
public abstract class JsonCodec extends Object
The base class for theJsonBeanEncoderandJsonBeanDecoder.
-
-
Constructor Summary
Constructors Constructor Description JsonCodec()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract JsonCodecaddAlias(Class<?> clazz, String alias)Add an alias for the given class.static voidclearCaches()The encoder and decoder make use of the information fromPropertyEditorManager.findEditor(Class)andIntrospector.getBeanInfo(Class, Class).protected static com.fasterxml.jackson.core.JsonFactorydefaultFactory()protected static BeanInfofindBeanInfo(Class<?> cls)protected static PropertyEditorfindPropertyEditor(Class<?> cls)
-
-
-
Constructor Detail
-
JsonCodec
public JsonCodec()
-
-
Method Detail
-
defaultFactory
protected static com.fasterxml.jackson.core.JsonFactory defaultFactory()
-
findPropertyEditor
protected static PropertyEditor findPropertyEditor(Class<?> cls)
-
findBeanInfo
protected static BeanInfo findBeanInfo(Class<?> cls)
-
clearCaches
public static void clearCaches()
The encoder and decoder make use of the information fromPropertyEditorManager.findEditor(Class)andIntrospector.getBeanInfo(Class, Class).You’d expect these methods to provide some caching to speed up requests for the same infomration, but they don’t.
The results are therefore kept in an internal cache. This cache may, however, become outdated of additional classes are loaded into the VM dynamically. This method can be used to clear the caches if this is required.
-
-