org.xml.sax.helpers.XMLFilterImpl
Base class for deriving an XML filter.
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 is designed to sit between an XMLReader and the client application's event handlers. By default, it
does nothing but pass requests up to the reader and events
on to the handlers unmodified, but subclasses can override
specific methods to modify the event stream or the configuration
requests as they pass through.
Summary
Public Constructors
Public Methods
|
|
|
|
|
void |
characters(char[] ch, int start, int length) |
|
|
|
|
|
void |
endDocument() |
|
|
|
|
|
void |
endElement(String uri, String localName, String qName) |
|
|
|
|
|
void |
endPrefixMapping(String prefix) |
|
|
|
|
|
void |
error(SAXParseException e) |
|
|
|
|
|
void |
fatalError(SAXParseException e) |
|
|
|
|
|
ContentHandler |
getContentHandler() |
|
|
|
|
|
DTDHandler |
getDTDHandler() |
|
|
|
|
|
EntityResolver |
getEntityResolver() |
|
|
|
|
|
ErrorHandler |
getErrorHandler() |
|
|
|
|
|
boolean |
getFeature(String name) |
|
|
|
|
|
XMLReader |
getParent() |
|
|
|
|
|
Object |
getProperty(String name) |
|
|
|
|
|
void |
ignorableWhitespace(char[] ch, int start, int length) |
|
|
|
|
|
void |
notationDecl(String name, String publicId, String systemId) |
|
|
|
|
|
void |
parse(String systemId) |
|
|
|
|
|
void |
parse(InputSource input) |
|
|
|
|
|
void |
processingInstruction(String target, String data) |
|
|
|
|
|
InputSource |
resolveEntity(String publicId, String systemId) |
|
|
|
|
|
void |
setContentHandler(ContentHandler handler) |
|
|
|
|
|
void |
setDTDHandler(DTDHandler handler) |
|
|
|
|
|
void |
setDocumentLocator(Locator locator) |
|
|
|
|
|
void |
setEntityResolver(EntityResolver resolver) |
|
|
|
|
|
void |
setErrorHandler(ErrorHandler handler) |
|
|
|
|
|
void |
setFeature(String name, boolean value) |
|
|
|
|
|
void |
setParent(XMLReader parent) |
|
|
|
|
|
void |
setProperty(String name, Object value) |
|
|
|
|
|
void |
skippedEntity(String name) |
|
|
|
|
|
void |
startDocument() |
|
|
|
|
|
void |
startElement(String uri, String localName, String qName, Attributes atts) |
|
|
|
|
|
void |
startPrefixMapping(String prefix, String uri) |
|
|
|
|
|
void |
unparsedEntityDecl(String name, String publicId, String systemId, String notationName) |
|
|
|
|
|
void |
warning(SAXParseException e) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
characters,
endDocument,
endElement,
endPrefixMapping,
ignorableWhitespace,
processingInstruction,
setDocumentLocator,
skippedEntity,
startDocument,
startElement,
startPrefixMapping
|
|
|
|
|
void |
characters(char[] ch, int start, int length) |
|
|
|
|
|
void |
endDocument() |
|
|
|
|
|
void |
endElement(String uri, String localName, String qName) |
|
|
|
|
|
void |
endPrefixMapping(String prefix) |
|
|
|
|
|
void |
ignorableWhitespace(char[] ch, int start, int length) |
|
|
|
|
|
void |
processingInstruction(String target, String data) |
|
|
|
|
|
void |
setDocumentLocator(Locator locator) |
|
|
|
|
|
void |
skippedEntity(String name) |
|
|
|
|
|
void |
startDocument() |
|
|
|
|
|
void |
startElement(String uri, String localName, String qName, Attributes atts) |
|
|
|
|
|
void |
startPrefixMapping(String prefix, String uri) |
getContentHandler,
getDTDHandler,
getEntityResolver,
getErrorHandler,
getFeature,
getProperty,
parse,
parse,
setContentHandler,
setDTDHandler,
setEntityResolver,
setErrorHandler,
setFeature,
setProperty
Details
Public Constructors
public
XMLFilterImpl()
Construct an empty XML filter, with no parent.
This filter will have no parent: you must assign a parent
before you start a parse or do any configuration with
setFeature or setProperty, unless you use this as a pure event
consumer rather than as an XMLReader.
public
XMLFilterImpl(XMLReader parent)
Construct an XML filter with the specified parent.
Parameters
parent
| the XML reader from which this filter receives its events. |
Public Methods
public
void
characters(char[] ch, int start, int length)
Filter a character data event.
Parameters
ch
| An array of characters. |
start
| The starting position in the array. |
length
| The number of characters to use from the array. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
endDocument()
Filter an end document event.
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
endElement(String uri, String localName, String qName)
Filter an end element event.
Parameters
uri
| The element's Namespace URI, or the empty string. |
localName
| The element's local name, or the empty string. |
qName
| The element's qualified (prefixed) name, or the empty
string. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
endPrefixMapping(String prefix)
Filter an end Namespace prefix mapping event.
Parameters
prefix
| The Namespace prefix. |
Throws
SAXException
| The client may throw
an exception during processing.
|
Filter an error event.
Parameters
e
| The error as an exception. |
Throws
SAXException
| The client may throw
an exception during processing.
|
Filter a fatal error event.
Parameters
e
| The error as an exception. |
Throws
SAXException
| The client may throw
an exception during processing.
|
Get the content event handler.
Returns
- The current content handler, or null if none was set.
public
DTDHandler
getDTDHandler()
Get the current DTD event handler.
Returns
- The current DTD handler, or null if none was set.
Get the current entity resolver.
Returns
- The current entity resolver, or null if none was set.
public
ErrorHandler
getErrorHandler()
Get the current error event handler.
Returns
- The current error handler, or null if none was set.
public
boolean
getFeature(String name)
Look up the value of a feature.
This will always fail if the parent is null.
Returns
- The current value of the feature.
public
XMLReader
getParent()
Get the parent reader.
Returns
- The parent XML reader, or null if none is set.
public
Object
getProperty(String name)
Look up the value of a property.
Returns
- The current value of the property.
public
void
ignorableWhitespace(char[] ch, int start, int length)
Filter an ignorable whitespace event.
Parameters
ch
| An array of characters. |
start
| The starting position in the array. |
length
| The number of characters to use from the array. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
notationDecl(String name, String publicId, String systemId)
Filter a notation declaration event.
Parameters
name
| The notation name. |
publicId
| The notation's public identifier, or null. |
systemId
| The notation's system identifier, or null. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
parse(String systemId)
Parse a document.
Parameters
systemId
| The system identifier as a fully-qualified URI. |
Throws
SAXException
| Any SAX exception, possibly
wrapping another exception. |
IOException
| An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
|
public
void
parse(InputSource input)
Parse a document.
Parameters
input
| The input source for the document entity. |
Throws
SAXException
| Any SAX exception, possibly
wrapping another exception. |
IOException
| An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
|
public
void
processingInstruction(String target, String data)
Filter a processing instruction event.
Parameters
target
| The processing instruction target. |
data
| The text following the target. |
Throws
SAXException
| The client may throw
an exception during processing.
|
Filter an external entity resolution.
Parameters
publicId
| The entity's public identifier, or null. |
systemId
| The entity's system identifier. |
Returns
- A new InputSource or null for the default.
Throws
SAXException
| The client may throw
an exception during processing. |
IOException
| The client may throw an
I/O-related exception while obtaining the
new InputSource.
|
public
void
setContentHandler(ContentHandler handler)
Set the content event handler.
Parameters
handler
| the new content handler
|
public
void
setDTDHandler(DTDHandler handler)
Set the DTD event handler.
Parameters
handler
| the new DTD handler
|
public
void
setDocumentLocator(Locator locator)
Filter a new document locator event.
Parameters
locator
| The document locator.
|
public
void
setEntityResolver(EntityResolver resolver)
Set the entity resolver.
Parameters
resolver
| The new entity resolver.
|
public
void
setErrorHandler(ErrorHandler handler)
Set the error event handler.
Parameters
handler
| the new error handler
|
public
void
setFeature(String name, boolean value)
Set the value of a feature.
This will always fail if the parent is null.
Parameters
name
| The feature name. |
value
| The requested feature value. |
public
void
setParent(XMLReader parent)
Set the parent reader.
This is the XMLReader from which
this filter will obtain its events and to which it will pass its
configuration requests. The parent may itself be another filter.
If there is no parent reader set, any attempt to parse
or to set or get a feature or property will fail.
Parameters
parent
| The parent XML reader. |
public
void
setProperty(String name, Object value)
Set the value of a property.
This will always fail if the parent is null.
Parameters
name
| The property name. |
value
| The requested property value. |
public
void
skippedEntity(String name)
Filter a skipped entity event.
Parameters
name
| The name of the skipped entity. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
startDocument()
Filter a start document event.
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
startElement(String uri, String localName, String qName, Attributes atts)
Filter a start element event.
Parameters
uri
| The element's Namespace URI, or the empty string. |
localName
| The element's local name, or the empty string. |
qName
| The element's qualified (prefixed) name, or the empty
string. |
atts
| The element's attributes. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
startPrefixMapping(String prefix, String uri)
Filter a start Namespace prefix mapping event.
Parameters
prefix
| The Namespace prefix. |
uri
| The Namespace URI. |
Throws
SAXException
| The client may throw
an exception during processing.
|
public
void
unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
Filter an unparsed entity declaration event.
Parameters
name
| The entity name. |
publicId
| The entity's public identifier, or null. |
systemId
| The entity's system identifier, or null. |
notationName
| The name of the associated notation. |
Throws
SAXException
| The client may throw
an exception during processing.
|
Filter a warning event.
Parameters
e
| The warning as an exception. |
Throws
SAXException
| The client may throw
an exception during processing.
|