org.apache.xerces.jaxp
Class SAXParserImpl.JAXPSAXParser

java.lang.Object
  extended by org.apache.xerces.parsers.XMLParser
      extended by org.apache.xerces.parsers.AbstractXMLDocumentParser
          extended by org.apache.xerces.parsers.AbstractSAXParser
              extended by org.apache.xerces.parsers.SAXParser
                  extended by org.apache.xerces.jaxp.SAXParserImpl.JAXPSAXParser
All Implemented Interfaces:
XMLDocumentHandler, XMLDTDContentModelHandler, XMLDTDHandler, PSVIProvider, Parser, 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.


Field Summary
 
Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
 
Fields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
 
Constructor Summary
SAXParserImpl.JAXPSAXParser()
           
 
Method Summary
 boolean getFeature(java.lang.String name)
          Query the state of a feature.
 java.lang.Object getProperty(java.lang.String name)
          Query the value of a property.
 void parse(InputSource inputSource)
          parse
 void parse(java.lang.String systemId)
          Parses the input source specified by the given system identifier.
 void setFeature(java.lang.String name, boolean value)
          Override SAXParser's setFeature method to track the initial state of features.
 void setProperty(java.lang.String name, java.lang.Object value)
          Override SAXParser's setProperty method to track the initial state of properties.
 
Methods inherited from class org.apache.xerces.parsers.AbstractSAXParser
attributeDecl, characters, comment, doctypeDecl, elementDecl, endCDATA, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getAttributePSVI, getAttributePSVIByName, getContentHandler, getDTDHandler, getElementPSVI, getEntityResolver, getErrorHandler, ignorableWhitespace, internalEntityDecl, notationDecl, processingInstruction, reset, setContentHandler, setDocumentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setLocale, startCDATA, startDocument, startElement, startExternalSubset, startGeneralEntity, startParameterEntity, unparsedEntityDecl, xmlDecl
 
Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
any, element, empty, emptyElement, endAttlist, endConditional, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, ignoredCharacters, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startAttlist, startConditional, startContentModel, startDTD, startGroup, textDecl
 
Methods inherited from class org.apache.xerces.parsers.XMLParser
parse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXParserImpl.JAXPSAXParser

public SAXParserImpl.JAXPSAXParser()
Method Detail

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws SAXNotRecognizedException,
                       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 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:
SAXNotRecognizedException - If the requested feature is not known.
SAXNotSupportedException - If the requested feature is known, but the requested state is not supported.
See Also:
XMLReader.getFeature(java.lang.String)

getFeature

public boolean getFeature(java.lang.String name)
                   throws SAXNotRecognizedException,
                          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 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:
SAXNotRecognizedException - If the feature value can't be assigned or retrieved.
SAXNotSupportedException - If the requested feature is known but not supported.
See Also:
XMLReader.setFeature(java.lang.String, boolean)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws SAXNotRecognizedException,
                        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 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:
SAXNotRecognizedException - If the requested property is not known.
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 SAXNotRecognizedException,
                                    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 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:
SAXNotRecognizedException - If the property value can't be assigned or retrieved.
SAXNotSupportedException - If the requested property is known but not supported.
See Also:
XMLReader.setProperty(java.lang.String, java.lang.Object)

parse

public void parse(InputSource inputSource)
           throws SAXException,
                  java.io.IOException
Description copied from class: AbstractSAXParser
parse

Specified by:
parse in interface Parser
Specified by:
parse in interface XMLReader
Overrides:
parse in class AbstractSAXParser
Parameters:
inputSource - The input source for the top-level of the XML document.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
See Also:
InputSource, Parser.parse(java.lang.String), Parser.setEntityResolver(org.xml.sax.EntityResolver), Parser.setDTDHandler(org.xml.sax.DTDHandler), Parser.setDocumentHandler(org.xml.sax.DocumentHandler), Parser.setErrorHandler(org.xml.sax.ErrorHandler)

parse

public void parse(java.lang.String systemId)
           throws 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 Parser
Specified by:
parse in interface XMLReader
Overrides:
parse in class AbstractSAXParser
Parameters:
systemId - The system identifier (URI).
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
See Also:
Parser.parse(org.xml.sax.InputSource)