public class BeanCodec extends AbstractCodec
Modifier and Type | Field and Description |
---|---|
protected IBeanIntrospector |
intro
Bean introspector for inspecting beans.
|
protected static int |
INTROSPECTOR_CACHE_SIZE |
Constructor and Description |
---|
BeanCodec() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createObject(java.lang.Class<?> clazz,
IDecodingContext context)
Creates the object during decoding.
|
java.lang.Object |
decodeSubObjects(java.lang.Object object,
java.lang.Class<?> clazz,
IDecodingContext context)
Decodes and adds sub-objects during decoding.
|
java.lang.Object |
encode(java.lang.Object object,
java.lang.Class<?> clazz,
java.util.List<ITraverseProcessor> processors,
Traverser traverser,
java.util.Map<java.lang.Object,java.lang.Object> traversed,
boolean clone,
IEncodingContext ec)
Encode the object.
|
boolean |
isApplicable(java.lang.Class<?> clazz)
Tests if the decoder can decode the class.
|
boolean |
isApplicable(java.lang.Object object,
java.lang.reflect.Type type,
boolean clone,
java.lang.ClassLoader targetcl)
Test if the processor is applicable.
|
static void |
readBeanProperties(java.lang.Object object,
java.lang.Class clazz,
IDecodingContext context,
IBeanIntrospector intro) |
static void |
writeBeanProperties(java.lang.Object object,
java.lang.Class<?> clazz,
java.util.List<ITraverseProcessor> processors,
Traverser traverser,
java.util.Map<java.lang.Object,java.lang.Object> traversed,
boolean clone,
IEncodingContext ec,
IBeanIntrospector intro) |
canReference, decode, process, recordKnownDecodedObject, runPreProcessors
protected static final int INTROSPECTOR_CACHE_SIZE
protected IBeanIntrospector intro
public boolean isApplicable(java.lang.Class<?> clazz)
isApplicable
in interface IDecoderHandler
isApplicable
in class AbstractCodec
clazz
- The class.public java.lang.Object createObject(java.lang.Class<?> clazz, IDecodingContext context)
createObject
in class AbstractCodec
clazz
- The class of the object.context
- The decoding context.public java.lang.Object decodeSubObjects(java.lang.Object object, java.lang.Class<?> clazz, IDecodingContext context)
decodeSubObjects
in class AbstractCodec
object
- The instantiated object.clazz
- The class of the object.context
- The decoding context.public boolean isApplicable(java.lang.Object object, java.lang.reflect.Type type, boolean clone, java.lang.ClassLoader targetcl)
isApplicable
in interface ITraverseProcessor
isApplicable
in class AbstractCodec
object
- The object.targetcl
- If not null, the traverser should make sure that the result object is compatible with the class loader,
e.g. by cloning the object using the class loaded from the target class loader.public java.lang.Object encode(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> processors, Traverser traverser, java.util.Map<java.lang.Object,java.lang.Object> traversed, boolean clone, IEncodingContext ec)
encode
in class AbstractCodec
public static void writeBeanProperties(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> processors, Traverser traverser, java.util.Map<java.lang.Object,java.lang.Object> traversed, boolean clone, IEncodingContext ec, IBeanIntrospector intro)
public static void readBeanProperties(java.lang.Object object, java.lang.Class clazz, IDecodingContext context, IBeanIntrospector intro)