Class AbstractStAXEventProcessor

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void printCDATA​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, javax.xml.stream.XMLEventFactory eventfactory, CDATA cdata)
      This will handle printing of a CDATA.
      protected void printComment​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, javax.xml.stream.XMLEventFactory eventfactory, Comment comment)
      This will handle printing of a Comment.
      protected void printContent​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, NamespaceStack nstack, javax.xml.stream.XMLEventFactory eventfactory, Walker walker)
      This will handle printing of a List of Content.
      protected void printDocType​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, javax.xml.stream.XMLEventFactory eventfactory, DocType docType)
      This will handle printing of a DocType.
      protected void printDocument​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, NamespaceStack nstack, javax.xml.stream.XMLEventFactory eventfactory, Document doc)
      This will handle printing of a Document.
      protected void printElement​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, NamespaceStack nstack, javax.xml.stream.XMLEventFactory eventfactory, Element element)
      This will handle printing of an Element.
      protected void printEntityRef​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, javax.xml.stream.XMLEventFactory eventfactory, EntityRef entity)
      This will handle printing of an EntityRef.
      protected void printProcessingInstruction​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, javax.xml.stream.XMLEventFactory eventfactory, ProcessingInstruction pi)
      This will handle printing of a ProcessingInstruction.
      protected void printText​(javax.xml.stream.util.XMLEventConsumer out, FormatStack fstack, javax.xml.stream.XMLEventFactory eventfactory, Text text)
      This will handle printing of a Text.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, java.util.List<? extends Content> list)
      This will handle printing out a list of nodes.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, CDATA cdata)
      Print out a CDATA node.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, Comment comment)
      Print out a Comment.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, DocType doctype)
      Print out the DocType.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, Document doc)
      This will print the Document to the given XMLEventConsumer.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, Element element)
      Print out an Element, including its Attributes, and all contained (child) elements, etc.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, EntityRef entity)
      Print out a EntityRef.
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, ProcessingInstruction pi)
      void process​(javax.xml.stream.util.XMLEventConsumer out, Format format, javax.xml.stream.XMLEventFactory eventfactory, Text text)
      Print out a Text node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractStAXEventProcessor

        public AbstractStAXEventProcessor()
    • Method Detail

      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            Document doc)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        This will print the Document to the given XMLEventConsumer.

        Warning: using your own XMLEventConsumer may cause the outputter's preferred character encoding to be ignored. If you use encodings other than UTF-8, we recommend using the method that takes an OutputStream instead.

        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        doc - Document to format.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            DocType doctype)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Print out the DocType.
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        doctype - DocType to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            Element element)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Print out an Element, including its Attributes, and all contained (child) elements, etc.
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        element - Element to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            java.util.List<? extends Content> list)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        This will handle printing out a list of nodes. This can be useful for printing the content of an element that contains HTML, like "<description>JDOM is <b>fun>!</description>".
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        list - List of nodes.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            CDATA cdata)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Print out a CDATA node.
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        cdata - CDATA to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            Text text)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Print out a Text node. Performs the necessary entity escaping and whitespace stripping.
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        text - Text to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            Comment comment)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Print out a Comment.
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        comment - Comment to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            ProcessingInstruction pi)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        pi - ProcessingInstruction to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • process

        public void process​(javax.xml.stream.util.XMLEventConsumer out,
                            Format format,
                            javax.xml.stream.XMLEventFactory eventfactory,
                            EntityRef entity)
                     throws javax.xml.stream.XMLStreamException
        Description copied from interface: StAXEventProcessor
        Print out a EntityRef.
        Specified by:
        process in interface StAXEventProcessor
        Parameters:
        out - XMLEventConsumer to use.
        format - Format instance specifying output style
        eventfactory - XMLEventFactory for creating XMLEvent instances.
        entity - EntityRef to output.
        Throws:
        javax.xml.stream.XMLStreamException - if there's any problem writing.
      • printDocument

        protected void printDocument​(javax.xml.stream.util.XMLEventConsumer out,
                                     FormatStack fstack,
                                     NamespaceStack nstack,
                                     javax.xml.stream.XMLEventFactory eventfactory,
                                     Document doc)
                              throws javax.xml.stream.XMLStreamException
        This will handle printing of a Document.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        nstack - the NamespaceStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        doc - Document to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printDocType

        protected void printDocType​(javax.xml.stream.util.XMLEventConsumer out,
                                    FormatStack fstack,
                                    javax.xml.stream.XMLEventFactory eventfactory,
                                    DocType docType)
                             throws javax.xml.stream.XMLStreamException
        This will handle printing of a DocType.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        docType - DocType to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printProcessingInstruction

        protected void printProcessingInstruction​(javax.xml.stream.util.XMLEventConsumer out,
                                                  FormatStack fstack,
                                                  javax.xml.stream.XMLEventFactory eventfactory,
                                                  ProcessingInstruction pi)
                                           throws javax.xml.stream.XMLStreamException
        This will handle printing of a ProcessingInstruction.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        pi - ProcessingInstruction to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printComment

        protected void printComment​(javax.xml.stream.util.XMLEventConsumer out,
                                    FormatStack fstack,
                                    javax.xml.stream.XMLEventFactory eventfactory,
                                    Comment comment)
                             throws javax.xml.stream.XMLStreamException
        This will handle printing of a Comment.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        comment - Comment to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printEntityRef

        protected void printEntityRef​(javax.xml.stream.util.XMLEventConsumer out,
                                      FormatStack fstack,
                                      javax.xml.stream.XMLEventFactory eventfactory,
                                      EntityRef entity)
                               throws javax.xml.stream.XMLStreamException
        This will handle printing of an EntityRef.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        entity - EntotyRef to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printCDATA

        protected void printCDATA​(javax.xml.stream.util.XMLEventConsumer out,
                                  FormatStack fstack,
                                  javax.xml.stream.XMLEventFactory eventfactory,
                                  CDATA cdata)
                           throws javax.xml.stream.XMLStreamException
        This will handle printing of a CDATA.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        cdata - CDATA to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printText

        protected void printText​(javax.xml.stream.util.XMLEventConsumer out,
                                 FormatStack fstack,
                                 javax.xml.stream.XMLEventFactory eventfactory,
                                 Text text)
                          throws javax.xml.stream.XMLStreamException
        This will handle printing of a Text.
        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        text - Text to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printElement

        protected void printElement​(javax.xml.stream.util.XMLEventConsumer out,
                                    FormatStack fstack,
                                    NamespaceStack nstack,
                                    javax.xml.stream.XMLEventFactory eventfactory,
                                    Element element)
                             throws javax.xml.stream.XMLStreamException
        This will handle printing of an Element.

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

        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        nstack - the NamespaceStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        element - Element to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails
      • printContent

        protected void printContent​(javax.xml.stream.util.XMLEventConsumer out,
                                    FormatStack fstack,
                                    NamespaceStack nstack,
                                    javax.xml.stream.XMLEventFactory eventfactory,
                                    Walker walker)
                             throws javax.xml.stream.XMLStreamException
        This will handle printing of a List of Content.

        Parameters:
        out - XMLEventConsumer to use.
        fstack - the FormatStack
        nstack - the NamespaceStack
        eventfactory - The XMLEventFactory for creating XMLEvents
        walker - Walker of Content to write.
        Throws:
        javax.xml.stream.XMLStreamException - if the destination XMLEventConsumer fails