Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
org.xml.sax.helpers

Class XMLFilterImpl

java.lang.Object
|
+--org.xml.sax.helpers.XMLFilterImpl

All Implemented Interfaces:

XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler


public class XMLFilterImpl

extends Object

implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler

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 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.

Since:Author:See Also:

Constructor Summary

XMLFilterImpl()

Construct an empty XML filter, with no parent.
XMLFilterImpl(org.xml.sax.XMLReader parent)

Construct an XML filter with the specified parent.

Method Summary

voidcharacters(char[] ch, int start, int length)

Filter a character data event.
voidendDocument()

Filter an end document event.
voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)

Filter an end element event.
voidendPrefixMapping(java.lang.String prefix)

Filter an end Namespace prefix mapping event.
voiderror(org.xml.sax.SAXParseException e)

Filter an error event.
voidfatalError(org.xml.sax.SAXParseException e)

Filter a fatal error event.
org.xml.sax.ContentHandlergetContentHandler()

Get the content event handler.
org.xml.sax.DTDHandlergetDTDHandler()

Get the current DTD event handler.
org.xml.sax.EntityResolvergetEntityResolver()

Get the current entity resolver.
org.xml.sax.ErrorHandlergetErrorHandler()

Get the current error event handler.
booleangetFeature(java.lang.String name)

Look up the value of a feature.
org.xml.sax.XMLReadergetParent()

Get the parent reader.
java.lang.ObjectgetProperty(java.lang.String name)

Look up the value of a property.
voidignorableWhitespace(char[] ch, int start, int length)

Filter an ignorable whitespace event.
voidnotationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)

Filter a notation declaration event.
voidparse(org.xml.sax.InputSource input)

Parse a document.
voidparse(java.lang.String systemId)

Parse a document.
voidprocessingInstruction(java.lang.String target, java.lang.String data)

Filter a processing instruction event.
org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)

Filter an external entity resolution.
voidsetContentHandler(org.xml.sax.ContentHandler handler)

Set the content event handler.
voidsetDTDHandler(org.xml.sax.DTDHandler handler)

Set the DTD event handler.
voidsetDocumentLocator(org.xml.sax.Locator locator)

Filter a new document locator event.
voidsetEntityResolver(org.xml.sax.EntityResolver resolver)

Set the entity resolver.
voidsetErrorHandler(org.xml.sax.ErrorHandler handler)

Set the error event handler.
voidsetFeature(java.lang.String name, boolean value)

Set the value of a feature.
voidsetParent(org.xml.sax.XMLReader parent)

Set the parent reader.
voidsetProperty(java.lang.String name, java.lang.Object value)

Set the value of a property.
voidskippedEntity(java.lang.String name)

Filter a skipped entity event.
voidstartDocument()

Filter a start document event.
voidstartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)

Filter a start element event.
voidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)

Filter a start Namespace prefix mapping event.
voidunparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)

Filter an unparsed entity declaration event.
voidwarning(org.xml.sax.SAXParseException e)

Filter a warning event.

Constructor Details

XMLFilterImpl

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.

See Also:


XMLFilterImpl

public XMLFilterImpl(org.xml.sax.XMLReader parent)

Construct an XML filter with the specified parent.

Parameters:

See Also:


Method Details

characters

public void characters(char[] ch, int start, int length)

Filter a character data event.

Parameters:

Throws:


endDocument

public void endDocument()

Filter an end document event.

Throws:


endElement

public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)

Filter an end element event.

Parameters:

Throws:


endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)

Filter an end Namespace prefix mapping event.

Parameters:

Throws:


error

public void error(org.xml.sax.SAXParseException e)

Filter an error event.

Parameters:

Throws:


fatalError

public void fatalError(org.xml.sax.SAXParseException e)

Filter a fatal error event.

Parameters:

Throws:


getContentHandler

public ContentHandler getContentHandler()

Get the content event handler.

Returns:


getDTDHandler

public DTDHandler getDTDHandler()

Get the current DTD event handler.

Returns:


getEntityResolver

public EntityResolver getEntityResolver()

Get the current entity resolver.

Returns:


getErrorHandler

public ErrorHandler getErrorHandler()

Get the current error event handler.

Returns:


getFeature

public boolean getFeature(java.lang.String name)

Look up the value of a feature.

This will always fail if the parent is null.

Parameters:

Returns:

Throws:


getParent

public XMLReader getParent()

Get the parent reader.

Returns:

See Also:


getProperty

public Object getProperty(java.lang.String name)

Look up the value of a property.

Parameters:

Returns:

Throws:


ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)

Filter an ignorable whitespace event.

Parameters:

Throws:


notationDecl

public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)

Filter a notation declaration event.

Parameters:

Throws:


parse

public void parse(java.lang.String systemId)

Parse a document.

Parameters:

Throws:


parse

public void parse(org.xml.sax.InputSource input)

Parse a document.

Parameters:

Throws:


processingInstruction

public void processingInstruction(java.lang.String target, java.lang.String data)

Filter a processing instruction event.

Parameters:

Throws:


resolveEntity

public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)

Filter an external entity resolution.

Parameters:

Returns:

Throws:


setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler handler)

Set the content event handler.

Parameters:


setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler handler)

Set the DTD event handler.

Parameters:


setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)

Filter a new document locator event.

Parameters:


setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver resolver)

Set the entity resolver.

Parameters:


setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler handler)

Set the error event handler.

Parameters:


setFeature

public void setFeature(java.lang.String name, boolean value)

Set the value of a feature.

This will always fail if the parent is null.

Parameters:

Throws:


setParent

public void setParent(org.xml.sax.XMLReader parent)

Set the parent reader.

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.

Parameters:

See Also:


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.

Parameters:

Throws:


skippedEntity

public void skippedEntity(java.lang.String name)

Filter a skipped entity event.

Parameters:

Throws:


startDocument

public void startDocument()

Filter a start document event.

Throws:


startElement

public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)

Filter a start element event.

Parameters:

Throws:


startPrefixMapping

public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)

Filter a start Namespace prefix mapping event.

Parameters:

Throws:


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.

Parameters:

Throws:


warning

public void warning(org.xml.sax.SAXParseException e)

Filter a warning event.

Parameters:

Throws: