Class StaxBuilder


  • public class StaxBuilder
    extends Object
    Builds a JDOM org.jdom.Document using a XMLStreamReader.
    Author:
    Tatu Saloranta, Bradley S. Huffman, Benson I. Margulies, mods for CXF to allow reading a portion of a stream.
    • Field Detail

      • cfgIgnoreWS

        protected boolean cfgIgnoreWS
        Whether ignorable white space should be ignored, ie not added in the resulting JDOM tree. If true, it will be ignored; if false, it will be added in the tree. Default value if false.
    • Constructor Detail

      • StaxBuilder

        public StaxBuilder()
        Default constructor.
    • Method Detail

      • getAdditionalNamespaces

        public Map<String,​String> getAdditionalNamespaces()
      • setAdditionalNamespaces

        public void setAdditionalNamespaces​(Map<String,​String> additionalNamespaces)
      • setFactory

        public void setFactory​(org.jdom.JDOMFactory f)
      • setIgnoreWhitespace

        public void setIgnoreWhitespace​(boolean state)
      • getFactory

        public org.jdom.JDOMFactory getFactory()
        Returns the current JDOMFactory in use, if one has been previously set with setFactory(org.jdom.JDOMFactory), otherwise null.
        Returns:
        the factory builder will use
      • build

        public org.jdom.Document build​(XMLStreamReader r)
                                throws XMLStreamException
        This will build a JDOM tree given a StAX stream reader. This API explicitly supports building mid-stream.
        Parameters:
        r - Stream reader from which input is read.
        Returns:
        Document - JDOM document object.
        Throws:
        XMLStreamException - If the reader threw such exception (to indicate a parsing or I/O problem)