|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--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.
XMLFilter
,
XMLReader
,
EntityResolver
,
DTDHandler
,
ContentHandler
,
ErrorHandler
Constructor Summary | |
XMLFilterImpl()
Construct an empty XML filter, with no parent. |
|
XMLFilterImpl(XMLReader parent)
Construct an XML filter with the specified parent. |
Method Summary | |
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(SAXParseException e)
Filter an error event. |
void |
fatalError(SAXParseException e)
Filter a fatal error event. |
ContentHandler |
getContentHandler()
Get the content event handler. |
DTDHandler |
getDTDHandler()
Get the current DTD event handler. |
EntityResolver |
getEntityResolver()
Get the current entity resolver. |
ErrorHandler |
getErrorHandler()
Get the current error event handler. |
boolean |
getFeature(java.lang.String name)
Look up the value of a feature. |
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(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. |
InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Filter an external entity resolution. |
void |
setContentHandler(ContentHandler handler)
Set the content event handler. |
void |
setDocumentLocator(Locator locator)
Filter a new document locator event. |
void |
setDTDHandler(DTDHandler handler)
Set the DTD event handler. |
void |
setEntityResolver(EntityResolver resolver)
Set the entity resolver. |
void |
setErrorHandler(ErrorHandler handler)
Set the error event handler. |
void |
setFeature(java.lang.String name,
boolean value)
Set the value of a feature. |
void |
setParent(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,
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(SAXParseException e)
Filter a warning event. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
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
.
XMLReader.setFeature(java.lang.String, boolean)
,
XMLReader.setProperty(java.lang.String, java.lang.Object)
,
setParent(org.xml.sax.XMLReader)
public XMLFilterImpl(XMLReader parent)
setParent(org.xml.sax.XMLReader)
,
getParent()
Method Detail |
public void setParent(XMLReader parent)
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.
parent
- The parent XML reader.getParent()
public XMLReader getParent()
setParent(org.xml.sax.XMLReader)
public void setFeature(java.lang.String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
This will always fail if the parent is null.
name
- The feature name.value
- The requested feature value.public boolean getFeature(java.lang.String name) throws SAXNotRecognizedException, SAXNotSupportedException
This will always fail if the parent is null.
name
- The feature name.public void setProperty(java.lang.String name, java.lang.Object value) throws SAXNotRecognizedException, SAXNotSupportedException
This will always fail if the parent is null.
name
- The property name.value
- The requested property value.public java.lang.Object getProperty(java.lang.String name) throws SAXNotRecognizedException, SAXNotSupportedException
name
- The property name.public void setEntityResolver(EntityResolver resolver)
resolver
- The new entity resolver.public EntityResolver getEntityResolver()
public void setDTDHandler(DTDHandler handler)
handler
- the new DTD handlerpublic DTDHandler getDTDHandler()
public void setContentHandler(ContentHandler handler)
handler
- the new content handlerpublic ContentHandler getContentHandler()
public void setErrorHandler(ErrorHandler handler)
handler
- the new error handlerpublic ErrorHandler getErrorHandler()
public void parse(InputSource input) throws SAXException, java.io.IOException
input
- The input source for the document entity.public void parse(java.lang.String systemId) throws SAXException, java.io.IOException
systemId
- The system identifier as a fully-qualified URI.public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException, java.io.IOException
publicId
- The entity's public identifier, or null.systemId
- The entity's system identifier.public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
name
- The notation name.publicId
- The notation's public identifier, or null.systemId
- The notation's system identifier, or null.public void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName) throws SAXException
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.public void setDocumentLocator(Locator locator)
locator
- The document locator.public void startDocument() throws SAXException
public void endDocument() throws SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws SAXException
prefix
- The Namespace prefix.uri
- The Namespace URI.public void endPrefixMapping(java.lang.String prefix) throws SAXException
prefix
- The Namespace prefix.public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, Attributes atts) throws SAXException
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.public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws SAXException
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.public void characters(char[] ch, int start, int length) throws SAXException
ch
- An array of characters.start
- The starting position in the array.length
- The number of characters to use from the array.public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ch
- An array of characters.start
- The starting position in the array.length
- The number of characters to use from the array.public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
target
- The processing instruction target.data
- The text following the target.public void skippedEntity(java.lang.String name) throws SAXException
name
- The name of the skipped entity.public void warning(SAXParseException e) throws SAXException
e
- The warning as an exception.public void error(SAXParseException e) throws SAXException
e
- The error as an exception.public void fatalError(SAXParseException e) throws SAXException
e
- The error as an exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |