Class DomXmlDataFormatWriter
- java.lang.Object
-
- org.camunda.spin.impl.xml.dom.format.DomXmlDataFormatWriter
-
- All Implemented Interfaces:
DataFormatWriter
public class DomXmlDataFormatWriter extends java.lang.Object implements DataFormatWriter
A writer for XML DOM.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected DomXmlDataFormat
domXmlDataFormat
protected javax.xml.transform.Templates
formattingTemplates
protected static DomXmlLogger
LOG
protected static java.lang.String
STRIP_SPACE_XSL
-
Constructor Summary
Constructors Constructor Description DomXmlDataFormatWriter(DomXmlDataFormat domXmlDataFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.xml.transform.Transformer
getFormattingTransformer()
Returns a configured transformer to write XML and apply indentation (pretty-print) to the xml.protected javax.xml.transform.Transformer
getTransformer()
Returns a configured transformer to write XML as is.protected javax.xml.transform.Templates
reloadFormattingTemplates()
Return aTemplates
instance for the strip-spaces.xsl stylesheet.protected void
writeResult(javax.xml.transform.stream.StreamResult streamResult, java.lang.Object input)
void
writeToWriter(java.io.Writer writer, java.lang.Object input)
-
-
-
Field Detail
-
LOG
protected static final DomXmlLogger LOG
-
STRIP_SPACE_XSL
protected static final java.lang.String STRIP_SPACE_XSL
- See Also:
- Constant Field Values
-
domXmlDataFormat
protected DomXmlDataFormat domXmlDataFormat
-
formattingTemplates
protected javax.xml.transform.Templates formattingTemplates
-
-
Constructor Detail
-
DomXmlDataFormatWriter
public DomXmlDataFormatWriter(DomXmlDataFormat domXmlDataFormat)
-
-
Method Detail
-
writeToWriter
public void writeToWriter(java.io.Writer writer, java.lang.Object input)
- Specified by:
writeToWriter
in interfaceDataFormatWriter
-
writeResult
protected void writeResult(javax.xml.transform.stream.StreamResult streamResult, java.lang.Object input)
-
reloadFormattingTemplates
protected javax.xml.transform.Templates reloadFormattingTemplates()
Return aTemplates
instance for the strip-spaces.xsl stylesheet. Uses the configuredTransformerFactory
from theDomXmlDataFormat
.- Returns:
- the templates instance for strip-spaces.xsl.
-
getFormattingTransformer
protected javax.xml.transform.Transformer getFormattingTransformer()
Returns a configured transformer to write XML and apply indentation (pretty-print) to the xml.- Returns:
- the XML configured transformer
- Throws:
SpinXmlElementException
- if no new transformer can be created
-
getTransformer
protected javax.xml.transform.Transformer getTransformer()
Returns a configured transformer to write XML as is.- Returns:
- the XML configured transformer
- Throws:
SpinXmlElementException
- if no new transformer can be created
-
-