Class DomXmlDataFormat
- java.lang.Object
-
- org.camunda.bpm.client.variable.impl.format.xml.DomXmlDataFormat
-
- All Implemented Interfaces:
DataFormat
public class DomXmlDataFormat extends Object implements DataFormat
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentBuilderFactorydocumentBuilderFactorythe DocumentBuilderFactory used by the readerprotected static DomXmlLoggerLOGprotected Stringnameprotected TransformerFactorytransformerFactorythe TransformerFactory instance used by the writer
-
Constructor Summary
Constructors Constructor Description DomXmlDataFormat(String name)DomXmlDataFormat(String name, DocumentBuilderFactory documentBuilderFactory)DomXmlDataFormat(String name, DocumentBuilderFactory documentBuilderFactory, TransformerFactory transformerFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanMap(Object value)Returns true if this data format can map the provided Java Object.protected MarshallercreateMarshaller(Class<?>... types)protected UnmarshallercreateUnmarshaller(Class<?>... types)static DocumentBuilderFactorydefaultDocumentBuilderFactory()static TransformerFactorydefaultTransformerFactory()StringgetCanonicalTypeName(Object value)Returns a data-format-specific canonical type name.protected JAXBContextgetContext(Class<?>... types)protected DocumentBuildergetDocumentBuilder()DocumentBuilderFactorygetDocumentBuilderFactory()StringgetName()Returns the data format name.protected TransformergetTransformer()TransformerFactorygetTransformerFactory()static Class<?>loadClass(String classname, DataFormat dataFormat)ElementreadAsElement(String value)<T> TreadValue(String value, Class<T> cls)Reads the internal representation of a data format to a java object of the desired class.<T> TreadValue(String value, String typeIdentifier)Reads the internal representation of a data format to a java object of the desired class.protected ElementwriteAsElement(Object value)protected voidwriteResult(StreamResult streamResult, Object input)StringwriteValue(Object value)Writes a java object to a data format's internal data representation.
-
-
-
Field Detail
-
LOG
protected static final DomXmlLogger LOG
-
name
protected String name
-
documentBuilderFactory
protected DocumentBuilderFactory documentBuilderFactory
the DocumentBuilderFactory used by the reader
-
transformerFactory
protected TransformerFactory transformerFactory
the TransformerFactory instance used by the writer
-
-
Constructor Detail
-
DomXmlDataFormat
public DomXmlDataFormat(String name)
-
DomXmlDataFormat
public DomXmlDataFormat(String name, DocumentBuilderFactory documentBuilderFactory)
-
DomXmlDataFormat
public DomXmlDataFormat(String name, DocumentBuilderFactory documentBuilderFactory, TransformerFactory transformerFactory)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:DataFormatReturns the data format name.- Specified by:
getNamein interfaceDataFormat
-
getDocumentBuilderFactory
public DocumentBuilderFactory getDocumentBuilderFactory()
-
getTransformerFactory
public TransformerFactory getTransformerFactory()
-
canMap
public boolean canMap(Object value)
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 String writeValue(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(String value, 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(String value, 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
-
getCanonicalTypeName
public String getCanonicalTypeName(Object value)
Description copied from interface:DataFormatReturns a data-format-specific canonical type name.- Specified by:
getCanonicalTypeNamein interfaceDataFormat
-
writeResult
protected void writeResult(StreamResult streamResult, Object input)
-
getTransformer
protected Transformer getTransformer()
-
getDocumentBuilder
protected DocumentBuilder getDocumentBuilder()
-
getContext
protected JAXBContext getContext(Class<?>... types)
-
createMarshaller
protected Marshaller createMarshaller(Class<?>... types)
-
createUnmarshaller
protected Unmarshaller createUnmarshaller(Class<?>... types)
-
defaultTransformerFactory
public static TransformerFactory defaultTransformerFactory()
-
defaultDocumentBuilderFactory
public static DocumentBuilderFactory defaultDocumentBuilderFactory()
-
loadClass
public static Class<?> loadClass(String classname, DataFormat dataFormat)
-
-