Package jadex.binary
Class BeanCodec
- java.lang.Object
- 
- jadex.binary.AbstractCodec
- 
- jadex.binary.BeanCodec
 
 
- 
- All Implemented Interfaces:
- IDecoderHandler,- ITraverseProcessor
 - Direct Known Subclasses:
- SimpleDateFormatCodec
 
 public class BeanCodec extends AbstractCodec Codec for encoding and decoding Java Beans.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IBeanIntrospectorintroBean introspector for inspecting beans.protected static intINTROSPECTOR_CACHE_SIZE
 - 
Constructor SummaryConstructors Constructor Description BeanCodec()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcreateObject(java.lang.Class<?> clazz, IDecodingContext context)Creates the object during decoding.java.lang.ObjectdecodeSubObjects(java.lang.Object object, java.lang.Class<?> clazz, IDecodingContext context)Decodes and adds sub-objects during decoding.java.lang.Objectencode(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, IEncodingContext ec)Encode the object.booleanisApplicable(java.lang.Class<?> clazz)Tests if the decoder can decode the class.booleanisApplicable(java.lang.Object object, java.lang.reflect.Type type, boolean clone, java.lang.ClassLoader targetcl)Test if the processor is applicable.static voidreadBeanProperties(java.lang.Object object, java.lang.Class clazz, IDecodingContext context, IBeanIntrospector intro)static voidwriteBeanProperties(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> processors, Traverser traverser, Traverser.MODE mode, IEncodingContext ec, IBeanIntrospector intro)- 
Methods inherited from class jadex.binary.AbstractCodeccanReference, decode, isApplicable, isFixedFrame, process, recordKnownDecodedObject
 
- 
 
- 
- 
- 
Field Detail- 
INTROSPECTOR_CACHE_SIZEprotected static final int INTROSPECTOR_CACHE_SIZE - See Also:
- Constant Field Values
 
 - 
introprotected IBeanIntrospector intro Bean introspector for inspecting beans.
 
- 
 - 
Method Detail- 
isApplicablepublic boolean isApplicable(java.lang.Class<?> clazz) Tests if the decoder can decode the class.- Specified by:
- isApplicablein interface- IDecoderHandler
- Specified by:
- isApplicablein class- AbstractCodec
- Parameters:
- clazz- The class.
- Returns:
- True, if the decoder can decode this class.
 
 - 
createObjectpublic java.lang.Object createObject(java.lang.Class<?> clazz, IDecodingContext context)Creates the object during decoding.- Specified by:
- createObjectin class- AbstractCodec
- Parameters:
- clazz- The class of the object.
- context- The decoding context.
- Returns:
- The created object.
 
 - 
decodeSubObjectspublic java.lang.Object decodeSubObjects(java.lang.Object object, java.lang.Class<?> clazz, IDecodingContext context)Decodes and adds sub-objects during decoding.- Overrides:
- decodeSubObjectsin class- AbstractCodec
- Parameters:
- object- The instantiated object.
- clazz- The class of the object.
- context- The decoding context.
- Returns:
- The finished object.
 
 - 
isApplicablepublic boolean isApplicable(java.lang.Object object, java.lang.reflect.Type type, boolean clone, java.lang.ClassLoader targetcl)Test if the processor is applicable.- Parameters:
- 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.
- Returns:
- True, if is applicable.
 
 - 
encodepublic java.lang.Object encode(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, IEncodingContext ec)Encode the object.- Specified by:
- encodein class- AbstractCodec
 
 - 
writeBeanPropertiespublic static void writeBeanProperties(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> processors, Traverser traverser, Traverser.MODE mode, IEncodingContext ec, IBeanIntrospector intro)
 - 
readBeanPropertiespublic static void readBeanProperties(java.lang.Object object, java.lang.Class clazz, IDecodingContext context, IBeanIntrospector intro)
 
- 
 
-