com.simonstl.ool
Class MixedWrapSAXFilter

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
        |
        +--com.simonstl.ool.MixedWrapSAXFilter
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public class MixedWrapSAXFilter
extends org.xml.sax.helpers.XMLFilterImpl

This class wraps mixed content textual fragments in mix:ed elements.

Version:
0.01 $Date: 2002/05/06 $
Author:
Simon St.Laurent

Field Summary
protected  java.lang.StringBuffer chars
           
protected  org.xml.sax.helpers.AttributesImpl emptyAtts
           
protected  boolean ignoreWhitespace
           
protected  boolean previousEndEvent
           
 
Constructor Summary
MixedWrapSAXFilter(org.xml.sax.XMLReader parent)
          A constructor that takes the parser which will feed it SAX events
 
Method Summary
 void characters(char[] ch, int start, int len)
          Handles characters events.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Handles endElement events.
 boolean getIgnoreWhitespace()
          Get whether or not to ignore whitespace
 void ignorableWhitespace(char[] ch, int start, int len)
          Handles ignorableWhitespace events.
protected  boolean ignoreIt()
           
protected  boolean isWhitespace(int testChar)
           
static void main(java.lang.String[] args)
          FilterTester's main method requires one argument - a target XML file.
static void printHelp()
           
 void setIgnoreWhitespace(boolean _ignoreWhitespace)
          Set whether or not to ignore whitespace
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Handles startElement events.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousEndEvent

protected boolean previousEndEvent

ignoreWhitespace

protected boolean ignoreWhitespace

chars

protected java.lang.StringBuffer chars

emptyAtts

protected org.xml.sax.helpers.AttributesImpl emptyAtts
Constructor Detail

MixedWrapSAXFilter

public MixedWrapSAXFilter(org.xml.sax.XMLReader parent)
A constructor that takes the parser which will feed it SAX events
Method Detail

setIgnoreWhitespace

public void setIgnoreWhitespace(boolean _ignoreWhitespace)
Set whether or not to ignore whitespace

getIgnoreWhitespace

public boolean getIgnoreWhitespace()
Get whether or not to ignore whitespace

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Handles startElement events.
Overrides:
startElement in class org.xml.sax.helpers.XMLFilterImpl

characters

public void characters(char[] ch,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Handles characters events.
Overrides:
characters in class org.xml.sax.helpers.XMLFilterImpl

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int len)
                         throws org.xml.sax.SAXException
Handles ignorableWhitespace events.
Overrides:
ignorableWhitespace in class org.xml.sax.helpers.XMLFilterImpl

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Handles endElement events.
Overrides:
endElement in class org.xml.sax.helpers.XMLFilterImpl

ignoreIt

protected boolean ignoreIt()

isWhitespace

protected boolean isWhitespace(int testChar)

printHelp

public static void printHelp()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
FilterTester's main method requires one argument - a target XML file. Options may appear before those arguments:
-p [parser class name] - use the parser specified