Class AbstractDocumentWriter

All Implemented Interfaces:
ExtendedHierarchicalStreamWriter, HierarchicalStreamWriter, DocumentWriter, XmlFriendlyWriter
Direct Known Subclasses:
Dom4JWriter, DomWriter, JDom2Writer, JDomWriter, XppDomWriter

public abstract class AbstractDocumentWriter extends AbstractXmlWriter implements DocumentWriter
A generic HierarchicalStreamWriter for DOM writer implementations. The implementation manages a list of top level DOM nodes. Every time the last node is closed on the node stack, the next started node is added to the list. This list can be retrieved using the DocumentWriter.getTopLevelNodes() method.
Since:
1.2.1
  • Field Details

    • result

      private final List result
    • nodeStack

      private final FastStack nodeStack
  • Constructor Details

    • AbstractDocumentWriter

      public AbstractDocumentWriter(Object container, NameCoder nameCoder)
      Constructs an AbstractDocumentWriter.
      Parameters:
      container - the top level container for the nodes to create (may be null)
      nameCoder - the object that creates XML-friendly names
      Since:
      1.4
    • AbstractDocumentWriter

      public AbstractDocumentWriter(Object container, XmlFriendlyReplacer replacer)
      Deprecated.
      Constructs an AbstractDocumentWriter.
      Parameters:
      container - the top level container for the nodes to create (may be null)
      replacer - the object that creates XML-friendly names
      Since:
      1.2.1
  • Method Details