| org.apache.derby.iapi.sql.compile.Visitor
All known Subclasses: org.apache.derby.impl.sql.compile.VTIDeferModPolicy, org.apache.derby.impl.sql.compile.CollectNodesVisitor, org.apache.derby.impl.sql.compile.BaseTableNumbersVisitor, org.apache.derby.impl.sql.compile.SubstituteExpressionVisitor, org.apache.derby.impl.sql.compile.VerifyAggregateExpressionsVisitor, org.apache.derby.impl.sql.compile.HasCorrelatedCRsVisitor, org.apache.derby.impl.sql.compile.RemapCRsVisitor, org.apache.derby.impl.sql.compile.ReferencedTablesVisitor, org.apache.derby.impl.sql.compile.ReplaceAggregatesWithCRVisitor, org.apache.derby.impl.sql.compile.HasVariantValueNodeVisitor, org.apache.derby.impl.sql.compile.HasNodeVisitor,
Visitor | public interface Visitor (Code) | | A visitor is an object that traverses the querytree
and performs some action.
author: jamie |
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. |
skipChildren | boolean skipChildren(Visitable node) throws StandardException(Code) | | Method that is called to indicate whether
we should skip all nodes below this node
for traversal. Useful if we want to effectively
ignore/prune all branches under a particular
node.
Differs from stopTraversal() in that it
only affects subtrees, rather than the
entire traversal.
Parameters: node - the node to process true/false |
stopTraversal | boolean stopTraversal()(Code) | | Method 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.
true/false |
visit | Visitable visit(Visitable node) throws StandardException(Code) | | This is the default visit operation on a
QueryTreeNode. It just returns the node. This
will typically suffice as the default visit
operation for most visitors unless the visitor
needs to count the number of nodes visited or
something like that.
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.
Parameters: node - the node to process a query tree node. Often times this isthe same node that was passed in, but Visitors thatreplace nodes with other nodes will use this toreturn the new replacement node. exception: StandardException - may be throw an erroras needed by the visitor (i.e. may be a normal errorif a particular node is found, e.g. if checking a group by, we don't expect to find any ColumnReferencesthat aren't under an AggregateNode -- the easiestthing to do is just throw an error when we find thequestionable node). |
|
|