Class JacksonJsonDataFormat
- java.lang.Object
-
- org.camunda.bpm.client.variable.impl.format.json.JacksonJsonDataFormat
-
- All Implemented Interfaces:
DataFormat
public class JacksonJsonDataFormat extends java.lang.Object implements DataFormat
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringnameprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapperprotected java.util.List<TypeDetector>typeDetectors
-
Constructor Summary
Constructors Constructor Description JacksonJsonDataFormat(java.lang.String name)JacksonJsonDataFormat(java.lang.String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanMap(java.lang.Object parameter)Returns true if this data format can map the provided Java Object.com.fasterxml.jackson.databind.JavaTypeconstructJavaTypeFromCanonicalString(java.lang.String canonicalString)java.lang.StringgetCanonicalTypeName(java.lang.Object value)Returns a data-format-specific canonical type name.java.lang.StringgetName()Returns the data format name.com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()protected <C> CreadValue(java.lang.String value, com.fasterxml.jackson.databind.JavaType type)<T> TreadValue(java.lang.String value, java.lang.Class<T> cls)Reads the internal representation of a data format to a java object of the desired class.<T> TreadValue(java.lang.String value, java.lang.String typeIdentifier)Reads the internal representation of a data format to a java object of the desired class.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)java.lang.StringwriteValue(java.lang.Object value)Writes a java object to a data format's internal data representation.
-
-
-
Field Detail
-
name
protected java.lang.String name
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
typeDetectors
protected java.util.List<TypeDetector> typeDetectors
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:DataFormatReturns the data format name.- Specified by:
getNamein interfaceDataFormat
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
canMap
public boolean canMap(java.lang.Object parameter)
Description copied from interface:DataFormatReturns true if this data format can map the provided Java Object.- Specified by:
canMapin interfaceDataFormat- Returns:
- true if this object can be mapped.
-
writeValue
public java.lang.String writeValue(java.lang.Object value)
Description copied from interface:DataFormatWrites a java object to a data format's internal data representation.- Specified by:
writeValuein interfaceDataFormat- 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(java.lang.String value, java.lang.String typeIdentifier)Description copied from interface:DataFormatReads the internal representation of a data format to a java object of the desired class.- Specified by:
readValuein interfaceDataFormat- Parameters:
value- the object to be readtypeIdentifier- 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(java.lang.String value, java.lang.Class<T> cls)Description copied from interface:DataFormatReads the internal representation of a data format to a java object of the desired class.- Specified by:
readValuein interfaceDataFormat- Parameters:
value- the object to be readcls- 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(java.lang.String value, com.fasterxml.jackson.databind.JavaType type)
-
constructJavaTypeFromCanonicalString
public com.fasterxml.jackson.databind.JavaType constructJavaTypeFromCanonicalString(java.lang.String canonicalString)
-
getCanonicalTypeName
public java.lang.String getCanonicalTypeName(java.lang.Object value)
Description copied from interface:DataFormatReturns a data-format-specific canonical type name.- Specified by:
getCanonicalTypeNamein interfaceDataFormat
-
-