PruningElementStack is a stack of Elementinstances
which will prune the tree when a path expression is reached. This is useful
for parsing very large documents where children of the root element can be
processed individually rather than keeping them all in memory at the same
time.
| Modifier and Type | Field and Description |
|---|---|
| private ElementHandler | elementHandler
ElementHandler to call when pruning occurs |
| private int | matchingElementIndex
The level at which a path match can occur. |
| private String[] | path
the element name path which denotes the node to remove from its parent when it is complete (i.e. when it is popped from the stack). |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| protected void | |
| public Element | |
| protected boolean |
| elementHandler | back to summary |
|---|---|
| private ElementHandler elementHandler ElementHandler to call when pruning occurs | |
| matchingElementIndex | back to summary |
|---|---|
| private int matchingElementIndex The level at which a path match can occur. We match when we have popped the selected node so the and the lastElementIndex points to its parent so this value should be path.length - 2 | |
| path | back to summary |
|---|---|
| private String[] path the element name path which denotes the node to remove from its parent when it is complete (i.e. when it is popped from the stack). The first entry in the path will be a child of the root node | |
| PruningElementStack | back to summary |
|---|---|
| public PruningElementStack(String[] path, ElementHandler elementHandler) | |
| PruningElementStack | back to summary |
|---|---|
| public PruningElementStack(String[] path, ElementHandler elementHandler, int defaultCapacity) | |
| checkPath | back to summary |
|---|---|
| private void checkPath() | |
| pathMatches | back to summary |
|---|---|
| protected void pathMatches(Element parent, Element selectedNode) | |
| popElement | back to summary |
|---|---|
| public Element popElement() Overrides org. Doc from org. Pops the element off the stack
| |
| validElement | back to summary |
|---|---|
| protected boolean validElement(Element element, int index) | |