org.xml.sax.XMLReader
implementation class. In JAXP 1.0, this class wrapped the
org.xml.sax.Parser interface, however this interface was
replaced by the org.xml.sax.XMLReader . For ease
of transition, this class continues to support the same name
and interface as well as supporting new methods.
An instance of this class can be obtained from the
javax.xml.parsers.SAXParserFactory#newSAXParser() method.
Once an instance of this class is obtained, XML can be parsed from
a variety of input sources. These input sources are InputStreams,
Files, URLs, and SAX InputSources.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.
org.xml.sax.helpers.DefaultHandler are called.
Implementors of this class which wrap an underlying implementation
can consider using the org.
class to initially adapt their SAX1 implementation to work under
this revised class.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract XMLReader | Returns: The XMLReader that is encapsulated by the implementation of this class.Returns the |
| public abstract boolean | Returns: true if this parser is configured to understand namespaces; false otherwise.Indicates whether or not this parser is configured to understand namespaces. |
| public abstract boolean | Returns: true if this parser is configured to validate XML documents; false otherwise.Indicates whether or not this parser is configured to validate XML documents. |
| public boolean | Returns: the return value of theSAXParserFactory#isXIncludeAware()
when this parser was created from factory.Get the XInclude processing mode for this parser. |
| public void | parse(InputStream
InputStream containing the content to be parsed. is, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content of the given |
| public void | parse(String
The location of the content to be parsed. uri, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
|
| public void | parse(File
The file containing the XML to parse f, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content of the file specified as XML using the
specified |
| public void | parse(InputSource
The InputSource containing the content to be parsed. is, DefaultHandler The SAX DefaultHandler to use. dh)Parse the content given |
| SAXParser | back to summary |
|---|---|
| protected SAXParser() Protected constructor to prevent instantiation. | |
| getXMLReader | back to summary |
|---|---|
| public abstract XMLReader getXMLReader() throws SAXException Returns the
| |
| isNamespaceAware | back to summary |
|---|---|
| public abstract boolean isNamespaceAware() Indicates whether or not this parser is configured to understand namespaces.
| |
| isValidating | back to summary |
|---|---|
| public abstract boolean isValidating() Indicates whether or not this parser is configured to validate XML documents.
| |
| isXIncludeAware | back to summary |
|---|---|
| public boolean isXIncludeAware() Get the XInclude processing mode for this parser.
| |
| parse | back to summary |
|---|---|
| public void parse(InputStream is, DefaultHandler dh) throws SAXException, IOException Parse the content of the given
| |
| parse | back to summary |
|---|---|
| public void parse(String uri, DefaultHandler dh) throws SAXException, IOException Parse the content described by the giving Uniform Resource
Identifier (URI) as XML using the specified
| |
| parse | back to summary |
|---|---|
| public void parse(File f, DefaultHandler dh) throws SAXException, IOException Parse the content of the file specified as XML using the
specified
| |
| parse | back to summary |
|---|---|
| public void parse(InputSource is, DefaultHandler dh) throws SAXException, IOException Parse the content given
| |