Package org.dom4j.io

Class PruningElementStack

  • All Implemented Interfaces:
    ElementPath

    class PruningElementStack
    extends ElementStack

    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.

    Version:
    $Revision: 1.11 $
    Author:
    James Strachan
    • Constructor Detail

      • PruningElementStack

        public PruningElementStack​(String[] path,
                                   ElementHandler elementHandler)
      • PruningElementStack

        public PruningElementStack​(String[] path,
                                   ElementHandler elementHandler,
                                   int defaultCapacity)
    • Method Detail

      • popElement

        public Element popElement()
        Description copied from class: ElementStack
        Pops the element off the stack
        Overrides:
        popElement in class ElementStack
        Returns:
        the element that has just been popped off the stack
      • pathMatches

        protected void pathMatches​(Element parent,
                                   Element selectedNode)
      • validElement

        protected boolean validElement​(Element element,
                                       int index)