Class JacksonJsonDataFormatMapper
- java.lang.Object
-
- org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatMapper
-
- All Implemented Interfaces:
DataFormatMapper
public class JacksonJsonDataFormatMapper extends java.lang.Object implements DataFormatMapper
-
-
Field Summary
Fields Modifier and Type Field Description protected JacksonJsonDataFormatformat
-
Constructor Summary
Constructors Constructor Description JacksonJsonDataFormatMapper(JacksonJsonDataFormat format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanMap(java.lang.Object parameter)Returns true if this mapper can map the provided Java Object.java.lang.StringgetCanonicalTypeName(java.lang.Object object)<C> CmapInternalToJava(java.lang.Object parameter, com.fasterxml.jackson.databind.JavaType type)<C> CmapInternalToJava(java.lang.Object parameter, com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator)<T> TmapInternalToJava(java.lang.Object parameter, java.lang.Class<T> type)Maps the internal representation of a data format to a java object of the desired class.<T> TmapInternalToJava(java.lang.Object parameter, java.lang.Class<T> type, DeserializationTypeValidator validator)Maps the internal representation of a data format to a java object of the desired class.<T> TmapInternalToJava(java.lang.Object parameter, java.lang.String typeIdentifier)Maps the internal representation of a data format to a java object of the desired class.<T> TmapInternalToJava(java.lang.Object parameter, java.lang.String typeIdentifier, DeserializationTypeValidator validator)Maps the internal representation of a data format to a java object of the desired class.java.lang.ObjectmapJavaToInternal(java.lang.Object parameter)Maps a java object to a data format's internal data representation.protected voidvalidateType(com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator)Validate the type with the help of the validator.
Note: when adjusting this method, please also consider adjusting theAbstractVariablesResource#validateTypein the REST APIprotected voidvalidateType(com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator, java.util.List<java.lang.String> invalidTypes)protected voidvalidateTypeInternal(com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator, java.util.List<java.lang.String> invalidTypes)
-
-
-
Field Detail
-
format
protected JacksonJsonDataFormat format
-
-
Constructor Detail
-
JacksonJsonDataFormatMapper
public JacksonJsonDataFormatMapper(JacksonJsonDataFormat format)
-
-
Method Detail
-
canMap
public boolean canMap(java.lang.Object parameter)
Description copied from interface:DataFormatMapperReturns true if this mapper can map the provided Java Object.- Specified by:
canMapin interfaceDataFormatMapper- Parameters:
parameter- the java object to check- Returns:
- true if this object can be mapped.
-
getCanonicalTypeName
public java.lang.String getCanonicalTypeName(java.lang.Object object)
- Specified by:
getCanonicalTypeNamein interfaceDataFormatMapper
-
mapJavaToInternal
public java.lang.Object mapJavaToInternal(java.lang.Object parameter)
Description copied from interface:DataFormatMapperMaps a java object to a data format's internal data representation.- Specified by:
mapJavaToInternalin interfaceDataFormatMapper- Parameters:
parameter- object that is mapped- Returns:
- the data format's internal representation of that object
-
mapInternalToJava
public <T> T mapInternalToJava(java.lang.Object parameter, java.lang.Class<T> type)Description copied from interface:DataFormatMapperMaps the internal representation of a data format to a java object of the desired class. The desired class is not validated prior to the mapping.- Specified by:
mapInternalToJavain interfaceDataFormatMapper- Parameters:
parameter- the object to be mappedtype- the class to map the object to- Returns:
- a java object of the specified class that was populated with the input parameter
-
mapInternalToJava
public <T> T mapInternalToJava(java.lang.Object parameter, java.lang.Class<T> type, DeserializationTypeValidator validator)Description copied from interface:DataFormatMapperMaps the internal representation of a data format to a java object of the desired class. The desired class is validated by thevalidatorprior to the mapping.- Specified by:
mapInternalToJavain interfaceDataFormatMapper- Parameters:
parameter- the object to be mappedtype- the class to map the object tovalidator- the validator for the target class- Returns:
- a java object of the specified class that was populated with the input parameter
-
mapInternalToJava
public <T> T mapInternalToJava(java.lang.Object parameter, java.lang.String typeIdentifier)Description copied from interface:DataFormatMapperMaps the internal representation of a data format to a java object of the desired class. The type identifier is given in a data format specific format. Its interpretation is data-format-specific. For example, it can be used to express generic type information that cannot be expressed by aClassobject. The desired class is not validated prior to the mapping.- Specified by:
mapInternalToJavain interfaceDataFormatMapper- Parameters:
parameter- the object to be mappedtypeIdentifier- a data-format-specific type identifier that describes the class to map to- Returns:
- a java object of the specified type that was populated with the input parameter
-
mapInternalToJava
public <T> T mapInternalToJava(java.lang.Object parameter, java.lang.String typeIdentifier, DeserializationTypeValidator validator)Description copied from interface:DataFormatMapperMaps the internal representation of a data format to a java object of the desired class. The type identifier is given in a data format specific format. Its interpretation is data-format-specific. For example, it can be used to express generic type information that cannot be expressed by aClassobject. The desired class is validated by thevalidatorprior to the mapping.- Specified by:
mapInternalToJavain interfaceDataFormatMapper- Parameters:
parameter- the object to be mappedtypeIdentifier- a data-format-specific type identifier that describes the class to map tovalidator- the validator for the target class- Returns:
- a java object of the specified type that was populated with the input parameter
-
mapInternalToJava
public <C> C mapInternalToJava(java.lang.Object parameter, com.fasterxml.jackson.databind.JavaType type)
-
mapInternalToJava
public <C> C mapInternalToJava(java.lang.Object parameter, com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator)
-
validateType
protected void validateType(com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator)Validate the type with the help of the validator.
Note: when adjusting this method, please also consider adjusting theAbstractVariablesResource#validateTypein the REST API
-
validateType
protected void validateType(com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator, java.util.List<java.lang.String> invalidTypes)
-
validateTypeInternal
protected void validateTypeInternal(com.fasterxml.jackson.databind.JavaType type, DeserializationTypeValidator validator, java.util.List<java.lang.String> invalidTypes)
-
-