This module, both source code and documentation, is in the
Public Domain, and comes with NO WARRANTY.
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.
Since:
SAX 2.0
Version:
2.0
Construct an empty XML filter, with no parent.
Construct an XML filter with the specified parent.
Constructor Summary
int start,
int length)
Filter a character data event.
Filter an end document event.
java.lang.String localName,
java.lang.String qName)
Filter an end element event.
Filter an end Namespace prefix mapping event.
Filter an error event.
Filter a fatal error event.
Look up the state of a feature.
Look up the value of a property.
int start,
int length)
Filter an ignorable whitespace event.
java.lang.String publicId,
java.lang.String systemId)
Filter a notation declaration event.
Parse a document.
Parse a document.
java.lang.String data)
Filter a processing instruction event.
Set the content event handler.
Filter a new document locator event.
Set the DTD event handler.
Set the entity resolver.
Set the error event handler.
boolean state)
Set the state of a feature.
Set the parent reader.
java.lang.Object value)
Set the value of a property.
Filter a skipped entity event.
Filter a start document event.
java.lang.String localName,
java.lang.String qName,
Filter a start element event.
java.lang.String uri)
Filter a start Namespace prefix mapping event.
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
Filter an unparsed entity declaration event.
Filter a warning event.
Method Summary
void
void
void
void
void
void
Get the content event handler.
Get the current DTD event handler.
Get the current entity resolver.
Get the current error event handler.
boolean
Get the parent reader.
java.lang.Object
void
void
void
void
void
java.lang.String systemId)
Filter an external entity resolution.
This filter will have no parent: you must assign a parent
before you start a parse or do any configuration with
setFeature or setProperty.
Construct an XML filter with the specified parent.
Method Detail
setParent
Set the parent reader.
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.
getParent
Get the parent reader.
setFeature
public void setFeature(java.lang.String name,
boolean state)
Set the state of a feature.
This will always fail if the parent is null.
XMLReader recognizes the feature name but
getFeature
public boolean getFeature(java.lang.String name)
Look up the state of a feature.
This will always fail if the parent is null.
XMLReader recognizes the feature name but
setProperty
public void setProperty(java.lang.String name,
java.lang.Object value)
Set the value of a property.
This will always fail if the parent is null.
XMLReader recognizes the property name but
getProperty
public java.lang.Object getProperty(java.lang.String name)
Look up the value of a property.
XMLReader recognizes the property name but
setEntityResolver
Set the entity resolver.
Parameters:
resolver - The new entity resolver.
Throws:
java.lang.NullPointerException - If the resolver
getEntityResolver
Get the current entity resolver.
setDTDHandler
Set the DTD event handler.
Parameters:
resolver - The new DTD handler.
Throws:
java.lang.NullPointerException - If the handler
getDTDHandler
Get the current DTD event handler.
setContentHandler
Set the content event handler.
Parameters:
resolver - The new content handler.
Throws:
java.lang.NullPointerException - If the handler
getContentHandler
Get the content event handler.
setErrorHandler
Set the error event handler.
Parameters:
handle - The new error handler.
Throws:
java.lang.NullPointerException - If the handler
getErrorHandler
Get the current error event handler.
parse
java.io.IOException
Parse a document.
wrapping another exception.
java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
parse
public void parse(java.lang.String systemId)
java.io.IOException
Parse a document.
wrapping another exception.
java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
resolveEntity
java.lang.String systemId)
java.io.IOException
Filter an external entity resolution.
an exception during processing.
java.io.IOException - The client may throw an
I/O-related exception while obtaining the
notationDecl
public void notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Filter a notation declaration event.
unparsedEntityDecl
public void unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
Filter an unparsed entity declaration event.
setDocumentLocator
Filter a new document locator event.
startDocument
public void startDocument()
Filter a start document event.
endDocument
public void endDocument()
Filter an end document event.
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Filter a start Namespace prefix mapping event.
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix)
Filter an end Namespace prefix mapping event.
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
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
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.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
characters
public void characters(char[] ch,
int start,
int length)
Filter a character data event.
ignorableWhitespace
public void ignorableWhitespace(char[] ch,
int start,
int length)
Filter an ignorable whitespace event.
processingInstruction
public void processingInstruction(java.lang.String target,
java.lang.String data)