Package jadex.binary
Class StringCodec
java.lang.Object
jadex.binary.AbstractCodec
jadex.binary.StringCodec
- All Implemented Interfaces:
IDecoderHandler,jadex.common.transformation.traverser.ITraverseProcessor
Codec for encoding and decoding String objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanReference(Object object, Class<?> clazz, IEncodingContext ec) Test if the codec allows referencing.createObject(Class<?> clazz, IDecodingContext context) Creates the object during decoding.encode(Object object, Class<?> clazz, List<jadex.common.transformation.traverser.ITraverseProcessor> preprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, jadex.common.transformation.traverser.Traverser traverser, ClassLoader targetcl, IEncodingContext ec) Encode the object.booleanisApplicable(Class<?> clazz) Tests if the decoder can decode the class.voidrecordKnownDecodedObject(Object object, IDecodingContext context) References handling not needed, handled by string pool.Methods inherited from class jadex.binary.AbstractCodec
decode, decodeSubObjects, isApplicable, isFixedFrame, process
-
Constructor Details
-
StringCodec
public StringCodec()
-
-
Method Details
-
isApplicable
Tests if the decoder can decode the class.- Specified by:
isApplicablein interfaceIDecoderHandler- Specified by:
isApplicablein classAbstractCodec- Parameters:
clazz- The class.- Returns:
- True, if the decoder can decode this class.
-
createObject
Creates the object during decoding.- Specified by:
createObjectin classAbstractCodec- Parameters:
clazz- The class of the object.context- The decoding context.- Returns:
- The created object.
-
recordKnownDecodedObject
References handling not needed, handled by string pool.- Overrides:
recordKnownDecodedObjectin classAbstractCodec
-
encode
public Object encode(Object object, Class<?> clazz, List<jadex.common.transformation.traverser.ITraverseProcessor> preprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, jadex.common.transformation.traverser.Traverser traverser, ClassLoader targetcl, IEncodingContext ec) Encode the object.- Specified by:
encodein classAbstractCodec
-
canReference
Description copied from class:AbstractCodecTest if the codec allows referencing.- Overrides:
canReferencein classAbstractCodec- Parameters:
object- The object.clazz- The class.ec- The encoding context.- Returns:
- True, if the codec allows referencing.
-