Class AbstractDOMOutputProcessor

    • Constructor Detail

      • AbstractDOMOutputProcessor

        public AbstractDOMOutputProcessor()
    • Method Detail

      • process

        public Document process​(Document basedoc,
                                Format format,
                                Document doc)
        Description copied from interface: DOMOutputProcessor
        This will convert the Document to the given DOM Document.

        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        doc - Document to format.
        Returns:
        The same DOM Document as the input document, but with the JDOM content converted and added.
      • process

        public Element process​(Document basedoc,
                               Format format,
                               Element element)
        Description copied from interface: DOMOutputProcessor
        This will convert the Element using the given DOM Document to create the resulting DOM Element.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        element - Element to format.
        Returns:
        The input JDOM Element converted to a DOM Element
      • process

        public List<Node> process​(Document basedoc,
                                  Format format,
                                  List<? extends Content> list)
        Description copied from interface: DOMOutputProcessor
        This will convert the list of JDOM Content using the given DOM Document to create the resulting list of DOM Nodes.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        list - JDOM Content to convert.
        Returns:
        The input JDOM Content List converted to a List of DOM Nodes
      • process

        public CDATASection process​(Document basedoc,
                                    Format format,
                                    CDATA cdata)
        Description copied from interface: DOMOutputProcessor
        This will convert the CDATA using the given DOM Document to create the resulting DOM CDATASection.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        cdata - CDATA to format.
        Returns:
        The input JDOM CDATA converted to a DOM CDATASection
      • process

        public Text process​(Document basedoc,
                            Format format,
                            Text text)
        Description copied from interface: DOMOutputProcessor
        This will convert the Text using the given DOM Document to create the resulting DOM Text.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        text - Text to format.
        Returns:
        The input JDOM Text converted to a DOM Text
      • process

        public Comment process​(Document basedoc,
                               Format format,
                               Comment comment)
        Description copied from interface: DOMOutputProcessor
        This will convert the Comment using the given DOM Document to create the resulting DOM Comment.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        comment - Comment to format.
        Returns:
        The input JDOM Comment converted to a DOM Comment
      • process

        public EntityReference process​(Document basedoc,
                                       Format format,
                                       EntityRef entity)
        Description copied from interface: DOMOutputProcessor
        This will convert the EntityRef using the given DOM Document to create the resulting DOM EntityReference.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        entity - EntityRef to format.
        Returns:
        The input JDOM EntityRef converted to a DOM EntityReference
      • process

        public Attr process​(Document basedoc,
                            Format format,
                            Attribute attribute)
        Description copied from interface: DOMOutputProcessor
        This will convert the Attribute using the given DOM Document to create the resulting DOM Attr.
        Specified by:
        process in interface DOMOutputProcessor
        Parameters:
        basedoc - The DOM document to use for the conversion
        format - Format instance specifying output style
        attribute - Attribute to format.
        Returns:
        The input JDOM Attribute converted to a DOM Attr
      • printDocument

        protected Document printDocument​(FormatStack fstack,
                                         NamespaceStack nstack,
                                         Document basedoc,
                                         Document doc)
        This will handle printing of a Document.
        Parameters:
        fstack - the FormatStack
        nstack - the NamespaceStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        doc - Document to write.
        Returns:
        The input JDOM document converted to a DOM document.
      • printProcessingInstruction

        protected ProcessingInstruction printProcessingInstruction​(FormatStack fstack,
                                                                   Document basedoc,
                                                                   ProcessingInstruction pi)
        This will handle printing of a ProcessingInstruction.
        Parameters:
        fstack - the FormatStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        pi - ProcessingInstruction to write.
        Returns:
        The input JDOM ProcessingInstruction converted to a DOM ProcessingInstruction.
      • printComment

        protected Comment printComment​(FormatStack fstack,
                                       Document basedoc,
                                       Comment comment)
        This will handle printing of a Comment.
        Parameters:
        fstack - the FormatStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        comment - Comment to write.
        Returns:
        The input JDOM Comment converted to a DOM Comment
      • printEntityRef

        protected EntityReference printEntityRef​(FormatStack fstack,
                                                 Document basedoc,
                                                 EntityRef entity)
        This will handle printing of an EntityRef.
        Parameters:
        fstack - the FormatStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        entity - EntotyRef to write.
        Returns:
        The input JDOM EntityRef converted to a DOM EntityReference
      • printCDATA

        protected CDATASection printCDATA​(FormatStack fstack,
                                          Document basedoc,
                                          CDATA cdata)
        This will handle printing of a CDATA.
        Parameters:
        fstack - the FormatStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        cdata - CDATA to write.
        Returns:
        The input JDOM CDATA converted to a DOM CDATASection
      • printText

        protected Text printText​(FormatStack fstack,
                                 Document basedoc,
                                 Text text)
        This will handle printing of a Text.
        Parameters:
        fstack - the FormatStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        text - Text to write.
        Returns:
        The input JDOM Text converted to a DOM Text
      • printAttribute

        protected Attr printAttribute​(FormatStack fstack,
                                      Document basedoc,
                                      Attribute attribute)
        This will handle printing of a Attribute.
        Parameters:
        fstack - the FormatStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        attribute - Attribute to write.
        Returns:
        The input JDOM Attribute converted to a DOM Attr
      • printElement

        protected Element printElement​(FormatStack fstack,
                                       NamespaceStack nstack,
                                       Document basedoc,
                                       Element element)
        This will handle printing of an Element.

        This method arranges for outputting the Element infrastructure including Namespace Declarations and Attributes.

        The actual formatting of the content is managed by the Walker created for the Element's content.

        Parameters:
        fstack - the FormatStack
        nstack - the NamespaceStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        element - Element to write.
        Returns:
        The input JDOM Element converted to a DOM Element
      • printContent

        protected void printContent​(FormatStack fstack,
                                    NamespaceStack nstack,
                                    Document basedoc,
                                    Node target,
                                    Walker walker)
        This will handle printing of a List of Content. Uses the Walker to ensure formatting.
        Parameters:
        fstack - the FormatStack
        nstack - the NamespaceStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        target - the DOM node this content should be appended to.
        walker - List of Content to write.
      • helperContentDispatcher

        protected Node helperContentDispatcher​(FormatStack fstack,
                                               NamespaceStack nstack,
                                               Document basedoc,
                                               Content content)
        This method contains code which is reused in a number of places. It simply determines what content is passed in, and dispatches it to the correct print* method.
        Parameters:
        fstack - The current FormatStack
        nstack - the NamespaceStack
        basedoc - The org.w3c.dom.Document for creating DOM Nodes
        content - The content to dispatch
        Returns:
        the input JDOM Content converted to a DOM Node.