Package org.jsoup.select

## Class NodeTraversor

- java.lang.Object
- - org.jsoup.select.NodeTraversor

    public class NodeTraversor
    extends java.lang.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
`NodeTraversor()`

### Method Summary

All Methods Static Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### NodeTraversor

    public NodeTraversor()

### Method Detail

#### traverse

    public static void traverse​(NodeVisitor visitor,
                                Node root)

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

    public static void traverse​(NodeVisitor visitor,
                                Elements elements)

Start a depth-first traverse of all elements.

Parameters:
  `visitor` - Node visitor.
  `elements` - Elements to filter.

#### filter

    public static NodeFilter.FilterResult filter​(NodeFilter filter,
                                                 Node root)

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

    public static void filter​(NodeFilter filter,
                              Elements elements)

Start a depth-first filtering of all elements.

Parameters:
  `filter` - Node filter.
  `elements` - Elements to filter.