Movatterモバイル変換


[0]ホーム

URL:


         


Class SAXParserFactory

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

public abstract classSAXParserFactory
extends java.lang.Object

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

An implementation of theSAXParserFactory class isNOT guaranteed to be thread safe. It is up to the user application to make sure about the use of theSAXParserFactory from more than one thread. Alternatively the application can have one instance of theSAXParserFactory per thread. An application can use the same instance of the factory to obtain one or more instances of theSAXParser provided the instance of the factory isn't being used in more than one thread at a time.

The staticnewInstance method returns a new concrete implementation of this class.

Since:
JAXP 1.0

SAXParserFactory()
           
 
getFeature(java.lang.String name)
          Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.
isNamespaceAware()
          Indicates whether or not the factory is configured to produce parsers which are namespace aware.
isValidating()
          Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.
newInstance()
          Obtain a new instance of aSAXParserFactory.
newSAXParser()
          Creates a new instance of a SAXParser using the currently configured factory parameters.
setFeature(java.lang.String name, boolean value)
          Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.
setNamespaceAware(boolean awareness)
          Specifies that the parser produced by this code will provide support for XML namespaces.
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
 

SAXParserFactory

protectedSAXParserFactory()

newInstance

public staticSAXParserFactorynewInstance()                                    throwsFactoryConfigurationError
Obtain a new instance of aSAXParserFactory. This static method creates a new factory instance This method uses the following ordered lookup procedure to determine theSAXParserFactory implementation class to load: Once an application has obtained a reference to aSAXParserFactory it can use the factory to configure and obtain parser instances.
Returns:
A new instance of a SAXParserFactory.
Throws:
FactoryConfigurationError - if the implementation is not available or cannot be instantiated.

newSAXParser

public abstractSAXParsernewSAXParser()                                throwsParserConfigurationException,SAXException
Creates a new instance of a SAXParser using the currently configured factory parameters.
Returns:
A new instance of a SAXParser.
Throws:
ParserConfigurationException - if a parser cannot be created which satisfies the requested configuration.

setNamespaceAware

public voidsetNamespaceAware(boolean awareness)
Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set tofalse.
Parameters:
awareness - true if the parser produced by this code will provide support for XML namespaces; false otherwise.

setValidating

public voidsetValidating(boolean validating)
Specifies that the parser produced by this code will validate documents as they are parsed. By default the value of this is set tofalse.
Parameters:
validating - true if the parser produced by this code will validate documents as they are parsed; false otherwise.

isNamespaceAware

public booleanisNamespaceAware()
Indicates whether or not the factory is configured to produce parsers which are namespace aware.
Returns:
true if the factory is configured to produce parsers which are namespace aware; false otherwise.

isValidating

public booleanisValidating()
Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.
Returns:
true if the factory is configured to produce parsers which validate the XML content during parse; false otherwise.

setFeature

public abstract voidsetFeature(java.lang.String name,                                boolean value)                         throwsParserConfigurationException,SAXNotRecognizedException,SAXNotSupportedException
Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader. A list of the core features and properties can be found at http://www.megginson.com/SAX/Java/features.html
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.
See Also:
XMLReader.setFeature(java.lang.String, boolean)

getFeature

public abstract booleangetFeature(java.lang.String name)                            throwsParserConfigurationException,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.
See Also:
XMLReader.getProperty(java.lang.String)

         


[8]ページ先頭

©2009-2025 Movatter.jp