Class JacksonJsonDataFormat

java.lang.Object
org.camunda.bpm.client.variable.impl.format.json.JacksonJsonDataFormat
All Implemented Interfaces:
DataFormat

public class JacksonJsonDataFormat extends Object implements DataFormat
  • Field Details

    • name

      protected String name
    • objectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • typeDetectors

      protected List<TypeDetector> typeDetectors
  • Constructor Details

    • JacksonJsonDataFormat

      public JacksonJsonDataFormat(String name)
    • JacksonJsonDataFormat

      public JacksonJsonDataFormat(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: DataFormat
      Returns the data format name.
      Specified by:
      getName in interface DataFormat
    • getObjectMapper

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • setObjectMapper

      public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • canMap

      public boolean canMap(Object parameter)
      Description copied from interface: DataFormat
      Returns true if this data format can map the provided Java Object.
      Specified by:
      canMap in interface DataFormat
      Returns:
      true if this object can be mapped.
    • writeValue

      public String writeValue(Object value)
      Description copied from interface: DataFormat
      Writes a java object to a data format's internal data representation.
      Specified by:
      writeValue in interface DataFormat
      Parameters:
      value - object that is written into internal data representation
      Returns:
      the data format's internal representation of that object
    • readValue

      public <T> T readValue(String value, String typeIdentifier)
      Description copied from interface: DataFormat
      Reads the internal representation of a data format to a java object of the desired class.
      Specified by:
      readValue in interface DataFormat
      Parameters:
      value - the object to be read
      typeIdentifier - the class to map the object to
      Returns:
      a java object of the specified class that was populated with the input parameter
    • readValue

      public <T> T readValue(String value, Class<T> cls)
      Description copied from interface: DataFormat
      Reads the internal representation of a data format to a java object of the desired class.
      Specified by:
      readValue in interface DataFormat
      Parameters:
      value - the object to be read
      cls - a data-format-specific type identifier that describes the class to map to
      Returns:
      a java object of the specified class that was populated with the input parameter
    • readValue

      protected <C> C readValue(String value, com.fasterxml.jackson.databind.JavaType type)
    • constructJavaTypeFromCanonicalString

      public com.fasterxml.jackson.databind.JavaType constructJavaTypeFromCanonicalString(String canonicalString)
    • getCanonicalTypeName

      public String getCanonicalTypeName(Object value)
      Description copied from interface: DataFormat
      Returns a data-format-specific canonical type name.
      Specified by:
      getCanonicalTypeName in interface DataFormat