javax.xml.parsers
Class SAXParserFactory

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

public abstract class SAXParserFactory
extends java.lang.Object

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

Since:
JAXP 1.0

Constructor Summary
protected SAXParserFactory()
           
 
Method Summary
 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.
 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.

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.


Submit Feedback to xml-feedback@java.sun.com
Copyright © 1998-2000 Sun Microsystems, Inc. All Rights Reserved.

Sun Microsystems, Inc.
901 San Antonio Road
Palo Alto, California, 94303, U.S.A.