fi.karppinen.xml
Class BodyContentPassFilter

java.lang.Object
  extended by gnu.xml.pipeline.EventFilter
      extended by fi.karppinen.xml.BodyContentPassFilter
All Implemented Interfaces:
gnu.xml.pipeline.EventConsumer, ContentHandler, DTDHandler, DeclHandler, LexicalHandler

public class BodyContentPassFilter
extends gnu.xml.pipeline.EventFilter

This filter supresses all ContentHandler events except those that happen between XHTML 1.x body start and end. The filter assumes that there is exactly one body element. In particular, nested body elements are not supported.

Version:
$Id: BodyContentPassFilter.java,v 1.1 2006/10/30 19:57:09 hsivonen Exp $
Author:
hsivonen

Field Summary
private  boolean pass
           
 
Fields inherited from class gnu.xml.pipeline.EventFilter
DECL_HANDLER, FEATURE_URI, LEXICAL_HANDLER, PROPERTY_URI
 
Constructor Summary
BodyContentPassFilter()
           
BodyContentPassFilter(gnu.xml.pipeline.EventConsumer consumer)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(String target, String data)
           
 void skippedEntity(String name)
           
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes atts)
           
 
Methods inherited from class gnu.xml.pipeline.EventFilter
attributeDecl, bind, chainTo, comment, elementDecl, endCDATA, endDTD, endEntity, endPrefixMapping, externalEntityDecl, getContentHandler, getDocumentLocator, getDTDHandler, getErrorHandler, getNext, getProperty, internalEntityDecl, notationDecl, setContentHandler, setDocumentLocator, setDTDHandler, setErrorHandler, setProperty, startCDATA, startDTD, startEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pass

private boolean pass
Constructor Detail

BodyContentPassFilter

public BodyContentPassFilter()

BodyContentPassFilter

public BodyContentPassFilter(gnu.xml.pipeline.EventConsumer consumer)
Parameters:
consumer -
Method Detail

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.characters(char[], int, int)

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.endDocument()

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Overrides:
ignorableWhitespace in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Overrides:
skippedEntity in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.skippedEntity(java.lang.String)

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.startDocument()

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class gnu.xml.pipeline.EventFilter
Throws:
SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)