class PruningElementStack extends ElementStack
PruningElementStack
is a stack of Element
instances 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).
|
lastElementIndex, stack
Constructor and Description |
---|
PruningElementStack(String[] path,
ElementHandler elementHandler) |
PruningElementStack(String[] path,
ElementHandler elementHandler,
int defaultCapacity) |
Modifier and Type | Method and Description |
---|---|
private void |
checkPath() |
protected void |
pathMatches(Element parent,
Element selectedNode) |
Element |
popElement()
Pops the element off the stack
|
protected boolean |
validElement(Element element,
int index) |
addHandler, clear, getCurrent, getElement, getPath, peekElement, pushElement, reallocate, removeHandler, setDispatchHandler, size
private ElementHandler elementHandler
private String[] path
private int matchingElementIndex
public PruningElementStack(String[] path, ElementHandler elementHandler)
public PruningElementStack(String[] path, ElementHandler elementHandler, int defaultCapacity)
public Element popElement()
ElementStack
popElement
in class ElementStack
protected void pathMatches(Element parent, Element selectedNode)
protected boolean validElement(Element element, int index)
private void checkPath()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses