Class DomTreeWalker

  • All Implemented Interfaces:
    org.w3c.dom.traversal.TreeWalker

    public class DomTreeWalker
    extends java.lang.Object
    implements org.w3c.dom.traversal.TreeWalker
    An implementation of TreeWalker backed by HtmlDomTreeWalker.
    See Also:
    DOM-Level-2-Traversal-Range
    • Constructor Detail

      • DomTreeWalker

        public DomTreeWalker​(DomNode root,
                             int whatToShow,
                             org.w3c.dom.traversal.NodeFilter filter,
                             boolean expandEntityReferences)
                      throws org.w3c.dom.DOMException
        Creates an instance.
        Parameters:
        root - The root node of the TreeWalker. Must not be null.
        whatToShow - Flag specifying which types of nodes appear in the logical view of the TreeWalker. See NodeFilter for the set of possible Show_ values.
        filter - The NodeFilter to be used with this TreeWalker, or null to indicate no filter.
        expandEntityReferences - If false, the contents of EntityReference nodes are not present in the logical view.
        Throws:
        org.w3c.dom.DOMException - on attempt to create a TreeWalker with a root that is null.
    • Method Detail

      • getRoot

        public DomNode getRoot()
        Specified by:
        getRoot in interface org.w3c.dom.traversal.TreeWalker
      • getWhatToShow

        public int getWhatToShow()
        Specified by:
        getWhatToShow in interface org.w3c.dom.traversal.TreeWalker
      • getFilter

        public org.w3c.dom.traversal.NodeFilter getFilter()
        Specified by:
        getFilter in interface org.w3c.dom.traversal.TreeWalker
      • getExpandEntityReferences

        public boolean getExpandEntityReferences()
        Specified by:
        getExpandEntityReferences in interface org.w3c.dom.traversal.TreeWalker
      • getCurrentNode

        public DomNode getCurrentNode()
        Specified by:
        getCurrentNode in interface org.w3c.dom.traversal.TreeWalker
      • setCurrentNode

        public void setCurrentNode​(org.w3c.dom.Node currentNode)
                            throws org.w3c.dom.DOMException
        Specified by:
        setCurrentNode in interface org.w3c.dom.traversal.TreeWalker
        Throws:
        org.w3c.dom.DOMException
      • nextNode

        public DomNode nextNode()
        Specified by:
        nextNode in interface org.w3c.dom.traversal.TreeWalker
      • nextSibling

        public DomNode nextSibling()
        Specified by:
        nextSibling in interface org.w3c.dom.traversal.TreeWalker
      • parentNode

        public DomNode parentNode()
        Specified by:
        parentNode in interface org.w3c.dom.traversal.TreeWalker
      • previousSibling

        public DomNode previousSibling()
        Specified by:
        previousSibling in interface org.w3c.dom.traversal.TreeWalker
      • lastChild

        public DomNode lastChild()
        Specified by:
        lastChild in interface org.w3c.dom.traversal.TreeWalker
      • previousNode

        public DomNode previousNode()
        Specified by:
        previousNode in interface org.w3c.dom.traversal.TreeWalker
      • firstChild

        public DomNode firstChild()
        Specified by:
        firstChild in interface org.w3c.dom.traversal.TreeWalker