Class JsonMapProcessor

java.lang.Object
jadex.transformation.jsonserializer.processors.AbstractJsonProcessor
jadex.transformation.jsonserializer.processors.JsonMapProcessor
All Implemented Interfaces:
jadex.common.transformation.traverser.ITraverseProcessor
Direct Known Subclasses:
JsonNestedMapProcessor

public class JsonMapProcessor extends AbstractJsonProcessor
Processor for reading maps.
  • Constructor Details

    • JsonMapProcessor

      public JsonMapProcessor()
  • Method Details

    • isApplicable

      protected boolean isApplicable(Object object, Type type, ClassLoader targetcl, JsonReadContext context)
      Test if the processor is applicable.
      Specified by:
      isApplicable in 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.
    • isApplicable

      protected boolean isApplicable(Object object, Type type, ClassLoader targetcl, JsonWriteContext context)
      Test if the processor is applicable.
      Specified by:
      isApplicable in 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.
    • readObject

      protected 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)
      Process an object.
      Specified by:
      readObject in 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.
    • writeObject

      protected 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 wr)
      Process an object.
      Specified by:
      writeObject in 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.
    • getValueClass

      protected Class<?> getValueClass(Object val, Object context)
      Returns the class of a map value.
      Parameters:
      val - The value.
      context - The context.
      Returns:
      The value class.
    • getReturnObject

      protected Object getReturnObject(Object object, Class<?> clazz)