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,
IEncodingContext ec)
Test if the codec allows referencing.
|
abstract Object |
createObject(Class<?> clazz,
IDecodingContext context)
Creates the object during decoding.
|
Object |
decode(Class<?> clazz,
IDecodingContext context)
Decodes an object.
|
Object |
decodeSubObjects(Object object,
Class<?> clazz,
IDecodingContext 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,
IEncodingContext 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,
IDecodingContext 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, IEncodingContext 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, IEncodingContext ec)
public Object decode(Class<?> clazz, IDecodingContext context)
decode
in interface IDecoderHandler
clazz
- The class of the object.context
- The decoding context.public abstract Object createObject(Class<?> clazz, IDecodingContext context)
clazz
- The class of the object.context
- The decoding context.public void recordKnownDecodedObject(Object object, IDecodingContext context)
public Object decodeSubObjects(Object object, Class<?> clazz, IDecodingContext context)
object
- The instantiated object.clazz
- The class of the object.context
- The decoding context.Copyright © 2015. All Rights Reserved.