Build 1.0_r1(from source)

javax.xml.parsers
Class SAXParserFactory

java.lang.Object
  extended by javax.xml.parsers.SAXParserFactory

public abstract class SAXParserFactory
extends Object

Provides a factory for SAXParser instances. The class first needs to be instantiated using the newInstance() method. The instance can be configured as desired. A call to newSAXParser() then provides a SAXParser instance matching this configuration.


Constructor Summary
protected SAXParserFactory()
          Do-nothing constructor.
 
Method Summary
abstract  boolean getFeature(String name)
          Queries a feature from the underlying implementation.
 boolean isNamespaceAware()
          Queries whether the factory is configured to deliver parsers that are namespace-aware.
 boolean isValidating()
          Queries whether the factory is configured to deliver parsers that are validating.
 boolean isXIncludeAware()
          Queries whether the factory is configured to deliver parsers that are XInclude-aware.
static SAXParserFactory newInstance()
          Creates a new SAXParserFactory that can be configured and then be used for creating SAXPArser objects.
abstract  SAXParser newSAXParser()
          Creates a new SAXParser that matches the current configuration.
abstract  void setFeature(String name, boolean value)
          Sets a feature in the underlying implementation.
 void setNamespaceAware(boolean value)
          Determines whether the factory is configured to deliver parsers that are namespace-aware.
 void setValidating(boolean value)
          Determines whether the factory is configured to deliver parsers that are validating.
 void setXIncludeAware(boolean value)
          Determines whether the factory is configured to deliver parsers that are XInclude-aware.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXParserFactory

protected SAXParserFactory()
Do-nothing constructor. Prevents instantiation. To be overridden by concrete subclasses.

Method Detail

getFeature

public abstract boolean getFeature(String name)
                            throws ParserConfigurationException,
                                   SAXNotRecognizedException,
                                   SAXNotSupportedException
Queries a feature from the underlying implementation.

Parameters:
name - The name of the feature. The default Android implementation of SAXParser supports only the following three features:
http://xml.org/sax/features/namespaces
Queries the state of namespace-awareness.
http://xml.org/sax/features/namespace-prefixes
Queries the state of namespace prefix processing
http://xml.org/sax/features/validation
Queries the state of validation.
Note that despite the ability to query the validation feature, there is currently no validating parser available. Also note that currently either namespaces or namespace prefixes can be enabled, but not both at the same time.
Returns:
The status of the feature.
Throws:
ParserConfigurationException - if no SAXParser matching the given criteria is available.
SAXNotRecognizedException - If the given feature is not known to the underlying implementation.
SAXNotSupportedException - If the given features is known, but not supported by the underlying implementation.

isNamespaceAware

public boolean isNamespaceAware()
Queries whether the factory is configured to deliver parsers that are namespace-aware.

Returns:
true if namespace-awareness is desired, false otherwise.

isValidating

public boolean isValidating()
Queries whether the factory is configured to deliver parsers that are validating.

Returns:
true if validating is desired, false otherwise.

isXIncludeAware

public boolean isXIncludeAware()
Queries whether the factory is configured to deliver parsers that are XInclude-aware.

Returns:
true if XInclude-awareness is desired, false otherwise.

newInstance

public static SAXParserFactory newInstance()
                                    throws FactoryConfigurationError
Creates a new SAXParserFactory that can be configured and then be used for creating SAXPArser objects.

Returns:
The SAXParserFactory.
Throws:
FactoryConfigurationError - If no SAXParserFactory can be created.

newSAXParser

public abstract SAXParser newSAXParser()
                                throws ParserConfigurationException,
                                       SAXException
Creates a new SAXParser that matches the current configuration.

Returns:
The SAXParser.
Throws:
ParserConfigurationException - if no matching SAXParser could be found.
SAXException - If a problem occurs during SAX parsing.

setFeature

public abstract void setFeature(String name,
                                boolean value)
                         throws ParserConfigurationException,
                                SAXNotRecognizedException,
                                SAXNotSupportedException
Sets a feature in the underlying implementation.

Parameters:
name - The name of the feature. The default Android implementation of SAXParser supports only the following three features:
http://xml.org/sax/features/namespaces
Queries the state of namespace-awareness.
http://xml.org/sax/features/namespace-prefixes
Queries the state of namespace prefix processing
http://xml.org/sax/features/validation
Queries the state of validation.
Note that despite the ability to query the validation feature, there is currently no validating parser available. Also note that currently either namespaces or namespace prefixes can be enabled, but not both at the same time.
value - The status of the feature.
Throws:
ParserConfigurationException - if no SAXParser matching the given criteria is available.
SAXNotRecognizedException - If the given feature is not known to the underlying implementation.
SAXNotSupportedException - If the given features is known, but not supported by the underlying implementation.

setNamespaceAware

public void setNamespaceAware(boolean value)
Determines whether the factory is configured to deliver parsers that are namespace-aware.

Parameters:
value - Turns namespace-awareness on or off.

setValidating

public void setValidating(boolean value)
Determines whether the factory is configured to deliver parsers that are validating.

Parameters:
value - Turns validation on or off.

setXIncludeAware

public void setXIncludeAware(boolean value)
Determines whether the factory is configured to deliver parsers that are XInclude-aware.

Parameters:
value - Turns XInclude-awareness on or off.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature