gnu.xml.aelfred2

Class JAXPFactory


public final class JAXPFactory
extends SAXParserFactory

Configurable factory to create an Ælfred2 JAXP parser; required to bootstrap using JAXP. You should use SAX2 directly where possible, rather than through JAXP, since that gives you better control. This class would normally be configured as a platform default factory.

Constructor Summary

JAXPFactory()
Constructs a factory which normally returns a non-validating parser.

Method Summary

boolean
getFeature(String name)
Returns the specified feature for SAX2 parsers obtained from this factory.
SAXParser
newSAXParser()
Creates a new parser instance using the currently specified factory configuration.
void
setFeature(String name, boolean value)
Sets the specified feature for SAX2 parsers obtained from this factory.

Methods inherited from class javax.xml.parsers.SAXParserFactory

getFeature, getSchema, isNamespaceAware, isValidating, isXIncludeAware, newInstance, newSAXParser, setFeature, setNamespaceAware, setSchema, setValidating, setXIncludeAware

Constructor Details

JAXPFactory

public JAXPFactory()
Constructs a factory which normally returns a non-validating parser.

Method Details

getFeature

public boolean getFeature(String name)
            throws ParserConfigurationException,
                   SAXNotRecognizedException,
                   SAXNotSupportedException
Returns the specified feature for SAX2 parsers obtained from this factory.
Overrides:
getFeature in interface SAXParserFactory

Parameters:
name - the feature name


newSAXParser

public SAXParser newSAXParser()
            throws ParserConfigurationException,
                   SAXException
Creates a new parser instance using the currently specified factory configuration.
Overrides:
newSAXParser in interface SAXParserFactory

Throws:
ParserConfigurationException - if the specified configuration is not supported


setFeature

public void setFeature(String name,
                       boolean value)
            throws ParserConfigurationException,
                   SAXNotRecognizedException,
                   SAXNotSupportedException
Sets the specified feature for SAX2 parsers obtained from this factory.
Overrides:
setFeature in interface SAXParserFactory

Parameters:
name - the feature name
value - the featurevalue