public class StripWordElementsFilter extends ExtendedXMLFilterImpl
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
elementsToStripSet
Set of tags from which to strip words.
|
protected boolean |
processingWord
True if processing word element.
|
protected XMLSentenceMelder |
sentenceMelder
XML sentence melder.
|
protected QueueStack<java.lang.String> |
stripElementStack
Strip element stack.
|
Constructor and Description |
---|
StripWordElementsFilter(org.xml.sax.XMLReader reader,
java.lang.String elementsToStrip)
Create filter.
|
StripWordElementsFilter(org.xml.sax.XMLReader reader,
java.lang.String elementsToStrip,
XMLSentenceMelder sentenceMelder)
Create filter.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Handle character data.
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Handle end of an element.
|
void |
setSentenceMelder(XMLSentenceMelder sentenceMelder)
Set associated sentence melder.
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
Handle start of an XML element.
|
removeAttribute, setAttributeValue, setAttributeValue, setAttributeValue
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
protected java.util.Set<java.lang.String> elementsToStripSet
protected XMLSentenceMelder sentenceMelder
protected QueueStack<java.lang.String> stripElementStack
protected boolean processingWord
public StripWordElementsFilter(org.xml.sax.XMLReader reader, java.lang.String elementsToStrip, XMLSentenceMelder sentenceMelder)
reader
- XML input reader to which filter applies.elementsToStrip
- Elements to strip separated by spaces.sentenceMelder
- Associated sentence melder.public StripWordElementsFilter(org.xml.sax.XMLReader reader, java.lang.String elementsToStrip)
reader
- XML input reader to which filter applies.elementsToStrip
- Elements to strip separated by spaces.public void setSentenceMelder(XMLSentenceMelder sentenceMelder)
sentenceMelder
- Sentence melder.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
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.XMLFilterImpl
uri
- The XML element's URI.localName
- The XML element's local name.qName
- The XML element's qname.atts
- The XML element's attributes.org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.XMLFilterImpl
ch
- Array of characters.start
- The starting position in the array.length
- The number of characters.org.xml.sax.SAXException
- If there is an error.public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.XMLFilterImpl
uri
- The XML element's URI.localName
- The XML element's local name.qName
- The XML element's qname.org.xml.sax.SAXException