Class FastSaxBuilder


  • public class FastSaxBuilder
    extends org.jdom.input.SAXBuilder
    A Sax Builder that is faster and uses less memory than the standard sax builder it extends (SAXBuilder). This sax builder uses no validation and discards all whitespace only text content fields that have no siblings (see FastSaxHandler.setIgnoreBoundaryWhitespaceWithSiblings(boolean))
    • Constructor Summary

      Constructors 
      Constructor Description
      FastSaxBuilder()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.jdom.Document build​(java.io.File file)  
      org.jdom.Document build​(java.io.InputStream in)  
      org.jdom.Document build​(java.io.InputStream in, long maximumExpectedSize)
      This builds a document from the supplied input stream.
      org.jdom.Document build​(java.io.Reader characterStream)  
      org.jdom.Document build​(java.io.Reader in, long maximumExpectedSize)
      This builds a document from the supplied reader
      protected void configureParser​(org.xml.sax.XMLReader parser, org.jdom.input.SAXHandler contentHandler)  
      protected org.jdom.input.SAXHandler createContentHandler()  
      static java.lang.String getTotalBuildTimes()
      Get a text description of the total time spent parsing XML by all FastSAXBuilders.
      • Methods inherited from class org.jdom.input.SAXBuilder

        build, build, build, build, build, configureContentHandler, createParser, getDriverClass, getDTDHandler, getEntityResolver, getErrorHandler, getExpandEntities, getFactory, getIgnoringBoundaryWhitespace, getIgnoringElementContentWhitespace, getReuseParser, getValidation, getXMLFilter, setDTDHandler, setEntityResolver, setErrorHandler, setExpandEntities, setFactory, setFeature, setIgnoringBoundaryWhitespace, setIgnoringElementContentWhitespace, setProperty, setReuseParser, setValidation, setXMLFilter
      • Methods inherited from class java.lang.Object

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

      • FastSaxBuilder

        public FastSaxBuilder()
    • Method Detail

      • createContentHandler

        protected org.jdom.input.SAXHandler createContentHandler()
        Overrides:
        createContentHandler in class org.jdom.input.SAXBuilder
      • build

        public org.jdom.Document build​(java.io.InputStream in,
                                       long maximumExpectedSize)
                                throws org.jdom.JDOMException,
                                       java.io.IOException
        This builds a document from the supplied input stream.
        Parameters:
        in - the input stream to build the xml from
        maximumExpectedSize - the maximum size in bytes of the data that will be read from the input stream. This is used to allocate more appropriate buffer sizes and hence reduce memory usage and increase speed. This may be <=0 in which case some of the performance benefits of this class will be lost.
        Returns:
        the document build.
        Throws:
        org.jdom.JDOMException
        java.io.IOException
      • build

        public org.jdom.Document build​(java.io.Reader in,
                                       long maximumExpectedSize)
                                throws org.jdom.JDOMException,
                                       java.io.IOException
        This builds a document from the supplied reader
        Parameters:
        in - the reader to build the xml from
        maximumExpectedSize - the maximum size in bytes of the data that will be read from the input stream. This is used to allocate more appropriate buffer sizes and hence reduce memory usage and increase speed. This may be <=0 in which case some of the performance benefits of this class will be lost.
        Returns:
        the document build.
        Throws:
        org.jdom.JDOMException
        java.io.IOException
      • build

        public org.jdom.Document build​(java.io.InputStream in)
                                throws org.jdom.JDOMException,
                                       java.io.IOException
        Overrides:
        build in class org.jdom.input.SAXBuilder
        Throws:
        org.jdom.JDOMException
        java.io.IOException
      • build

        public org.jdom.Document build​(java.io.Reader characterStream)
                                throws org.jdom.JDOMException,
                                       java.io.IOException
        Overrides:
        build in class org.jdom.input.SAXBuilder
        Throws:
        org.jdom.JDOMException
        java.io.IOException
      • build

        public org.jdom.Document build​(java.io.File file)
                                throws org.jdom.JDOMException,
                                       java.io.IOException
        Overrides:
        build in class org.jdom.input.SAXBuilder
        Throws:
        org.jdom.JDOMException
        java.io.IOException
      • getTotalBuildTimes

        public static java.lang.String getTotalBuildTimes()
        Get a text description of the total time spent parsing XML by all FastSAXBuilders.
        Returns:
        a text description of the total time spent parsing XML by all FastSAXBuilders.
      • configureParser

        protected void configureParser​(org.xml.sax.XMLReader parser,
                                       org.jdom.input.SAXHandler contentHandler)
        Overrides:
        configureParser in class org.jdom.input.SAXBuilder