Class JsonBeanProcessor
- java.lang.Object
-
- jadex.transformation.jsonserializer.processors.AbstractJsonProcessor
-
- jadex.transformation.jsonserializer.processors.JsonBeanProcessor
-
- All Implemented Interfaces:
ITraverseProcessor
- Direct Known Subclasses:
JsonSimpleDateFormatProcessor
,JsonThrowableProcessor
public class JsonBeanProcessor extends AbstractJsonProcessor
Bean processor for reading json objects.
-
-
Field Summary
Fields Modifier and Type Field Description protected IBeanIntrospector
intro
Bean introspector for inspecting beans.
-
Constructor Summary
Constructors Constructor Description JsonBeanProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
convertBasicType(java.lang.Object value, java.lang.Class<?> targetclazz)
java.lang.Object
getReturnObject(java.lang.Object object, java.lang.Class<?> clazz, java.lang.ClassLoader targetcl)
Get the object that is returned.protected boolean
isApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, JsonReadContext context)
Test if the processor is applicable.protected boolean
isApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, JsonWriteContext context)
Test if the processor is applicable.protected java.lang.Object
readObject(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, java.lang.ClassLoader targetcl, JsonReadContext context)
Process an object.protected static void
readProperties(java.lang.Object object, java.lang.reflect.Type type, java.util.List<ITraverseProcessor> postprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, java.lang.Object ret, JsonReadContext context, IBeanIntrospector intro)
Clone all properties of an object.protected java.lang.Object
writeObject(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, java.lang.ClassLoader targetcl, JsonWriteContext wr)
Process an object.protected void
writeProperties(java.lang.Object object, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, JsonWriteContext wr, IBeanIntrospector intro, boolean first)
Clone all properties of an object.-
Methods inherited from class jadex.transformation.jsonserializer.processors.AbstractJsonProcessor
isApplicable, process
-
-
-
-
Field Detail
-
intro
protected IBeanIntrospector intro
Bean introspector for inspecting beans.
-
-
Method Detail
-
isApplicable
protected boolean isApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, JsonReadContext context)
Test if the processor is applicable.- Specified by:
isApplicable
in classAbstractJsonProcessor
- 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 boolean isApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, JsonWriteContext context)
Test if the processor is applicable.- Specified by:
isApplicable
in classAbstractJsonProcessor
- 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 java.lang.Object readObject(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, java.lang.ClassLoader targetcl, JsonReadContext context)
Process an object.- Specified by:
readObject
in classAbstractJsonProcessor
- 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 java.lang.Object writeObject(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, java.lang.ClassLoader targetcl, JsonWriteContext wr)
Process an object.- Specified by:
writeObject
in classAbstractJsonProcessor
- 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.
-
readProperties
protected static void readProperties(java.lang.Object object, java.lang.reflect.Type type, java.util.List<ITraverseProcessor> postprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, java.lang.Object ret, JsonReadContext context, IBeanIntrospector intro)
Clone all properties of an object.
-
writeProperties
protected void writeProperties(java.lang.Object object, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, JsonWriteContext wr, IBeanIntrospector intro, boolean first)
Clone all properties of an object.
-
getReturnObject
public java.lang.Object getReturnObject(java.lang.Object object, java.lang.Class<?> clazz, java.lang.ClassLoader targetcl)
Get the object that is returned.
-
convertBasicType
public static java.lang.Object convertBasicType(java.lang.Object value, java.lang.Class<?> targetclazz)
- Parameters:
value
-targetclazz
-- Returns:
-
-