public class NodeTraversor extends Object
This implementation does not use recursion, so a deep DOM does not risk blowing the stack.
Constructor | Description |
---|---|
NodeTraversor(NodeVisitor visitor) |
Create a new traversor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
traverse(Node root) |
Start a depth-first traverse of the root and all of its descendants.
|
public NodeTraversor(NodeVisitor visitor)
visitor
- a class implementing the NodeVisitor
interface, to be called when visiting each node.public void traverse(Node root)
root
- the root node point to traverse.Copyright © 2009–2018 Jonathan Hedley. All rights reserved.