com.raritech.xml.sax.filter
Class ElementTagRemover

java.lang.Object
  |
  +--com.raritech.xml.sax.filter.AbstractElementReplacer
        |
        +--com.raritech.xml.sax.filter.ElementTagRemover
All Implemented Interfaces:
org.xml.sax.ContentHandler, ElementComparator, ElementReplacer

public class ElementTagRemover
extends AbstractElementReplacer

Removes the Tag from an element, leaving just the character data. Uses the Replacer strategy - replace the tag with just its character data.


Constructor Summary
ElementTagRemover(ElementComparator comp)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void elementEnding(org.xml.sax.ContentHandler cHandler)
          Signals that the next endElement call will be the last one handled by this ElementReplacer.
 void elementStarting(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs, org.xml.sax.ContentHandler cHandler)
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
           
 boolean matchesPath(java.lang.String path)
          Checks if the XML tag at the specified path matches the criteria of this comparator.
 boolean matchesTag(java.lang.String path, org.xml.sax.Attributes atts)
          Checks if the XML tag at the specified path with given attribute list matches the criteria of this comparator.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 
Methods inherited from class com.raritech.xml.sax.filter.AbstractElementReplacer
endDocument, endPrefixMapping, ignorableWhitespace, matchesData, needsData, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementTagRemover

public ElementTagRemover(ElementComparator comp)
Method Detail

matchesTag

public boolean matchesTag(java.lang.String path,
                          org.xml.sax.Attributes atts)
Description copied from interface: ElementComparator
Checks if the XML tag at the specified path with given attribute list matches the criteria of this comparator.
Overrides:
matchesTag in class AbstractElementReplacer
Following copied from interface: com.raritech.xml.sax.filter.ElementComparator
Parameters:
path - XML path to the element.
atts - Attribute list of the element.
Returns:
true if parameters match criteria of this comparator, false otherwise.

matchesPath

public boolean matchesPath(java.lang.String path)
Description copied from interface: ElementComparator
Checks if the XML tag at the specified path matches the criteria of this comparator.
Overrides:
matchesPath in class AbstractElementReplacer
Following copied from interface: com.raritech.xml.sax.filter.ElementComparator
Parameters:
path - XML path to the element.
Returns:
true if path matches criteria of this comparator, false otherwise.

elementStarting

public void elementStarting(java.lang.String uri,
                            java.lang.String localName,
                            java.lang.String qName,
                            org.xml.sax.Attributes attrs,
                            org.xml.sax.ContentHandler cHandler)

elementEnding

public void elementEnding(org.xml.sax.ContentHandler cHandler)
Description copied from interface: ElementReplacer
Signals that the next endElement call will be the last one handled by this ElementReplacer.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Overrides:
characters in class AbstractElementReplacer

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Overrides:
startElement in class AbstractElementReplacer

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Overrides:
endElement in class AbstractElementReplacer