public abstract static class NodeTraversal.AbstractNodeTypePruningCallback extends Object implements NodeTraversal.Callback
| Constructor and Description |
|---|
NodeTraversal.AbstractNodeTypePruningCallback(Set<Integer> nodeTypes)
Creates an abstract pruned callback.
|
NodeTraversal.AbstractNodeTypePruningCallback(Set<Integer> nodeTypes,
boolean include)
Creates an abstract pruned callback.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent)
Visits a node in pre order (before visiting its children) and decides
whether this node's children should be traversed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisitpublic NodeTraversal.AbstractNodeTypePruningCallback(Set<Integer> nodeTypes)
nodeTypes - the nodes to include in the traversalpublic NodeTraversal.AbstractNodeTypePruningCallback(Set<Integer> nodeTypes, boolean include)
nodeTypes - the nodes to include/exclude in the traversalinclude - whether to include or exclude the nodes in the traversalpublic boolean shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
NodeTraversal.CallbackVisits a node in pre order (before visiting its children) and decides
whether this node's children should be traversed. If children are
traversed, they will be visited by
NodeTraversal.Callback.visit(NodeTraversal, Node, Node) in postorder.
Implementations can have side effects (e.g. modifying the parse tree).
shouldTraverse in interface NodeTraversal.CallbackCopyright © 2009-2014 Google. All Rights Reserved.