public abstract class AbstractCodec extends Object implements ITraverseProcessor, IDecoderHandler
Constructor and Description |
---|
AbstractCodec() |
Modifier and Type | Method and Description |
---|---|
boolean |
canReference(Object object,
Class clazz,
EncodingContext ec)
Test if the codec allows referencing.
|
abstract Object |
createObject(Class clazz,
DecodingContext context)
Creates the object during decoding.
|
Object |
decode(Class clazz,
DecodingContext context)
Decodes an object.
|
Object |
decodeSubObjects(Object object,
Class clazz,
DecodingContext context)
Decodes and adds sub-objects during decoding.
|
abstract Object |
encode(Object object,
Class<?> clazz,
List<ITraverseProcessor> processors,
Traverser traverser,
Map<Object,Object> traversed,
boolean clone,
EncodingContext ec)
Encode the object.
|
Object |
process(Object object,
Class<?> clazz,
List<ITraverseProcessor> processors,
Traverser traverser,
Map<Object,Object> traversed,
boolean clone,
ClassLoader targetcl,
Object context)
Process an object.
|
void |
recordKnownDecodedObject(Object object,
DecodingContext context)
Record object as known during decoding, allows different behavior if needed.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isApplicable
isApplicable
public Object process(Object object, Class<?> clazz, List<ITraverseProcessor> processors, Traverser traverser, Map<Object,Object> traversed, boolean clone, ClassLoader targetcl, Object context)
process
in interface ITraverseProcessor
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 boolean canReference(Object object, Class clazz, EncodingContext ec)
object
- The object.clazz
- The class.ec
- The encoding context.public abstract Object encode(Object object, Class<?> clazz, List<ITraverseProcessor> processors, Traverser traverser, Map<Object,Object> traversed, boolean clone, EncodingContext ec)
public Object decode(Class clazz, DecodingContext context)
decode
in interface IDecoderHandler
clazz
- The class of the object.context
- The decoding context.public abstract Object createObject(Class clazz, DecodingContext context)
clazz
- The class of the object.context
- The decoding context.public void recordKnownDecodedObject(Object object, DecodingContext context)
public Object decodeSubObjects(Object object, Class clazz, DecodingContext context)
object
- The instantiated object.clazz
- The class of the object.context
- The decoding context.Copyright © 2012. All Rights Reserved.