org.cyberneko.html.filters
Class DefaultFilter

java.lang.Object
  extended byorg.cyberneko.html.filters.DefaultFilter
All Implemented Interfaces:
XMLDocumentFilter, XMLDocumentHandler, XMLDocumentSource
Direct Known Subclasses:
ElementRemover, Identity, Writer

public class DefaultFilter
extends Object
implements XMLDocumentFilter

This class implements a filter that simply passes document events to the next handler. It can be used as a base class to simplify the development of new document filters.

Version:
$Id$
Author:
Andy Clark

Field Summary
protected  XMLDocumentHandler fDocumentHandler
          Document handler.
protected  XMLDocumentSource fDocumentSource
          Document source.
 
Constructor Summary
DefaultFilter()
           
 
Method Summary
 void characters(XMLString text, Augmentations augs)
          Characters.
 void comment(XMLString text, Augmentations augs)
          Comment.
 void doctypeDecl(String root, String publicId, String systemId, Augmentations augs)
          Doctype declaration.
 void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
          Empty element.
 void endCDATA(Augmentations augs)
          End CDATA section.
 void endDocument(Augmentations augs)
          End document.
 void endElement(QName element, Augmentations augs)
          End element.
 void endGeneralEntity(String name, Augmentations augs)
          End general entity.
 void endPrefixMapping(String prefix, Augmentations augs)
          End prefix mapping.
 XMLDocumentHandler getDocumentHandler()
          Returns the document handler.
 XMLDocumentSource getDocumentSource()
          Returns the document source.
 void ignorableWhitespace(XMLString text, Augmentations augs)
          Ignorable whitespace.
 void processingInstruction(String target, XMLString data, Augmentations augs)
          Processing instruction.
 void setDocumentHandler(XMLDocumentHandler handler)
          Sets the document handler.
 void setDocumentSource(XMLDocumentSource source)
          Sets the document source.
 void startCDATA(Augmentations augs)
          Start CDATA section.
 void startDocument(XMLLocator locator, String encoding, Augmentations augs)
          Start document.
 void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs)
          Start document.
 void startElement(QName element, XMLAttributes attributes, Augmentations augs)
          Start element.
 void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs)
          Start general entity.
 void startPrefixMapping(String prefix, String uri, Augmentations augs)
          Start prefix mapping.
 void textDecl(String version, String encoding, Augmentations augs)
          Text declaration.
 void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
          XML declaration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fDocumentHandler

protected XMLDocumentHandler fDocumentHandler
Document handler.


fDocumentSource

protected XMLDocumentSource fDocumentSource
Document source.

Constructor Detail

DefaultFilter

public DefaultFilter()
Method Detail

setDocumentHandler

public void setDocumentHandler(XMLDocumentHandler handler)
Sets the document handler.

Specified by:
setDocumentHandler in interface XMLDocumentSource

getDocumentHandler

public XMLDocumentHandler getDocumentHandler()
Returns the document handler.

Specified by:
getDocumentHandler in interface XMLDocumentSource

setDocumentSource

public void setDocumentSource(XMLDocumentSource source)
Sets the document source.

Specified by:
setDocumentSource in interface XMLDocumentHandler

getDocumentSource

public XMLDocumentSource getDocumentSource()
Returns the document source.

Specified by:
getDocumentSource in interface XMLDocumentHandler

startDocument

public void startDocument(XMLLocator locator,
                          String encoding,
                          NamespaceContext nscontext,
                          Augmentations augs)
                   throws XNIException
Start document.

Specified by:
startDocument in interface XMLDocumentHandler
Throws:
XNIException

xmlDecl

public void xmlDecl(String version,
                    String encoding,
                    String standalone,
                    Augmentations augs)
             throws XNIException
XML declaration.

Specified by:
xmlDecl in interface XMLDocumentHandler
Throws:
XNIException

doctypeDecl

public void doctypeDecl(String root,
                        String publicId,
                        String systemId,
                        Augmentations augs)
                 throws XNIException
Doctype declaration.

Specified by:
doctypeDecl in interface XMLDocumentHandler
Throws:
XNIException

comment

public void comment(XMLString text,
                    Augmentations augs)
             throws XNIException
Comment.

Specified by:
comment in interface XMLDocumentHandler
Throws:
XNIException

processingInstruction

public void processingInstruction(String target,
                                  XMLString data,
                                  Augmentations augs)
                           throws XNIException
Processing instruction.

Specified by:
processingInstruction in interface XMLDocumentHandler
Throws:
XNIException

startElement

public void startElement(QName element,
                         XMLAttributes attributes,
                         Augmentations augs)
                  throws XNIException
Start element.

Specified by:
startElement in interface XMLDocumentHandler
Throws:
XNIException

emptyElement

public void emptyElement(QName element,
                         XMLAttributes attributes,
                         Augmentations augs)
                  throws XNIException
Empty element.

Specified by:
emptyElement in interface XMLDocumentHandler
Throws:
XNIException

characters

public void characters(XMLString text,
                       Augmentations augs)
                throws XNIException
Characters.

Specified by:
characters in interface XMLDocumentHandler
Throws:
XNIException

ignorableWhitespace

public void ignorableWhitespace(XMLString text,
                                Augmentations augs)
                         throws XNIException
Ignorable whitespace.

Specified by:
ignorableWhitespace in interface XMLDocumentHandler
Throws:
XNIException

startGeneralEntity

public void startGeneralEntity(String name,
                               XMLResourceIdentifier id,
                               String encoding,
                               Augmentations augs)
                        throws XNIException
Start general entity.

Specified by:
startGeneralEntity in interface XMLDocumentHandler
Throws:
XNIException

textDecl

public void textDecl(String version,
                     String encoding,
                     Augmentations augs)
              throws XNIException
Text declaration.

Specified by:
textDecl in interface XMLDocumentHandler
Throws:
XNIException

endGeneralEntity

public void endGeneralEntity(String name,
                             Augmentations augs)
                      throws XNIException
End general entity.

Specified by:
endGeneralEntity in interface XMLDocumentHandler
Throws:
XNIException

startCDATA

public void startCDATA(Augmentations augs)
                throws XNIException
Start CDATA section.

Specified by:
startCDATA in interface XMLDocumentHandler
Throws:
XNIException

endCDATA

public void endCDATA(Augmentations augs)
              throws XNIException
End CDATA section.

Specified by:
endCDATA in interface XMLDocumentHandler
Throws:
XNIException

endElement

public void endElement(QName element,
                       Augmentations augs)
                throws XNIException
End element.

Specified by:
endElement in interface XMLDocumentHandler
Throws:
XNIException

endDocument

public void endDocument(Augmentations augs)
                 throws XNIException
End document.

Specified by:
endDocument in interface XMLDocumentHandler
Throws:
XNIException

startDocument

public void startDocument(XMLLocator locator,
                          String encoding,
                          Augmentations augs)
                   throws XNIException
Start document.

Throws:
XNIException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri,
                               Augmentations augs)
                        throws XNIException
Start prefix mapping.

Throws:
XNIException

endPrefixMapping

public void endPrefixMapping(String prefix,
                             Augmentations augs)
                      throws XNIException
End prefix mapping.

Throws:
XNIException


(C) Copyright 2002-2003, Andy Clark. All rights reserved.