XMLFilter that can cut sub-trees.
| Modifier and Type | Field and Description |
|---|---|
| private int | cutDepth
When we are pruning a sub tree, this field holds the depth of elements that are being cut. |
| private ContentHandler | next
This field remembers the user-specified ContentHandler. |
| private static final ContentHandler | stub
This object will receive SAX events while a sub tree is being pruned. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | endElement(String namespaceURI, String localName, String qName)
Overrides org. Implements org. Filter an end element event. |
| public boolean | |
| public void | setContentHandler(ContentHandler handler)
Overrides org. Implements org. Set the content event handler. |
| public void | |
| public void | startDocument()
Overrides org. Implements org. Filter a start document event. |
| public void | startElement(String uri, String localName, String qName, Attributes atts)
Overrides org. Implements org. Filter a start element event. |
| cutDepth | back to summary |
|---|---|
| private int cutDepth When we are pruning a sub tree, this field holds the depth of elements that are being cut. Used to resume event forwarding. As long as this value is 0, we will pass through data. | |
| next | back to summary |
|---|---|
| private ContentHandler next This field remembers the user-specified ContentHandler. So that we can restore it once the sub tree is completely pruned. | |
| stub | back to summary |
|---|---|
| private static final ContentHandler stub This object will receive SAX events while a sub tree is being pruned. | |
| SubtreeCutter | back to summary |
|---|---|
| protected SubtreeCutter() Default constructor. | |
| endElement | back to summary |
|---|---|
| public void endElement(String namespaceURI, String localName, String qName) throws SAXException Overrides org. Implements org. Doc from org. Filter an end element event.
| |
| isCutting | back to summary |
|---|---|
| public boolean isCutting() | |
| setContentHandler | back to summary |
|---|---|
| public void setContentHandler(ContentHandler handler) Overrides org. Implements org. Doc from org. Set the content event handler.
| |
| startCutting | back to summary |
|---|---|
| public void startCutting() Starts cutting a sub-tree. Should be called from within the
| |
| startDocument | back to summary |
|---|---|
| public void startDocument() throws SAXException Overrides org. Implements org. Doc from org. Filter a start document event.
| |
| startElement | back to summary |
|---|---|
| public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException Overrides org. Implements org. Doc from org. Filter a start element event.
| |