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()
-
Method Summary
Modifier and Type Method Description static NodeFilter.FilterResult
filter(NodeFilter filter, Node root)
Start a depth-first filtering of the root and all of its descendants.static void
filter(NodeFilter filter, Elements elements)
Start a depth-first filtering of all elements.static void
traverse(NodeVisitor visitor, Node root)
Start a depth-first traverse of the root and all of its descendants.static void
traverse(NodeVisitor visitor, Elements elements)
Start a depth-first traverse of all elements.
-
Constructor Details
-
NodeTraversor
public NodeTraversor()
-
-
Method Details
-
traverse
Start a depth-first traverse of the root and all of its descendants.- Parameters:
visitor
- Node visitor.root
- the root node point to traverse.
-
traverse
Start a depth-first traverse of all elements.- Parameters:
visitor
- Node visitor.elements
- Elements to filter.
-
filter
Start a depth-first filtering of the root and all of its descendants.- Parameters:
filter
- Node visitor.root
- the root node point to traverse.- Returns:
- The filter result of the root node, or
NodeFilter.FilterResult.STOP
.
-
filter
Start a depth-first filtering of all elements.- Parameters:
filter
- Node filter.elements
- Elements to filter.
-