Package graphql.language
Class NodeTraverser
java.lang.Object
graphql.language.NodeTraverser
Lets you traverse a
Node tree.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondepthFirst(NodeVisitor nodeVisitor, Node root) depthFirst traversal with a enter/leave phase.depthFirst(NodeVisitor nodeVisitor, Collection<? extends Node> roots) depthFirst traversal with a enter/leave phase.static <T> ToneVisitWithResult(Node node, NodeVisitor nodeVisitor) postOrder(NodeVisitor nodeVisitor, Node root) Version ofpostOrder(NodeVisitor, Collection)with one root.postOrder(NodeVisitor nodeVisitor, Collection<? extends Node> roots) Post-Order traversal: This is a specialized version of depthFirst with only the leave phase.preOrder(NodeVisitor nodeVisitor, Node root) Version ofpreOrder(NodeVisitor, Collection)with one root.preOrder(NodeVisitor nodeVisitor, Collection<? extends Node> roots) Pre-Order traversal: This is a specialized version of depthFirst with only the enter phase.
-
Constructor Details
-
NodeTraverser
-
NodeTraverser
public NodeTraverser()
-
-
Method Details
-
depthFirst
depthFirst traversal with a enter/leave phase.- Parameters:
nodeVisitor- the visitor of the nodesroot- the root node- Returns:
- the accumulation result of this traversal
-
depthFirst
depthFirst traversal with a enter/leave phase.- Parameters:
nodeVisitor- the visitor of the nodesroots- the root nodes- Returns:
- the accumulation result of this traversal
-
preOrder
Version ofpreOrder(NodeVisitor, Collection)with one root.- Parameters:
nodeVisitor- the visitor of the nodesroot- the root node- Returns:
- the accumulation result of this traversal
-
preOrder
Pre-Order traversal: This is a specialized version of depthFirst with only the enter phase.- Parameters:
nodeVisitor- the visitor of the nodesroots- the root nodes- Returns:
- the accumulation result of this traversal
-
postOrder
Version ofpostOrder(NodeVisitor, Collection)with one root.- Parameters:
nodeVisitor- the visitor of the nodesroot- the root node- Returns:
- the accumulation result of this traversal
-
postOrder
Post-Order traversal: This is a specialized version of depthFirst with only the leave phase.- Parameters:
nodeVisitor- the visitor of the nodesroots- the root nodes- Returns:
- the accumulation result of this traversal
-
oneVisitWithResult
-