Class DomXmlDataFormatWriter

java.lang.Object
org.camunda.spin.impl.xml.dom.format.DomXmlDataFormatWriter
All Implemented Interfaces:
DataFormatWriter

public class DomXmlDataFormatWriter extends Object implements DataFormatWriter
A writer for XML DOM.
Author:
Daniel Meyer
  • Field Details

  • Constructor Details

    • DomXmlDataFormatWriter

      public DomXmlDataFormatWriter(DomXmlDataFormat domXmlDataFormat)
  • Method Details

    • writeToWriter

      public void writeToWriter(Writer writer, Object input)
      Description copied from interface: DataFormatWriter
      Writes the internal representation, as provided by input to the supplied writer according to the data format that the implementation belongs to. For example, an XML data format writer writes XML.
      Specified by:
      writeToWriter in interface DataFormatWriter
      Parameters:
      writer - The writer to write the output to
      input - The object to write. Can be safely cast to the internal format of the data format.
    • writeResult

      protected void writeResult(StreamResult streamResult, Object input)
    • reloadFormattingTemplates

      protected Templates reloadFormattingTemplates()
      Return a Templates instance for formatting configuration. Uses the configured TransformerFactory from the DomXmlDataFormat. Uses the formatting configuration from the DomXmlDataFormat if defined, falls back to a default otherwise.
      Returns:
      the templates instance for the formatting configuration.
    • setFormattingTemplates

      protected void setFormattingTemplates(Templates formattingTemplates)
      Set the Templates which used for creating the transformer.
      Parameters:
      formattingTemplates -
    • getFormattingTransformer

      protected 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 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