| |
|
| java.lang.Object javax.xml.parsers.SAXParserFactory
All known Subclasses: com.sun.ukit.jaxp.ParserFactory,
SAXParserFactory | abstract public class SAXParserFactory (Code) | | Defines a factory API that enables applications to configure and
obtain a SAX based parser to parse XML documents.
An implementation of the SAXParserFactory class is
NOT guaranteed to be thread safe. It is up to the user application
to make sure about the use of the SAXParserFactory from
more than one thread. Alternatively the application can have one instance
of the SAXParserFactory per thread.
An application can use the same instance of the factory to obtain one or
more instances of the SAXParser provided the instance
of the factory isn't being used in more than one thread at a time.
The static newInstance method returns a new concrete
implementation of this class.
since: JAXP 1.0 version: 1.0 |
Method Summary | |
abstract public boolean | getFeature(String name) 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. | public boolean | isNamespaceAware() Indicates whether or not the factory is configured to produce
parsers which are namespace aware. | public boolean | isValidating() Indicates whether or not the factory is configured to produce
parsers which validate the XML content during parse. | public static SAXParserFactory | newInstance() Obtain a new instance of a SAXParserFactory . | abstract public SAXParser | newSAXParser() Creates a new instance of a SAXParser using the currently
configured factory parameters. | abstract public void | setFeature(String name, boolean value) Sets the particular feature in the underlying implementation of
org.xml.sax.XMLReader. | public void | setNamespaceAware(boolean awareness) Specifies that the parser produced by this code will
provide support for XML namespaces. | public void | setValidating(boolean validating) Specifies that the parser produced by this code will validate
documents as they are parsed. |
SAXParserFactory | protected SAXParserFactory()(Code) | | |
isNamespaceAware | public boolean isNamespaceAware()(Code) | | Indicates whether or not the factory is configured to produce
parsers which are namespace aware.
true if the factory is configured to produceparsers which are namespace aware; false otherwise. |
isValidating | public boolean isValidating()(Code) | | Indicates whether or not the factory is configured to produce
parsers which validate the XML content during parse.
true if the factory is configured to produce parserswhich validate the XML content during parse. |
newInstance | public static SAXParserFactory newInstance() throws FactoryConfigurationError(Code) | | Obtain a new instance of a SAXParserFactory . This
static method creates a new factory instance
This method uses the following ordered lookup procedure to determine
the SAXParserFactory implementation class to
load:
-
Use the
javax.xml.parsers.SAXParserFactory system
property.
-
Use the properties file "lib/jaxp.properties" in the JRE directory.
This configuration file is in standard
java.util.Properties
format and contains the fully qualified name of the
implementation class with the key being the system property defined
above.
-
Use the Services API (as detailed in the JAR specification), if
available, to determine the classname. The Services API will look
for a classname in the file
META-INF/services/javax.xml.parsers.SAXParserFactory
in jars available to the runtime.
-
Platform default
SAXParserFactory instance.
Once an application has obtained a reference to a
SAXParserFactory it can use the factory to
configure and obtain parser instances.
A new instance of a SAXParserFactory. exception: FactoryConfigurationError - if the implementation isnot available or cannot be instantiated. |
setNamespaceAware | public void setNamespaceAware(boolean awareness)(Code) | | Specifies that the parser produced by this code will
provide support for XML namespaces. By default the value of this is set
to false .
Parameters: awareness - true if the parser produced by this code willprovide support for XML namespaces; false otherwise. |
setValidating | public void setValidating(boolean validating)(Code) | | Specifies that the parser produced by this code will validate
documents as they are parsed. By default the value of this is
set to false.
Parameters: validating - true if the parser produced by this code willvalidate documents as they are parsed; falseotherwise. |
|
|
|