org.apache.xerces.jaxp

Class SAXParserImpl.JAXPSAXParser

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

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.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.xerces.parsers.AbstractSAXParser

AbstractSAXParser.AttributesProxy, AbstractSAXParser.LocatorProxy

Field Summary

Fields inherited from class org.apache.xerces.parsers.SAXParser

NOTIFY_BUILTIN_REFS, SYMBOL_TABLE, XMLGRAMMAR_POOL

Fields inherited from class org.apache.xerces.parsers.AbstractSAXParser

ALLOW_UE_AND_NOTATION_EVENTS, DECLARATION_HANDLER, DOM_NODE, LEXICAL_HANDLER, NAMESPACES, STRING_INTERNING, fContentHandler, fDTDHandler, fDeclHandler, fDeclaredAttrs, fDocumentHandler, fLexicalHandler, fLexicalHandlerParameterEntities, fNamespaceContext, fNamespacePrefixes, fNamespaces, fParseInProgress, fQName, fResolveDTDURIs, fStandalone, fUseEntityResolver2, fVersion, fXMLNSURIs

Fields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser

fDTDContentModelSource, fDTDSource, fDocumentSource, fInDTD

Fields inherited from class org.apache.xerces.parsers.XMLParser

ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration

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

Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler

CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE

Constructor Summary

JAXPSAXParser()
Constructs a SAX parser using the dtd/xml schema parser configuration.

Method Summary

boolean
getFeature(String name)
Query the state of a feature.
Object
getProperty(String name)
Query the value of a property.
void
parse(String systemId)
Parses the input source specified by the given system identifier.
void
parse(org.xml.sax.InputSource inputSource)
parse
void
setFeature(String name, boolean value)
Override SAXParser's setFeature method to track the initial state of features.
void
setProperty(String name, 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, endDTD, endDocument, endElement, endExternalSubset, endGeneralEntity, endNamespaceMapping, endParameterEntity, externalEntityDecl, getAttributePSVI, getAttributePSVIByName, getContentHandler, getDTDHandler, getDeclHandler, getElementPSVI, getEntityResolver, getErrorHandler, getFeature, getLexicalHandler, getProperty, ignorableWhitespace, internalEntityDecl, notationDecl, parse, parse, processingInstruction, reset, setContentHandler, setDTDHandler, setDeclHandler, setDocumentHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setLocale, setProperty, startCDATA, startDocument, startElement, startExternalSubset, startGeneralEntity, startNamespaceMapping, startParameterEntity, unparsedEntityDecl, xmlDecl

Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser

any, attributeDecl, characters, comment, doctypeDecl, element, elementDecl, empty, emptyElement, endAttlist, endCDATA, endConditional, endContentModel, endDTD, endDocument, endElement, endExternalSubset, endGeneralEntity, endGroup, endParameterEntity, externalEntityDecl, getDTDContentModelSource, getDTDSource, getDocumentSource, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, occurrence, pcdata, processingInstruction, reset, separator, setDTDContentModelSource, setDTDSource, setDocumentSource, startAttlist, startCDATA, startConditional, startContentModel, startDTD, startDocument, startElement, startExternalSubset, startGeneralEntity, startGroup, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl

Methods inherited from class org.apache.xerces.parsers.XMLParser

parse, reset

Constructor Details

JAXPSAXParser

public JAXPSAXParser()
Constructs a SAX parser using the dtd/xml schema parser configuration.

Method Details

getFeature

public boolean getFeature(String name)
            throws org.xml.sax.SAXNotRecognizedException,
                   org.xml.sax.SAXNotSupportedException
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 interface AbstractSAXParser
Parameters:
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.

getProperty

public Object getProperty(String name)
            throws org.xml.sax.SAXNotRecognizedException,
                   org.xml.sax.SAXNotSupportedException
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 interface AbstractSAXParser
Parameters:
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(String systemId)
            throws org.xml.sax.SAXException,
                   IOException
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
parse in interface org.xml.sax.XMLReader
Overrides:
parse in interface AbstractSAXParser
Parameters:
systemId - The system identifier (URI).
Throws:
org.xml.sax.SAXException - Throws exception on SAX error.

parse

public void parse(org.xml.sax.InputSource inputSource)
            throws org.xml.sax.SAXException,
                   IOException
parse
Specified by:
parse in interface org.xml.sax.Parser
parse in interface org.xml.sax.XMLReader
Overrides:
parse in interface AbstractSAXParser
Parameters:
inputSource -
Throws:
org.xml.sax.SAXException -

setFeature

public void setFeature(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 interface AbstractSAXParser

setProperty

public void setProperty(String name,
                        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 interface AbstractSAXParser

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.