Class XmlMarshallingContext

    • Field Detail

      • document

        protected org.w3c.dom.Document document
      • parent

        protected org.w3c.dom.Node parent
    • Constructor Detail

      • XmlMarshallingContext

        public XmlMarshallingContext​(int groupDepth)
        Constructs a new XmlMarshallingContext.
        Parameters:
        groupDepth - the maximum depth of a group in the parser tree
    • Method Detail

      • getDocument

        public org.w3c.dom.Document getDocument()
        Returns the document being marshalled.
        Returns:
        the Document being marshalled
      • openGroup

        public void openGroup​(XmlNode node)
        Adds a group to be marshalled when the next record is written to the output stream.
        Parameters:
        node - the group element to add
      • closeGroup

        public void closeGroup​(XmlNode node)
        Indicates a group element should be closed before marshalling the next record.
        Parameters:
        node - the XmlNode to close
      • getParent

        public org.w3c.dom.Node getParent()
        Returns the parent node to append in the document being marshalled.
        Returns:
        the parent Node
      • setParent

        public void setParent​(org.w3c.dom.Node parent)
        Sets the parent node to append in the document being marshalled.
        Parameters:
        parent - the parent Node
      • toDocument

        public org.w3c.dom.Document toDocument​(java.lang.Object record)
        Description copied from class: MarshallingContext
        Converts a record object to a Document.
        Overrides:
        toDocument in class MarshallingContext
        Parameters:
        record - the record object to convert
        Returns:
        the Document result, or null if not supported
      • setStreaming

        public void setStreaming​(boolean streaming)
        Sets whether a stream is being marshalled, versus a single document.
        Parameters:
        streaming - true if marshalling a stream, false if marshalling single documents
      • isStreaming

        public boolean isStreaming()
        Returns whether a stream is being marshalled, versus a single document.
        Returns:
        true if marshalling a stream, false if marshalling single documents