Class DomXmlDataFormatMapper
java.lang.Object
org.camunda.spin.impl.xml.dom.format.DomXmlDataFormatMapper
- All Implemented Interfaces:
DataFormatMapper
DataFormatMapper
using JAXB for mapping Java Objects to XML and vice-versa.- Author:
- Stefan Hentschel., Daniel Meyer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this mapper can map the provided Java Object.getCanonicalTypeName
(Object object) protected javax.xml.bind.Marshaller
getMarshaller
(Class<?> parameter) protected javax.xml.bind.Unmarshaller
getUnmarshaller
(Class<?> parameter) <T> T
mapInternalToJava
(Object parameter, Class<T> javaClass) Maps the internal representation of a data format to a java object of the desired class.<T> T
mapInternalToJava
(Object parameter, Class<T> javaClass, DeserializationTypeValidator validator) Maps the internal representation of a data format to a java object of the desired class.<T> T
mapInternalToJava
(Object parameter, String classIdentifier) Maps the internal representation of a data format to a java object of the desired class.<T> T
mapInternalToJava
(Object parameter, String classIdentifier, 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.protected void
marshalNonRootElement
(Object parameter, javax.xml.bind.Marshaller marshaller, DOMResult domResult) protected void
marshalRootElement
(Object parameter, javax.xml.bind.Marshaller marshaller, DOMResult domResult) protected void
validateType
(Class<?> type, DeserializationTypeValidator validator)
-
Field Details
-
dataFormat
-
-
Constructor Details
-
DomXmlDataFormatMapper
-
-
Method Details
-
canMap
Description copied from interface:DataFormatMapper
Returns true if this mapper can map the provided Java Object.- Specified by:
canMap
in interfaceDataFormatMapper
- Parameters:
parameter
- the java object to check- Returns:
- true if this object can be mapped.
-
getCanonicalTypeName
- Specified by:
getCanonicalTypeName
in interfaceDataFormatMapper
-
mapJavaToInternal
Description copied from interface:DataFormatMapper
Maps a java object to a data format's internal data representation.- Specified by:
mapJavaToInternal
in interfaceDataFormatMapper
- Parameters:
parameter
- object that is mapped- Returns:
- the data format's internal representation of that object
-
marshalRootElement
protected void marshalRootElement(Object parameter, javax.xml.bind.Marshaller marshaller, DOMResult domResult) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
marshalNonRootElement
protected void marshalNonRootElement(Object parameter, javax.xml.bind.Marshaller marshaller, DOMResult domResult) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
mapInternalToJava
Description copied from interface:DataFormatMapper
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.- Specified by:
mapInternalToJava
in interfaceDataFormatMapper
- Parameters:
parameter
- the object to be mappedjavaClass
- 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(Object parameter, Class<T> javaClass, DeserializationTypeValidator validator) Description copied from interface:DataFormatMapper
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.- Specified by:
mapInternalToJava
in interfaceDataFormatMapper
- Parameters:
parameter
- the object to be mappedjavaClass
- 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
-
validateType
-
mapInternalToJava
Description copied from interface:DataFormatMapper
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.- Specified by:
mapInternalToJava
in interfaceDataFormatMapper
- Parameters:
parameter
- the object to be mappedclassIdentifier
- 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(Object parameter, String classIdentifier, DeserializationTypeValidator validator) Description copied from interface:DataFormatMapper
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.- Specified by:
mapInternalToJava
in interfaceDataFormatMapper
- Parameters:
parameter
- the object to be mappedclassIdentifier
- 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
-
getMarshaller
protected javax.xml.bind.Marshaller getMarshaller(Class<?> parameter) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
getUnmarshaller
protected javax.xml.bind.Unmarshaller getUnmarshaller(Class<?> parameter) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-