|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.aliasi.xml.SimpleElementHandler
com.aliasi.xml.SAXFilterHandler
com.aliasi.xml.RemoveElementsFilter
public class RemoveElementsFilter
A RemoveElementsFilter filters out specified elements
from a stream of SAX events. The elements to remove are specified
by qualified name with the method removeElement(String).
The content of the elements is not removed.
| Field Summary |
|---|
| Fields inherited from class com.aliasi.xml.SAXFilterHandler |
|---|
mHandler |
| Fields inherited from class com.aliasi.xml.SimpleElementHandler |
|---|
CDATA_ATTS_TYPE, EMPTY_ATTS, NO_OP_DEFAULT_HANDLER |
| Constructor Summary | |
|---|---|
RemoveElementsFilter()
Construct a filter to remove elements. |
|
RemoveElementsFilter(DefaultHandler handler)
Construct a filter to remove elements and pass events to the specified handler. |
|
| Method Summary | |
|---|---|
void |
endElement(String namespaceURI,
String localName,
String qName)
Removes specified elements, passing others to the contained handler. |
void |
removeElement(String qName)
Add the specified qualified element name to the set of elements to remove. |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
Removes specified elements and passes others through to the contained handler. |
| Methods inherited from class com.aliasi.xml.SAXFilterHandler |
|---|
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, setHandler, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoveElementsFilter()
removeElement(String). The
handler to receive events should be set with SAXFilterHandler.setHandler(DefaultHandler).
public RemoveElementsFilter(DefaultHandler handler)
removeElement(String).
| Method Detail |
|---|
public void removeElement(String qName)
qName - Qualified name of element to remove.
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class SAXFilterHandlernamespaceURI - The URI identifying the name space, or
null if there isn't one.localName - Local name of element.qName - Qualified name of element, which is prefixed with
the name space URI and a colon if it is non-null, and is equal
to local name if there is no name space specified.atts - Attributes for this element.
SAXException - if the contained hanlder throws a SAX
exception.
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class SAXFilterHandlernamespaceURI - The URI identifying the name space, or
null if there isn't one.localName - Local name of element.qName - Qualified name of element, which is prefixed with
the name space URI and a colon if it is non-null, and is equal
to local name if there is no name space specified.
SAXException - if the contained hanlder throws a SAX
exception.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||