Package org.camunda.spin.spi
Interface DataFormatMapper
- All Known Implementing Classes:
DomXmlDataFormatMapper
,JacksonJsonDataFormatMapper
public interface DataFormatMapper
Maps a java object to the data format's internal representation and vice versa.
- Author:
- Thorben Lindhauer
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this mapper can map the provided Java Object.getCanonicalTypeName
(Object object) <T> T
mapInternalToJava
(Object parameter, Class<T> type) Maps the internal representation of a data format to a java object of the desired class.<T> T
mapInternalToJava
(Object parameter, Class<T> type, DeserializationTypeValidator validator) Maps the internal representation of a data format to a java object of the desired class.<T> T
mapInternalToJava
(Object parameter, String typeIdentifier) Maps the internal representation of a data format to a java object of the desired class.<T> T
mapInternalToJava
(Object parameter, String typeIdentifier, DeserializationTypeValidator validator) Maps the internal representation of a data format to a java object of the desired class.mapJavaToInternal
(Object parameter) Maps a java object to a data format's internal data representation.
-
Method Details
-
canMap
Returns true if this mapper can map the provided Java Object.- Parameters:
parameter
- the java object to check- Returns:
- true if this object can be mapped.
-
mapJavaToInternal
Maps a java object to a data format's internal data representation.- Parameters:
parameter
- object that is mapped- Returns:
- the data format's internal representation of that object
-
mapInternalToJava
Maps 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.- 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
Maps the internal representation of a data format to a java object of the desired class. The desired class is validated by thevalidator
prior to the mapping.- 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
Maps 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 aClass
object. The desired class is not validated prior to the mapping.- 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
<T> T mapInternalToJava(Object parameter, String typeIdentifier, DeserializationTypeValidator validator) Maps 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 aClass
object. The desired class is validated by thevalidator
prior to the mapping.- 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
-
getCanonicalTypeName
-