public class RemoveElementsFilter extends SAXFilterHandler
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.mHandlerCDATA_ATTS_TYPE, EMPTY_ATTS, NO_OP_DEFAULT_HANDLER| Constructor and Description |
|---|
RemoveElementsFilter()
Construct a filter to remove elements.
|
RemoveElementsFilter(org.xml.sax.helpers.DefaultHandler handler)
Construct a filter to remove elements and pass events to
the specified handler.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, setHandler, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningaddSimpleAttribute, characters, characters, characters, characters, createAttributes, createAttributes, createAttributes, createAttributes, createAttributes, createAttributes, endSimpleElement, endSimpleElement, startEndSimpleElement, startEndSimpleElement, startSimpleElement, startSimpleElement, startSimpleElement, startSimpleElement, startSimpleElement, startSimpleElement, startSimpleElementpublic RemoveElementsFilter()
removeElement(String). The
handler to receive events should be set with SAXFilterHandler.setHandler(DefaultHandler).public RemoveElementsFilter(org.xml.sax.helpers.DefaultHandler handler)
removeElement(String).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.Copyright © 2019 Alias-i, Inc.. All rights reserved.