Class FastInfosetReaderSAXBufferCreator

  • All Implemented Interfaces:
    EncodingAlgorithmContentHandler, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler

    public final class FastInfosetReaderSAXBufferCreator
    extends com.sun.xml.stream.buffer.AbstractCreator
    implements org.xml.sax.EntityResolver, org.xml.sax.DTDHandler, org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, EncodingAlgorithmContentHandler
    A creator of a XMLStreamBuffer that that produces the XML infoset using a FastInfosetReader.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String[] _namespaceAttributes  
      (package private) int _namespaceAttributesPtr  
      • Fields inherited from class com.sun.xml.stream.buffer.AbstractCreator

        _buffer
      • Fields inherited from class com.sun.xml.stream.buffer.AbstractCreatorProcessor

        _contentCharactersBuffer, _contentCharactersBufferPtr, _contentObjects, _contentObjectsPtr, _currentContentCharactersBufferFragment, _currentContentObjectFragment, _currentStructureFragment, _currentStructureStringFragment, _structure, _structurePtr, _structureStrings, _structureStringsPtr, CHAR_ARRAY_LENGTH_MEDIUM, CHAR_ARRAY_LENGTH_MEDIUM_SIZE, CHAR_ARRAY_LENGTH_SMALL, CHAR_ARRAY_LENGTH_SMALL_SIZE, CONTENT_TYPE_CHAR_ARRAY, CONTENT_TYPE_CHAR_ARRAY_COPY, CONTENT_TYPE_OBJECT, CONTENT_TYPE_STRING, FLAG_DOCUMENT_FRAGMENT, FLAG_PREFIX, FLAG_QUALIFIED_NAME, FLAG_URI, T_ATTRIBUTE, T_ATTRIBUTE_LN, T_ATTRIBUTE_LN_OBJECT, T_ATTRIBUTE_P_U_LN, T_ATTRIBUTE_P_U_LN_OBJECT, T_ATTRIBUTE_U_LN, T_ATTRIBUTE_U_LN_OBJECT, T_ATTRIBUTE_U_LN_QN, T_ATTRIBUTE_U_LN_QN_OBJECT, T_COMMENT, T_COMMENT_AS_CHAR_ARRAY, T_COMMENT_AS_CHAR_ARRAY_COPY, T_COMMENT_AS_CHAR_ARRAY_MEDIUM, T_COMMENT_AS_CHAR_ARRAY_SMALL, T_COMMENT_AS_STRING, T_DOCUMENT, T_DOCUMENT_FRAGMENT, T_ELEMENT, T_ELEMENT_LN, T_ELEMENT_P_U_LN, T_ELEMENT_U_LN, T_ELEMENT_U_LN_QN, T_END, T_END_OF_BUFFER, T_NAMESPACE_ATTRIBUTE, T_NAMESPACE_ATTRIBUTE_P, T_NAMESPACE_ATTRIBUTE_P_U, T_NAMESPACE_ATTRIBUTE_U, T_PROCESSING_INSTRUCTION, T_TEXT, T_TEXT_AS_CHAR_ARRAY, T_TEXT_AS_CHAR_ARRAY_COPY, T_TEXT_AS_CHAR_ARRAY_MEDIUM, T_TEXT_AS_CHAR_ARRAY_SMALL, T_TEXT_AS_OBJECT, T_TEXT_AS_STRING, T_UNEXPANDED_ENTITY_REFERENCE, TYPE_MASK, VALUE_TYPE_OBJECT, VALUE_TYPE_STRING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void cacheNamespaceAttribute​(java.lang.String prefix, java.lang.String uri)  
      void characters​(char[] ch, int start, int length)  
      void comment​(char[] ch, int start, int length)  
      com.sun.xml.stream.buffer.MutableXMLStreamBuffer create​(FastInfosetReader reader, java.io.InputStream in)  
      void endCDATA()  
      void endDocument()  
      void endDTD()  
      void endElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName)  
      void endEntity​(java.lang.String name)  
      void endPrefixMapping​(java.lang.String prefix)  
      void error​(org.xml.sax.SAXParseException e)  
      void fatalError​(org.xml.sax.SAXParseException e)  
      void ignorableWhitespace​(char[] ch, int start, int length)  
      void notationDecl​(java.lang.String name, java.lang.String publicId, java.lang.String systemId)  
      void object​(java.lang.String URI, int algorithm, java.lang.Object o)
      Receive notification of encoding algorithm data as an object.
      void octets​(java.lang.String URI, int algorithm, byte[] b, int start, int length)
      Receive notification of encoding algorithm data as an array of byte.
      void processingInstruction​(java.lang.String target, java.lang.String data)  
      void reset()  
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)  
      void setDocumentLocator​(org.xml.sax.Locator locator)  
      void skippedEntity​(java.lang.String name)  
      void startCDATA()  
      void startDocument()  
      void startDTD​(java.lang.String name, java.lang.String publicId, java.lang.String systemId)  
      void startElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)  
      void startEntity​(java.lang.String name)  
      void startPrefixMapping​(java.lang.String prefix, java.lang.String uri)  
      private void storeAttributes​(EncodingAlgorithmAttributes attributes)  
      private void storeContentObject​(int algorithm, java.lang.Object o)  
      private void storeNamespaceAttributes()  
      private void storeQualifiedName​(int item, java.lang.String uri, java.lang.String localName, java.lang.String qName)  
      void unparsedEntityDecl​(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)  
      void warning​(org.xml.sax.SAXParseException e)  
      • Methods inherited from class com.sun.xml.stream.buffer.AbstractCreator

        createBuffer, getXMLStreamBuffer, increaseTreeCount, peekAtContentObject, resizeContentCharacters, resizeContentObjects, resizeStructure, resizeStructureStrings, setBuffer, setHasInternedStrings, setXMLStreamBuffer, storeContentCharacters, storeContentCharactersCopy, storeContentObject, storeContentString, storeStructure, storeStructureString
      • Methods inherited from class java.lang.Object

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

      • _namespaceAttributes

        java.lang.String[] _namespaceAttributes
      • _namespaceAttributesPtr

        int _namespaceAttributesPtr
    • Constructor Detail

      • FastInfosetReaderSAXBufferCreator

        public FastInfosetReaderSAXBufferCreator()
      • FastInfosetReaderSAXBufferCreator

        public FastInfosetReaderSAXBufferCreator​(com.sun.xml.stream.buffer.MutableXMLStreamBuffer buffer)
    • Method Detail

      • create

        public com.sun.xml.stream.buffer.MutableXMLStreamBuffer create​(FastInfosetReader reader,
                                                                       java.io.InputStream in)
                                                                throws java.io.IOException,
                                                                       org.xml.sax.SAXException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • reset

        public void reset()
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.SAXException
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes attributes)
                          throws org.xml.sax.SAXException
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] ch,
                                        int start,
                                        int length)
                                 throws org.xml.sax.SAXException
        Specified by:
        ignorableWhitespace in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.String data)
                                   throws org.xml.sax.SAXException
        Specified by:
        processingInstruction in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • comment

        public void comment​(char[] ch,
                            int start,
                            int length)
                     throws org.xml.sax.SAXException
        Specified by:
        comment in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • octets

        public void octets​(java.lang.String URI,
                           int algorithm,
                           byte[] b,
                           int start,
                           int length)
                    throws org.xml.sax.SAXException
        Description copied from interface: EncodingAlgorithmContentHandler
        Receive notification of encoding algorithm data as an array of byte.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing encoding algorithm data.

        The Parser will call the method of this interface to report each encoding algorithm data. Parsers MUST return all contiguous characters in a single chunk

        Parsers may return all contiguous bytes in a single chunk, or they may split it into several chunks providing that the length of each chunk is of the required length to successfully apply the encoding algorithm to the chunk.

        Specified by:
        octets in interface EncodingAlgorithmContentHandler
        Parameters:
        URI - the URI of the encoding algorithm
        algorithm - the encoding algorithm index
        b - the array of byte
        start - the start position in the array
        length - the number of byte to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
        See Also:
        EncodingAlgorithmIndexes
      • object

        public void object​(java.lang.String URI,
                           int algorithm,
                           java.lang.Object o)
                    throws org.xml.sax.SAXException
        Description copied from interface: EncodingAlgorithmContentHandler
        Receive notification of encoding algorithm data as an object.

        Such notifications will occur for a Fast Infoset SAX parser when processing encoding algorithm data that is converted from an array of byte to an object more suitable for processing.

        Specified by:
        object in interface EncodingAlgorithmContentHandler
        Parameters:
        URI - the URI of the encoding algorithm
        algorithm - the encoding algorithm index
        o - the encoding algorithm object
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
        See Also:
        EncodingAlgorithmIndexes
      • cacheNamespaceAttribute

        private void cacheNamespaceAttribute​(java.lang.String prefix,
                                             java.lang.String uri)
      • storeNamespaceAttributes

        private void storeNamespaceAttributes()
      • storeContentObject

        private void storeContentObject​(int algorithm,
                                        java.lang.Object o)
      • storeQualifiedName

        private void storeQualifiedName​(int item,
                                        java.lang.String uri,
                                        java.lang.String localName,
                                        java.lang.String qName)
      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.String systemId)
                                              throws java.io.IOException,
                                                     org.xml.sax.SAXException
        Specified by:
        resolveEntity in interface org.xml.sax.EntityResolver
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • notationDecl

        public void notationDecl​(java.lang.String name,
                                 java.lang.String publicId,
                                 java.lang.String systemId)
                          throws org.xml.sax.SAXException
        Specified by:
        notationDecl in interface org.xml.sax.DTDHandler
        Throws:
        org.xml.sax.SAXException
      • unparsedEntityDecl

        public void unparsedEntityDecl​(java.lang.String name,
                                       java.lang.String publicId,
                                       java.lang.String systemId,
                                       java.lang.String notationName)
                                throws org.xml.sax.SAXException
        Specified by:
        unparsedEntityDecl in interface org.xml.sax.DTDHandler
        Throws:
        org.xml.sax.SAXException
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
      • endPrefixMapping

        public void endPrefixMapping​(java.lang.String prefix)
                              throws org.xml.sax.SAXException
        Specified by:
        endPrefixMapping in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • skippedEntity

        public void skippedEntity​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Specified by:
        skippedEntity in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • startDTD

        public void startDTD​(java.lang.String name,
                             java.lang.String publicId,
                             java.lang.String systemId)
                      throws org.xml.sax.SAXException
        Specified by:
        startDTD in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endDTD

        public void endDTD()
                    throws org.xml.sax.SAXException
        Specified by:
        endDTD in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startEntity

        public void startEntity​(java.lang.String name)
                         throws org.xml.sax.SAXException
        Specified by:
        startEntity in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endEntity

        public void endEntity​(java.lang.String name)
                       throws org.xml.sax.SAXException
        Specified by:
        endEntity in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startCDATA

        public void startCDATA()
                        throws org.xml.sax.SAXException
        Specified by:
        startCDATA in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endCDATA

        public void endCDATA()
                      throws org.xml.sax.SAXException
        Specified by:
        endCDATA in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • warning

        public void warning​(org.xml.sax.SAXParseException e)
                     throws org.xml.sax.SAXException
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException
      • error

        public void error​(org.xml.sax.SAXParseException e)
                   throws org.xml.sax.SAXException
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException e)
                        throws org.xml.sax.SAXException
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException