Xerces 1.3.1

javax.xml.parsers
Class SAXParserFactory

java.lang.Object
  |
  +--javax.xml.parsers.SAXParserFactory

public abstract class SAXParserFactory
extends java.lang.Object

The SAXParserFactory defines a factory API that enables applications to configure and obtain a SAX based parser to parse XML documents.

ATTENTION: THIS IMPLEMENTATION OF THE "JAVAX.XML.PARSER" CLASSES IS NOT THE OFFICIAL REFERENCE IMPLEMENTATION OF THE JAVA SPECIFICATION REQUEST 5 FOUND AT http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING" SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT http://java.sun.com/xml

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version:
1.0 CVS $Revision: 1.5 $ $Date: 2000/11/16 00:57:43 $

Constructor Summary
protected SAXParserFactory()
           
 
Method Summary
abstract  boolean getFeature(java.lang.String name)
          returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.
 boolean isNamespaceAware()
          Indicates whether or not the factory is configured to produce parsers which are namespace aware.
 boolean isValidating()
          Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.
static SAXParserFactory newInstance()
          Obtain a new instance of a SAXParserFactory.
abstract  SAXParser newSAXParser()
          Creates a new instance of a SAXParser using the currently configured factory parameters.
abstract  void setFeature(java.lang.String name, boolean value)
          Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.
 void setNamespaceAware(boolean awareness)
          Specifies that the parser produced by this code will provide support for XML namespaces.
 void setValidating(boolean validating)
          Specifies that the parser produced by this code will validate documents as they are parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXParserFactory

protected SAXParserFactory()
Method Detail

newInstance

public static SAXParserFactory newInstance()
Obtain a new instance of a SAXParserFactory. This static method creates a new factory instance based on a System property setting or uses the platform default if no property has been defined.

The system property that controls which Factory implementation to create is named "javax.xml.parsers.SAXParserFactory". This property names a class that is a concrete subclass of this abstract class. If no property is defined, a platform default will be used.

Once an application has obtained a reference to a SAXParserFactory it can use the factory to configure and obtain parser instances.

Throws:
FactoryConfigurationError - if the implementation is not available or cannot be instantiated.

newSAXParser

public abstract SAXParser newSAXParser()
                                throws ParserConfigurationException,
                                       SAXException
Creates a new instance of a SAXParser using the currently configured factory parameters.

Throws:
ParserConfigurationException - if a parser cannot be created which satisfies the requested configuration.
SAXException

setNamespaceAware

public void setNamespaceAware(boolean awareness)
Specifies that the parser produced by this code will provide support for XML namespaces.


setValidating

public void setValidating(boolean validating)
Specifies that the parser produced by this code will validate documents as they are parsed.


isNamespaceAware

public boolean isNamespaceAware()
Indicates whether or not the factory is configured to produce parsers which are namespace aware.


isValidating

public boolean isValidating()
Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.


setFeature

public abstract void setFeature(java.lang.String name,
                                boolean value)
                         throws ParserConfigurationException,
                                SAXNotRecognizedException,
                                SAXNotSupportedException
Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.

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 property name.
SAXNotSupportedException - When the underlying XMLReader recognizes the property name but doesn't support the property.
ParserConfigurationException
See Also:
XMLReader.setFeature(java.lang.String, boolean)

getFeature

public abstract boolean getFeature(java.lang.String name)
                            throws ParserConfigurationException,
                                   SAXNotRecognizedException,
                                   SAXNotSupportedException
returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.

Parameters:
name - The name of the property to be retrieved.
Returns:
Value of the requested property.
Throws:
SAXNotRecognizedException - When the underlying XMLReader does not recognize the property name.
SAXNotSupportedException - When the underlying XMLReader recognizes the property name but doesn't support the property.
ParserConfigurationException
See Also:
XMLReader.getProperty(java.lang.String)

Xerces 1.3.1