Class CollectNodesVisitor<T extends Visitable>
java.lang.Object
org.apache.derby.impl.sql.compile.CollectNodesVisitor<T>
- All Implemented Interfaces:
Visitor
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectNodesVisitor(Class<T> nodeClass) Construct a visitorCollectNodesVisitor(Class<T> nodeClass, Class<? extends Visitable> skipOverClass) Construct a visitor -
Method Summary
Modifier and TypeMethodDescriptiongetList()Return the list of matching nodes.booleanskipChildren(Visitable node) Don't visit children under the skipOverClass node, if it isn't null.booleanMethod that is called to see if query tree traversal should be stopped before visiting all nodes.If we have found the target node, we are done.booleanvisitChildrenFirst(Visitable node) Method that is called to see ifvisit()should be called on the children ofnodebefore it is called onnodeitself.
-
Field Details
-
nodeList
-
nodeClass
-
skipOverClass
-
-
Constructor Details
-
CollectNodesVisitor
-
CollectNodesVisitor
-
-
Method Details
-
visitChildrenFirst
Description copied from interface:VisitorMethod that is called to see ifvisit()should be called on the children ofnodebefore it is called onnodeitself. If this method always returnstrue, the visitor will walk the tree bottom-up. If it always returnsfalse, the tree is visited top-down.- Specified by:
visitChildrenFirstin interfaceVisitor- Parameters:
node- the top node of a sub-tree about to be visited- Returns:
trueifnode's children should be visited beforenode,falseotherwise
-
stopTraversal
public boolean stopTraversal()Description copied from interface:VisitorMethod that is called to see if query tree traversal should be stopped before visiting all nodes. Useful for short circuiting traversal if we already know we are done.- Specified by:
stopTraversalin interfaceVisitor- Returns:
- true/false
-
visit
-
skipChildren
Don't visit children under the skipOverClass node, if it isn't null.- Specified by:
skipChildrenin interfaceVisitor- Parameters:
node- the node to process- Returns:
- true/false
-
getList
-