javax.xml.parsers
Class SAXParserFactory

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

public abstract class SAXParserFactory
extends Object

A factory to configure and create SAXParser instances.

Note: This class is not thread-safe. Applications must serialize access to this class if two or more threads access the same instance.

Since:
BlackBerry API 4.3.0

Constructor Summary
protected SAXParserFactory()
           
 
Method Summary
abstract  boolean getFeature(String name)
          Gets the value of the particular feature in the underlying implementation of org.xml.sax.XMLReader.
 boolean isNamespaceAware()
          Determines whether this factory is configured to produce parsers that support namespaces.
 boolean isValidating()
          Determines whether this factory is configured to produce parsers that validate XML documents.
static SAXParserFactory newInstance()
          Creates a new SAXParserFactory object.
abstract  SAXParser newSAXParser()
          Creates a new SAXParser object using the currently configuration.
abstract  void setFeature(String name, boolean value)
          Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.
 void setNamespaceAware(boolean aware)
          Configures parsers produced by this factory to support namespaces.
 void setValidating(boolean validate)
          Configures parsers produced by this factory to validate XML documents.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

SAXParserFactory

protected SAXParserFactory()
Since:
BlackBerry API 4.3.0


Method Detail

newInstance

public static SAXParserFactory newInstance()
Creates a new SAXParserFactory object.

Returns:
A new SAXParserFactory object.
Since:
BlackBerry API 4.3.0

newSAXParser

public abstract SAXParser newSAXParser()
                                throws ParserConfigurationException,
                                       SAXException
Creates a new SAXParser object using the currently configuration.

Returns:
A new SAXParser object.
Throws:
ParserConfigurationException - Thrown when a parser cannot be created with the current parameters.
SAXException
Since:
BlackBerry API 4.3.0

setNamespaceAware

public void setNamespaceAware(boolean aware)
Configures parsers produced by this factory to support namespaces. By default, parsers produced by this factory do not support namespaces (false).

Parameters:
aware - True to configure parsers produced by this factory to support namespaces, false otherwise.
Since:
BlackBerry API 4.3.0

isNamespaceAware

public boolean isNamespaceAware()
Determines whether this factory is configured to produce parsers that support namespaces.

Returns:
True if this factory is configured to produce parsers that support namespaces, false otherwise.
Since:
BlackBerry API 4.3.0

setValidating

public void setValidating(boolean validate)
Configures parsers produced by this factory to validate XML documents. By default, parsers produced by this factory do not validate XML documents (false).

Parameters:
validate - True to configure parsers produced by this factory to validate XML documents, false otherwise.
Since:
BlackBerry API 4.3.0

isValidating

public boolean isValidating()
Determines whether this factory is configured to produce parsers that validate XML documents.

Returns:
True if this factory is configured to produce parsers that validate XML documents, false otherwise.
Since:
BlackBerry API 4.3.0

setFeature

public abstract void setFeature(String name,
                                boolean value)
                         throws ParserConfigurationException,
                                SAXNotRecognizedException,
                                SAXNotSupportedException
Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader. It currently recognizes the "http://xml.org/sax/features/namespaces" and the "http://xml.org/sax/features/namespace-prefixes" features.

Parameters:
name - The name of the feature to be set.
value - The value of the feature to be set.
Throws:
SAXNotRecognizedException - When the underlying XMLReader does not recognize the feature name.
SAXNotSupportedException - When the underlying XMLReader recognizes the feature name but does not support the feature.
ParserConfigurationException.
ParserConfigurationException
Since:
BlackBerry API 4.3.0

getFeature

public abstract boolean getFeature(String name)
                            throws ParserConfigurationException,
                                   SAXNotRecognizedException,
                                   SAXNotSupportedException
Gets the value of the particular feature in the underlying implementation of org.xml.sax.XMLReader. It currently recognizes the "http://xml.org/sax/features/namespaces" and the "http://xml.org/sax/features/namespace-prefixes" features.

Parameters:
name - The name of the feature whose value is to be retrieved.
Returns:
The value of the given feature name.
Throws:
SAXNotRecognizedException - When the underlying XMLReader does not recognize the feature name.
SAXNotSupportedException - When the underlying XMLReader recognizes the feature name but does not support the feature.
ParserConfigurationException.
ParserConfigurationException
Since:
BlackBerry API 4.3.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal