|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A visitor is an object that traverses the querytree and performs some action.
Method Summary | |
boolean |
skipChildren(Visitable node)
Method that is called to indicate whether we should skip all nodes below this node for traversal. |
boolean |
stopTraversal()
Method that is called to see if query tree traversal should be stopped before visiting all nodes. |
Visitable |
visit(Visitable node)
This is the default visit operation on a QueryTreeNode. |
Method Detail |
public Visitable visit(Visitable node) throws StandardException
Visitors will overload this method by implementing a version with a signature that matches a specific type of node. For example, if I want to do something special with aggregate nodes, then that Visitor will implement a visit(AggregateNode node) method which does the aggregate specific processing.
node
- the node to process
StandardException
- may be throw an error
as needed by the visitor (i.e. may be a normal error
if a particular node is found, e.g. if checking
a group by, we don't expect to find any ColumnReferences
that aren't under an AggregateNode -- the easiest
thing to do is just throw an error when we find the
questionable node).public boolean stopTraversal()
public boolean skipChildren(Visitable node)
Differs from stopTraversal() in that it only affects subtrees, rather than the entire traversal.
node
- the node to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |