java.lang.Object | |
↳ | org.xml.sax.helpers.XMLReaderAdapter |
Adapt a SAX2 XMLReader as a SAX1 Parser.
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class wraps a SAX2 XMLReader
and makes it act as a SAX1 Parser
. The XMLReader
must support a true value for the
http://xml.org/sax/features/namespace-prefixes property or parsing will fail
with a SAXException
; if the XMLReader
supports a false value for the http://xml.org/sax/features/namespaces
property, that will also be used to improve efficiency.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new adapter.
| |||||||||||
Create a new adapter.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adapt a SAX2 characters event.
| |||||||||||
End document event.
| |||||||||||
Adapt a SAX2 end element event.
| |||||||||||
Adapt a SAX2 end prefix mapping event.
| |||||||||||
Adapt a SAX2 ignorable whitespace event.
| |||||||||||
Parse the document.
| |||||||||||
Parse the document.
| |||||||||||
Adapt a SAX2 processing instruction event.
| |||||||||||
Register the DTD event handler.
| |||||||||||
Register the SAX1 document event handler.
| |||||||||||
Set a document locator.
| |||||||||||
Register the entity resolver.
| |||||||||||
Register the error event handler.
| |||||||||||
Set the locale for error reporting.
| |||||||||||
Adapt a SAX2 skipped entity event.
| |||||||||||
Start document event.
| |||||||||||
Adapt a SAX2 start element event.
| |||||||||||
Adapt a SAX2 start prefix mapping event.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface org.xml.sax.ContentHandler
| |||||||||||
From interface org.xml.sax.Parser
|
Create a new adapter.
Use the "org.xml.sax.driver" property to locate the SAX2 driver to embed.
SAXException | If the embedded driver cannot be instantiated or if the org.xml.sax.driver property is not specified. |
---|
Create a new adapter.
Create a new adapter, wrapped around a SAX2 XMLReader. The adapter will make the XMLReader act like a SAX1 Parser.
xmlReader | The SAX2 XMLReader to wrap. |
---|
NullPointerException | If the argument is null. |
---|
Adapt a SAX2 characters event.
ch | An array of characters. |
---|---|
start | The starting position in the array. |
length | The number of characters to use. |
SAXException | The client may raise a processing exception. |
---|
Adapt a SAX2 end element event.
uri | The Namespace URI. |
---|---|
localName | The Namespace local name. |
qName | The qualified (prefixed) name. |
SAXException | The client may raise a processing exception. |
---|
Adapt a SAX2 end prefix mapping event.
prefix | The prefix being mapped. |
---|
Adapt a SAX2 ignorable whitespace event.
ch | An array of characters. |
---|---|
start | The starting position in the array. |
length | The number of characters to use. |
SAXException | The client may raise a processing exception. |
---|
Parse the document.
This method will throw an exception if the embedded XMLReader does not support the http://xml.org/sax/features/namespace-prefixes property.
systemId | The absolute URL of the document. |
---|
IOException | If there is a problem reading the raw content of the document. |
---|---|
SAXException | If there is a problem processing the document. |
Parse the document.
This method will throw an exception if the embedded XMLReader does not support the http://xml.org/sax/features/namespace-prefixes property.
input | An input source for the document. |
---|
IOException | If there is a problem reading the raw content of the document. |
---|---|
SAXException | If there is a problem processing the document. |
Adapt a SAX2 processing instruction event.
target | The processing instruction target. |
---|---|
data | The remainder of the processing instruction |
SAXException | The client may raise a processing exception. |
---|
Register the DTD event handler.
handler | The new DTD event handler. |
---|
Register the SAX1 document event handler.
Note that the SAX1 document handler has no Namespace support.
handler | The new SAX1 document event handler. |
---|
Set a document locator.
locator | The document locator. |
---|
Register the entity resolver.
resolver | The new resolver. |
---|
Register the error event handler.
handler | The new error event handler. |
---|
Set the locale for error reporting.
This is not supported in SAX2, and will always throw an exception.
locale | the locale for error reporting. |
---|
SAXException | Thrown unless overridden. |
---|
Adapt a SAX2 skipped entity event.
name | The name of the skipped entity. |
---|
SAXException | Throwable by subclasses. |
---|
Adapt a SAX2 start element event.
uri | The Namespace URI. |
---|---|
localName | The Namespace local name. |
qName | The qualified (prefixed) name. |
atts | The SAX2 attributes. |
SAXException | The client may raise a processing exception. |
---|
Adapt a SAX2 start prefix mapping event.
prefix | The prefix being mapped. |
---|---|
uri | The Namespace URI being mapped to. |