Class AbstractJsonProcessor
java.lang.Object
jadex.transformation.jsonserializer.processors.AbstractJsonProcessor
- All Implemented Interfaces:
jadex.common.transformation.traverser.ITraverseProcessor
- Direct Known Subclasses:
JsonArrayProcessor
,JsonBeanProcessor
,JsonBigIntegerProcessor
,JsonByteArrayProcessor
,JsonCalendarProcessor
,JsonCertificateProcessor
,JsonClassInfoProcessor
,JsonClassProcessor
,JsonCollectionProcessor
,JsonColorProcessor
,JsonCurrencyProcessor
,JsonDateProcessor
,JsonEnumProcessor
,JsonImageProcessor
,JsonInetAddressProcessor
,JsonIteratorProcessor
,JsonJsonStringProcessor
,JsonLocalDateTimeProcessor
,JsonLoggingLevelProcessor
,JsonLogRecordProcessor
,JsonLRUProcessor
,JsonMapProcessor
,JsonMultiCollectionProcessor
,JsonOptionalProcessor
,JsonRecordProcessor
,JsonRectangleProcessor
,JsonStackTraceElementProcessor
,JsonTimestampProcessor
,JsonToStringProcessor
,JsonTupleProcessor
,JsonUUIDProcessor
public abstract class AbstractJsonProcessor
extends Object
implements jadex.common.transformation.traverser.ITraverseProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
isApplicable
(Object object, Type type, ClassLoader targetcl, JsonReadContext context) Test if the processor is applicable for reading.protected abstract boolean
isApplicable
(Object object, Type type, ClassLoader targetcl, JsonWriteContext context) Test if the processor is applicable for writing.final boolean
isApplicable
(Object object, Type type, ClassLoader targetcl, Object context) Test if the processor is applicable.final Object
process
(Object object, Type type, jadex.common.transformation.traverser.Traverser traverser, List<jadex.common.transformation.traverser.ITraverseProcessor> conversionprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, ClassLoader targetcl, Object context) Process an object.protected abstract Object
readObject
(Object object, Type type, jadex.common.transformation.traverser.Traverser traverser, List<jadex.common.transformation.traverser.ITraverseProcessor> conversionprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, ClassLoader targetcl, JsonReadContext context) Read an object.protected abstract Object
writeObject
(Object object, Type type, jadex.common.transformation.traverser.Traverser traverser, List<jadex.common.transformation.traverser.ITraverseProcessor> conversionprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, ClassLoader targetcl, JsonWriteContext context) Write an object.
-
Constructor Details
-
AbstractJsonProcessor
public AbstractJsonProcessor()
-
-
Method Details
-
isApplicable
protected abstract boolean isApplicable(Object object, Type type, ClassLoader targetcl, JsonReadContext context) Test if the processor is applicable for reading.- 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.
-
isApplicable
protected abstract boolean isApplicable(Object object, Type type, ClassLoader targetcl, JsonWriteContext context) Test if the processor is applicable for writing.- 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.
-
readObject
protected abstract Object readObject(Object object, Type type, jadex.common.transformation.traverser.Traverser traverser, List<jadex.common.transformation.traverser.ITraverseProcessor> conversionprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, ClassLoader targetcl, JsonReadContext context) Read an object.- 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:
- The processed object.
-
writeObject
protected abstract Object writeObject(Object object, Type type, jadex.common.transformation.traverser.Traverser traverser, List<jadex.common.transformation.traverser.ITraverseProcessor> conversionprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, ClassLoader targetcl, JsonWriteContext context) Write an object.- 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:
- The processed object.
-
isApplicable
Test if the processor is applicable.- Specified by:
isApplicable
in interfacejadex.common.transformation.traverser.ITraverseProcessor
- 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.
-
process
public final Object process(Object object, Type type, jadex.common.transformation.traverser.Traverser traverser, List<jadex.common.transformation.traverser.ITraverseProcessor> conversionprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, ClassLoader targetcl, Object context) Process an object.- Specified by:
process
in interfacejadex.common.transformation.traverser.ITraverseProcessor
- 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:
- The processed object.
-