fi.karppinen.xml
Class AstralContentFilter

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

public class AstralContentFilter
extends gnu.xml.pipeline.EventFilter

This filter replaces astral characters with U+FFFD REPLACEMENT CHARACTER. This filter is useful when preparing data for a recipient that does not handle astral characters gracefully.

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

Field Summary
private static char[] REPLACEMENT_CHARACTER
           
 
Fields inherited from class gnu.xml.pipeline.EventFilter
DECL_HANDLER, FEATURE_URI, LEXICAL_HANDLER, PROPERTY_URI
 
Constructor Summary
AstralContentFilter()
          Constructs a new AstralContentFilter.
AstralContentFilter(gnu.xml.pipeline.EventConsumer consumer)
          Constructs a new AstralContentFilter chaining it to an EventConsumer.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 
Methods inherited from class gnu.xml.pipeline.EventFilter
attributeDecl, bind, chainTo, comment, elementDecl, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, externalEntityDecl, getContentHandler, getDocumentLocator, getDTDHandler, getErrorHandler, getNext, getProperty, ignorableWhitespace, internalEntityDecl, notationDecl, processingInstruction, setContentHandler, setDocumentLocator, setDTDHandler, setErrorHandler, setProperty, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPLACEMENT_CHARACTER

private static final char[] REPLACEMENT_CHARACTER
Constructor Detail

AstralContentFilter

public AstralContentFilter()
Constructs a new AstralContentFilter.


AstralContentFilter

public AstralContentFilter(gnu.xml.pipeline.EventConsumer consumer)
Constructs a new AstralContentFilter chaining it to an EventConsumer.

Parameters:
consumer - the next EventConsumer in the chain
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)