java.lang.Object | +--org.xml.sax.helpers.XMLFilterImplAll Implemented Interfaces:
org.xml.sax.XMLFilter
org.xml.sax.XMLReader
org.xml.sax.EntityResolver
org.xml.sax.DTDHandler
org.xml.sax.ContentHandler
org.xml.sax.ErrorHandler
XMLFilterImpl() Construct an empty XML filter, with no parent. |
XMLFilterImpl(org.xml.sax.XMLReader parent) Construct an XML filter with the specified parent. |
void | characters(char[] ch, int start, int length) Filter a character data event. |
void | endDocument() Filter an end document event. |
void | endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) Filter an end element event. |
void | endPrefixMapping(java.lang.String prefix) Filter an end Namespace prefix mapping event. |
void | error(org.xml.sax.SAXParseException e) Filter an error event. |
void | fatalError(org.xml.sax.SAXParseException e) Filter a fatal error event. |
org.xml.sax.ContentHandler | getContentHandler() Get the content event handler. |
org.xml.sax.DTDHandler | getDTDHandler() Get the current DTD event handler. |
org.xml.sax.EntityResolver | getEntityResolver() Get the current entity resolver. |
org.xml.sax.ErrorHandler | getErrorHandler() Get the current error event handler. |
boolean | getFeature(java.lang.String name) Look up the value of a feature. |
org.xml.sax.XMLReader | getParent() Get the parent reader. |
java.lang.Object | getProperty(java.lang.String name) Look up the value of a property. |
void | ignorableWhitespace(char[] ch, int start, int length) Filter an ignorable whitespace event. |
void | notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) Filter a notation declaration event. |
void | parse(org.xml.sax.InputSource input) Parse a document. |
void | parse(java.lang.String systemId) Parse a document. |
void | processingInstruction(java.lang.String target, java.lang.String data) Filter a processing instruction event. |
org.xml.sax.InputSource | resolveEntity(java.lang.String publicId, java.lang.String systemId) Filter an external entity resolution. |
void | setContentHandler(org.xml.sax.ContentHandler handler) Set the content event handler. |
void | setDTDHandler(org.xml.sax.DTDHandler handler) Set the DTD event handler. |
void | setDocumentLocator(org.xml.sax.Locator locator) Filter a new document locator event. |
void | setEntityResolver(org.xml.sax.EntityResolver resolver) Set the entity resolver. |
void | setErrorHandler(org.xml.sax.ErrorHandler handler) Set the error event handler. |
void | setFeature(java.lang.String name, boolean value) Set the value of a feature. |
void | setParent(org.xml.sax.XMLReader parent) Set the parent reader. |
void | setProperty(java.lang.String name, java.lang.Object value) Set the value of a property. |
void | skippedEntity(java.lang.String name) Filter a skipped entity event. |
void | startDocument() Filter a start document event. |
void | startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) Filter a start element event. |
void | startPrefixMapping(java.lang.String prefix, java.lang.String uri) Filter a start Namespace prefix mapping event. |
void | unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName) Filter an unparsed entity declaration event. |
void | warning(org.xml.sax.SAXParseException e) Filter a warning event. |
public XMLFilterImpl()
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(org.xml.sax.XMLReader parent)
parent
- public void characters(char[] ch, int start, int length)
ch
- An array of characters.start
- The starting position in the array.length
- The number of characters to use from the array.SAXException
- The client may throw
an exception during processing.public void endDocument()
SAXException
- The client may throw
an exception during processing.public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
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.SAXException
- The client may throw
an exception during processing.public void endPrefixMapping(java.lang.String prefix)
prefix
- The Namespace prefix.SAXException
- The client may throw
an exception during processing.public void error(org.xml.sax.SAXParseException e)
e
- The error as an exception.SAXException
- The client may throw
an exception during processing.public void fatalError(org.xml.sax.SAXParseException e)
e
- The error as an exception.SAXException
- The client may throw
an exception during processing.public ContentHandler getContentHandler()
public DTDHandler getDTDHandler()
public EntityResolver getEntityResolver()
public ErrorHandler getErrorHandler()
public boolean getFeature(java.lang.String name)
This will always fail if the parent is null.
name
- The feature name.SAXNotRecognizedException
- If the feature
value can't be assigned or retrieved from the parent.SAXNotSupportedException
- When the
parent recognizes the feature name but
cannot determine its value at this time.public XMLReader getParent()
public Object getProperty(java.lang.String name)
name
- The property name.SAXNotRecognizedException
- If the property
value can't be assigned or retrieved from the parent.SAXNotSupportedException
- When the
parent recognizes the property name but
cannot determine its value at this time.public void ignorableWhitespace(char[] ch, int start, int length)
ch
- An array of characters.start
- The starting position in the array.length
- The number of characters to use from the array.SAXException
- The client may throw
an exception during processing.public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
name
- The notation name.publicId
- The notation's public identifier, or null.systemId
- The notation's system identifier, or null.SAXException
- The client may throw
an exception during processing.public void parse(java.lang.String systemId)
systemId
- The system identifier as a fully-qualified URI.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(org.xml.sax.InputSource input)
input
- The input source for the document entity.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(java.lang.String target, java.lang.String data)
target
- The processing instruction target.data
- The text following the target.SAXException
- The client may throw
an exception during processing.public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
publicId
- The entity's public identifier, or null.systemId
- The entity's system identifier.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(org.xml.sax.ContentHandler handler)
handler
- The new content handler.public void setDTDHandler(org.xml.sax.DTDHandler handler)
handler
- The new DTD handler.public void setDocumentLocator(org.xml.sax.Locator locator)
locator
- The document locator.public void setEntityResolver(org.xml.sax.EntityResolver resolver)
resolver
- The new entity resolver.public void setErrorHandler(org.xml.sax.ErrorHandler handler)
handler
- The new error handler.public void setFeature(java.lang.String name, boolean value)
This will always fail if the parent is null.
name
- The feature name.value
- The requested feature value.SAXNotRecognizedException
- If the feature
value can't be assigned or retrieved from the parent.SAXNotSupportedException
- When the
parent recognizes the feature name but
cannot set the requested value.public void setParent(org.xml.sax.XMLReader parent)
This is the org.xml.sax.XMLReader 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.
parent
- The parent XML reader.public void setProperty(java.lang.String name, java.lang.Object value)
This will always fail if the parent is null.
name
- The property name.value
- The requested property value.SAXNotRecognizedException
- If the property
value can't be assigned or retrieved from the parent.SAXNotSupportedException
- When the
parent recognizes the property name but
cannot set the requested value.public void skippedEntity(java.lang.String name)
name
- The name of the skipped entity.SAXException
- The client may throw
an exception during processing.public void startDocument()
SAXException
- The client may throw
an exception during processing.public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
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.SAXException
- The client may throw
an exception during processing.public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
prefix
- The Namespace prefix.uri
- The Namespace URI.SAXException
- The client may throw
an exception during processing.public void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
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.SAXException
- The client may throw
an exception during processing.public void warning(org.xml.sax.SAXParseException e)
e
- The warning as an exception.SAXException
- The client may throw
an exception during processing.
This class is designed to sit between an org.xml.sax.XMLReader 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.