public class NumberCodec2 extends AbstractCodec
Modifier and Type | Field and Description |
---|---|
static NumberCodec2 |
INSTANCE
Default Instance
|
Constructor and Description |
---|
NumberCodec2() |
Modifier and Type | Method and Description |
---|---|
boolean |
canReference(Object object,
Class<?> clazz,
IEncodingContext ec)
Prevent references for primitive-wrapped types.
|
Object |
createObject(Class<?> clazz,
IDecodingContext context)
Creates the object during decoding.
|
Object |
encode(Object object,
Class<?> clazz,
List<ITraverseProcessor> processors,
Traverser traverser,
Map<Object,Object> traversed,
boolean clone,
IEncodingContext ec)
Encode the object.
|
boolean |
isApplicable(Class<?> clazz)
Tests if the decoder can decode the class.
|
boolean |
isApplicable(Object object,
Class<?> clazz,
boolean clone,
ClassLoader targetcl)
Test if the processor is applicable.
|
void |
recordKnownDecodedObject(Object object,
IDecodingContext context)
References handling not needed.
|
decode, decodeSubObjects, process
public static final NumberCodec2 INSTANCE
public boolean isApplicable(Class<?> clazz)
clazz
- The class.public Object createObject(Class<?> clazz, IDecodingContext context)
createObject
in class AbstractCodec
clazz
- The class of the object.context
- The decoding context.public void recordKnownDecodedObject(Object object, IDecodingContext context)
recordKnownDecodedObject
in class AbstractCodec
public boolean isApplicable(Object object, Class<?> clazz, boolean clone, ClassLoader targetcl)
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 Object encode(Object object, Class<?> clazz, List<ITraverseProcessor> processors, Traverser traverser, Map<Object,Object> traversed, boolean clone, IEncodingContext ec)
encode
in class AbstractCodec
public boolean canReference(Object object, Class<?> clazz, IEncodingContext ec)
canReference
in class AbstractCodec
object
- The current object.clazz
- The class.ec
- The encoding context.Copyright © 2015. All Rights Reserved.