Class DomTreeWalker

java.lang.Object
org.htmlunit.platform.dom.traversal.DomTreeWalker
All Implemented Interfaces:
org.w3c.dom.traversal.TreeWalker

public class DomTreeWalker extends Object implements org.w3c.dom.traversal.TreeWalker
An implementation of TreeWalker backed by HtmlDomTreeWalker.
See Also:
  • Field Details

  • Constructor Details

    • DomTreeWalker

      public DomTreeWalker(DomNode root, int whatToShow, org.w3c.dom.traversal.NodeFilter filter, boolean expandEntityReferences) throws 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:
      DOMException - on attempt to create a TreeWalker with a root that is null.
  • Method Details

    • 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(Node currentNode) throws DOMException
      Specified by:
      setCurrentNode in interface org.w3c.dom.traversal.TreeWalker
      Throws:
      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