Class SAXParserImpl.JAXPSAXParser

  • All Implemented Interfaces:
    org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.XMLDTDContentModelHandler, org.apache.xerces.xni.XMLDTDHandler, org.apache.xerces.xs.PSVIProvider, org.xml.sax.Parser, org.xml.sax.XMLReader
    Enclosing class:
    SAXParserImpl

    public static class SAXParserImpl.JAXPSAXParser
    extends SAXParser
    Extension of SAXParser. This class tracks changes to features and properties to allow the parser to be reset to its initial state.
    • Constructor Detail

      • JAXPSAXParser

        public JAXPSAXParser()
    • Method Detail

      • setFeature

        public void setFeature​(java.lang.String name,
                               boolean value)
                        throws org.xml.sax.SAXNotRecognizedException,
                               org.xml.sax.SAXNotSupportedException
        Override SAXParser's setFeature method to track the initial state of features. This keeps us from affecting the performance of the SAXParser when it is created with XMLReaderFactory.
        Specified by:
        setFeature in interface org.xml.sax.XMLReader
        Overrides:
        setFeature in class AbstractSAXParser
        Parameters:
        name - The unique identifier (URI) of the feature.
        value - The requested state of the feature (true or false).
        Throws:
        org.xml.sax.SAXNotRecognizedException - If the requested feature is not known.
        org.xml.sax.SAXNotSupportedException - If the requested feature is known, but the requested state is not supported.
      • getFeature

        public boolean getFeature​(java.lang.String name)
                           throws org.xml.sax.SAXNotRecognizedException,
                                  org.xml.sax.SAXNotSupportedException
        Description copied from class: AbstractSAXParser
        Query the state of a feature. Query the current state of any feature in a SAX2 parser. The parser might not recognize the feature.
        Specified by:
        getFeature in interface org.xml.sax.XMLReader
        Overrides:
        getFeature in class AbstractSAXParser
        Parameters:
        name - The unique identifier (URI) of the feature being set.
        Returns:
        The current state of the feature.
        Throws:
        org.xml.sax.SAXNotRecognizedException - If the requested feature is not known.
        org.xml.sax.SAXNotSupportedException - If the requested feature is known but not supported.
      • setProperty

        public void setProperty​(java.lang.String name,
                                java.lang.Object value)
                         throws org.xml.sax.SAXNotRecognizedException,
                                org.xml.sax.SAXNotSupportedException
        Override SAXParser's setProperty method to track the initial state of properties. This keeps us from affecting the performance of the SAXParser when it is created with XMLReaderFactory.
        Specified by:
        setProperty in interface org.xml.sax.XMLReader
        Overrides:
        setProperty in class AbstractSAXParser
        Parameters:
        name - The unique identifier (URI) of the property being set.
        value - The value to which the property is being set.
        Throws:
        org.xml.sax.SAXNotRecognizedException - If the requested property is not known.
        org.xml.sax.SAXNotSupportedException - If the requested property is known, but the requested value is not supported.
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
                                     throws org.xml.sax.SAXNotRecognizedException,
                                            org.xml.sax.SAXNotSupportedException
        Description copied from class: AbstractSAXParser
        Query the value of a property. Return the current value of a property in a SAX2 parser. The parser might not recognize the property.
        Specified by:
        getProperty in interface org.xml.sax.XMLReader
        Overrides:
        getProperty in class AbstractSAXParser
        Parameters:
        name - The unique identifier (URI) of the property being set.
        Returns:
        The current value of the property.
        Throws:
        org.xml.sax.SAXNotRecognizedException - If the requested property is not known.
        org.xml.sax.SAXNotSupportedException - If the requested property is known but not supported.
      • parse

        public void parse​(org.xml.sax.InputSource inputSource)
                   throws org.xml.sax.SAXException,
                          java.io.IOException
        Description copied from class: AbstractSAXParser
        parse
        Specified by:
        parse in interface org.xml.sax.Parser
        Specified by:
        parse in interface org.xml.sax.XMLReader
        Overrides:
        parse in class AbstractSAXParser
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • parse

        public void parse​(java.lang.String systemId)
                   throws org.xml.sax.SAXException,
                          java.io.IOException
        Description copied from class: AbstractSAXParser
        Parses the input source specified by the given system identifier.

        This method is equivalent to the following:

             parse(new InputSource(systemId));
         
        Specified by:
        parse in interface org.xml.sax.Parser
        Specified by:
        parse in interface org.xml.sax.XMLReader
        Overrides:
        parse in class AbstractSAXParser
        Parameters:
        systemId - The system identifier (URI).
        Throws:
        org.xml.sax.SAXException - Throws exception on SAX error.
        java.io.IOException - Throws exception on i/o error.