Class JsonOptionalProcessor
- java.lang.Object
- 
- jadex.transformation.jsonserializer.processors.AbstractJsonProcessor
- 
- jadex.transformation.jsonserializer.processors.JsonOptionalProcessor
 
 
- 
- All Implemented Interfaces:
- ITraverseProcessor
 
 public class JsonOptionalProcessor extends AbstractJsonProcessor java.util.Optional processor for reading json objects.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.reflect.MethodemptyMethodCached Method.protected java.lang.reflect.MethodgetMethodCached Method.protected IBeanIntrospectorintroBean introspector for inspecting beans.protected java.lang.reflect.MethodisPresentMethodCached Method.protected java.lang.reflect.MethodofMethodCached Method.protected static java.lang.StringOPTIONAL_CLASSNAMEName of the java 8 optional class.protected java.lang.Class<?>optionalClassCached Class.
 - 
Constructor SummaryConstructors Constructor Description JsonOptionalProcessor()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinit()Init caches if not initialized.protected booleanisApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, JsonReadContext context)Test if the processor is applicable.protected booleanisApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, JsonWriteContext context)Test if the processor is applicable.protected java.lang.ObjectreadObject(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 java.lang.ObjectwriteObject(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.- 
Methods inherited from class jadex.transformation.jsonserializer.processors.AbstractJsonProcessorisApplicable, process
 
- 
 
- 
- 
- 
Field Detail- 
introprotected IBeanIntrospector intro Bean introspector for inspecting beans.
 - 
OPTIONAL_CLASSNAMEprotected static final java.lang.String OPTIONAL_CLASSNAME Name of the java 8 optional class.- See Also:
- Constant Field Values
 
 - 
optionalClassprotected java.lang.Class<?> optionalClass Cached Class.
 - 
ofMethodprotected java.lang.reflect.Method ofMethod Cached Method.
 - 
emptyMethodprotected java.lang.reflect.Method emptyMethod Cached Method.
 - 
getMethodprotected java.lang.reflect.Method getMethod Cached Method.
 - 
isPresentMethodprotected java.lang.reflect.Method isPresentMethod Cached Method.
 
- 
 - 
Method Detail- 
initprotected void init() Init caches if not initialized.
 - 
isApplicableprotected 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:
- isApplicablein class- AbstractJsonProcessor
- 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.
 
 - 
isApplicableprotected 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:
- isApplicablein class- AbstractJsonProcessor
- 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.
 
 - 
readObjectprotected 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:
- readObjectin class- AbstractJsonProcessor
- 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.
 
 - 
writeObjectprotected 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:
- writeObjectin class- AbstractJsonProcessor
- 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.
 
 
- 
 
-