javax.xml.parsers

Class SAXParserFactory

public abstract class SAXParserFactory extends Object

SAXParserFactory is used to bootstrap JAXP wrappers for SAX parsers. Note that the JAXP 1.1 spec does not specify how the isValidating() or isNamespaceAware() flags relate to the SAX2 feature flags controlling those same features.

Version: 1.0

Author: Andrew Selkirk, David Brownell

Constructor Summary
protected SAXParserFactory()
Method Summary
abstract booleangetFeature(String name)
Retrieves a current factory feature flag setting.
booleanisNamespaceAware()
booleanisValidating()
static SAXParserFactorynewInstance()
abstract SAXParsernewSAXParser()
Returns a new instance of a SAXParser using the platform default implementation and the currently specified factory feature flag settings.
abstract voidsetFeature(String name, boolean value)
Establishes a factory parameter corresponding to the specified feature flag.
voidsetNamespaceAware(boolean value)
voidsetValidating(boolean value)

Constructor Detail

SAXParserFactory

protected SAXParserFactory()

Method Detail

getFeature

public abstract boolean getFeature(String name)
Retrieves a current factory feature flag setting.

Parameters: name identifies the feature flag

Throws: SAXNotRecognizedException if the specified SAX2 feature flag is not recognized SAXNotSupportedException if the specified SAX2 feature flag values can not be accessed before parsing begins.

isNamespaceAware

public boolean isNamespaceAware()

isValidating

public boolean isValidating()

newInstance

public static SAXParserFactory newInstance()

newSAXParser

public abstract SAXParser newSAXParser()
Returns a new instance of a SAXParser using the platform default implementation and the currently specified factory feature flag settings.

Throws: ParserConfigurationException when the parameter combination is not supported SAXNotRecognizedException if one of the specified SAX2 feature flags is not recognized SAXNotSupportedException if one of the specified SAX2 feature flags values can not be set, perhaps because of sequencing requirements (which could be met by using SAX2 directly)

setFeature

public abstract void setFeature(String name, boolean value)
Establishes a factory parameter corresponding to the specified feature flag.

Parameters: name identifies the feature flag value specifies the desired flag value

Throws: SAXNotRecognizedException if the specified SAX2 feature flag is not recognized SAXNotSupportedException if the specified SAX2 feature flag values can not be set, perhaps because of sequencing requirements (which could be met by using SAX2 directly)

setNamespaceAware

public void setNamespaceAware(boolean value)

setValidating

public void setValidating(boolean value)

Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2011-08-26.