Class SAXDocumentParser

  • All Implemented Interfaces:
    FastInfosetParser, FastInfosetReader, org.xml.sax.XMLReader

    public class SAXDocumentParser
    extends Decoder
    implements FastInfosetReader
    The Fast Infoset SAX parser.

    Instantiate this parser to parse a fast infoset document in accordance with the SAX API.

    More than one fast infoset document may be decoded from the InputStream.

    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • _namespacePrefixesFeature

        protected boolean _namespacePrefixesFeature
        SAX Namespace attributes features
      • _entityResolver

        protected org.xml.sax.EntityResolver _entityResolver
        Reference to entity resolver.
      • _dtdHandler

        protected org.xml.sax.DTDHandler _dtdHandler
        Reference to dtd handler.
      • _contentHandler

        protected org.xml.sax.ContentHandler _contentHandler
        Reference to content handler.
      • _errorHandler

        protected org.xml.sax.ErrorHandler _errorHandler
        Reference to error handler.
      • _lexicalHandler

        protected org.xml.sax.ext.LexicalHandler _lexicalHandler
        Reference to lexical handler.
      • _declHandler

        protected org.xml.sax.ext.DeclHandler _declHandler
        Reference to DTD declaration handler.
      • _namespacePrefixes

        protected int[] _namespacePrefixes
      • _namespacePrefixesIndex

        protected int _namespacePrefixesIndex
      • _clearAttributes

        protected boolean _clearAttributes
    • Constructor Detail

      • SAXDocumentParser

        public SAXDocumentParser()
        Creates a new instance of DocumetParser2
    • Method Detail

      • resetOnError

        protected void resetOnError()
      • getFeature

        public boolean getFeature​(java.lang.String name)
                           throws org.xml.sax.SAXNotRecognizedException,
                                  org.xml.sax.SAXNotSupportedException
        Specified by:
        getFeature in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • setFeature

        public void setFeature​(java.lang.String name,
                               boolean value)
                        throws org.xml.sax.SAXNotRecognizedException,
                               org.xml.sax.SAXNotSupportedException
        Specified by:
        setFeature in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
                                     throws org.xml.sax.SAXNotRecognizedException,
                                            org.xml.sax.SAXNotSupportedException
        Specified by:
        getProperty in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • setProperty

        public void setProperty​(java.lang.String name,
                                java.lang.Object value)
                         throws org.xml.sax.SAXNotRecognizedException,
                                org.xml.sax.SAXNotSupportedException
        Specified by:
        setProperty in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • setEntityResolver

        public void setEntityResolver​(org.xml.sax.EntityResolver resolver)
        Specified by:
        setEntityResolver in interface org.xml.sax.XMLReader
      • getEntityResolver

        public org.xml.sax.EntityResolver getEntityResolver()
        Specified by:
        getEntityResolver in interface org.xml.sax.XMLReader
      • setDTDHandler

        public void setDTDHandler​(org.xml.sax.DTDHandler handler)
        Specified by:
        setDTDHandler in interface org.xml.sax.XMLReader
      • getDTDHandler

        public org.xml.sax.DTDHandler getDTDHandler()
        Specified by:
        getDTDHandler in interface org.xml.sax.XMLReader
      • setContentHandler

        public void setContentHandler​(org.xml.sax.ContentHandler handler)
        Specified by:
        setContentHandler in interface org.xml.sax.XMLReader
      • getContentHandler

        public org.xml.sax.ContentHandler getContentHandler()
        Specified by:
        getContentHandler in interface org.xml.sax.XMLReader
      • setErrorHandler

        public void setErrorHandler​(org.xml.sax.ErrorHandler handler)
        Specified by:
        setErrorHandler in interface org.xml.sax.XMLReader
      • getErrorHandler

        public org.xml.sax.ErrorHandler getErrorHandler()
        Specified by:
        getErrorHandler in interface org.xml.sax.XMLReader
      • parse

        public void parse​(org.xml.sax.InputSource input)
                   throws java.io.IOException,
                          org.xml.sax.SAXException
        Specified by:
        parse in interface org.xml.sax.XMLReader
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • parse

        public void parse​(java.lang.String systemId)
                   throws java.io.IOException,
                          org.xml.sax.SAXException
        Specified by:
        parse in interface org.xml.sax.XMLReader
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • parse

        public final void parse​(java.io.InputStream s)
                         throws java.io.IOException,
                                FastInfosetException,
                                org.xml.sax.SAXException
        Description copied from interface: FastInfosetReader
        Parse a fast infoset document from an InputStream.

        The application can use this method to instruct the Fast Infoset reader to begin parsing a fast infoset document from a byte stream.

        Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same FastInfosetReader object, possibly with a different byte stream.

        During the parse, the FastInfosetReader will provide information about the fast infoset document through the registered event handlers.

        This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

        Specified by:
        parse in interface FastInfosetReader
        Parameters:
        s - The byte stream to parse from.
        Throws:
        java.io.IOException
        FastInfosetException
        org.xml.sax.SAXException
      • setLexicalHandler

        public void setLexicalHandler​(org.xml.sax.ext.LexicalHandler handler)
        Description copied from interface: FastInfosetReader
        Allow an application to register a lexical handler.

        Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

        Specified by:
        setLexicalHandler in interface FastInfosetReader
        Parameters:
        handler - The lexical handler.
        See Also:
        FastInfosetReader.getLexicalHandler()
      • setDeclHandler

        public void setDeclHandler​(org.xml.sax.ext.DeclHandler handler)
        Description copied from interface: FastInfosetReader
        Allow an application to register a DTD declaration handler.

        Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

        Specified by:
        setDeclHandler in interface FastInfosetReader
        Parameters:
        handler - The DTD declaration handler.
        See Also:
        FastInfosetReader.getLexicalHandler()
      • processCIIEncodingAlgorithm

        protected final void processCIIEncodingAlgorithm​(boolean addToTable)
                                                  throws FastInfosetException,
                                                         java.io.IOException
        Throws:
        FastInfosetException
        java.io.IOException
      • processCIIBuiltInEncodingAlgorithmAsPrimitive

        protected final void processCIIBuiltInEncodingAlgorithmAsPrimitive()
                                                                    throws FastInfosetException,
                                                                           java.io.IOException
        Throws:
        FastInfosetException
        java.io.IOException
      • processBuiltInEncodingAlgorithmAsCharacters

        protected final void processBuiltInEncodingAlgorithmAsCharacters​(java.lang.StringBuffer buffer)
                                                                  throws FastInfosetException,
                                                                         java.io.IOException
        Throws:
        FastInfosetException
        java.io.IOException
      • processBuiltInEncodingAlgorithmAsObject

        protected final java.lang.Object processBuiltInEncodingAlgorithmAsObject()
                                                                          throws FastInfosetException,
                                                                                 java.io.IOException
        Throws:
        FastInfosetException
        java.io.IOException