Package org.jsoup.select
Class NodeTraversor
- java.lang.Object
-
- org.jsoup.select.NodeTraversor
-
public class NodeTraversor extends Object
Depth-first node traversor. Use to iterate through all nodes under and including the specified root node.This implementation does not use recursion, so a deep DOM does not risk blowing the stack.
-
-
Constructor Summary
Constructors Constructor Description NodeTraversor(NodeVisitor visitor)
Create a new traversor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
traverse(Node root)
Start a depth-first traverse of the root and all of its descendants.
-
-
-
Constructor Detail
-
NodeTraversor
public NodeTraversor(NodeVisitor visitor)
Create a new traversor.- Parameters:
visitor
- a class implementing theNodeVisitor
interface, to be called when visiting each node.
-
-
Method Detail
-
traverse
public void traverse(Node root)
Start a depth-first traverse of the root and all of its descendants.- Parameters:
root
- the root node point to traverse.
-
-