Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class HasNodeVisitor

extends Object
implements Visitor
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.compile.Visitor
Known Direct Subclasses
org.apache.derby.impl.sql.compile.HasTableFunctionVisitor
Imports
org.apache.derby.iapi.sql.compile.Visitable, .Visitor

Find out if we have a particular node anywhere in the tree. Stop traversal as soon as we find one.

Can find any type of node -- the class or class name of the target node is passed in as a constructor parameter.

Field Summary

Modifier and TypeField and Description
protected boolean
private Class<?>
private Class<?>

Constructor Summary

AccessConstructor and Description
pack-priv
HasNodeVisitor(Class<?>
the class of the node that we are looking for.
nodeClass
)

Construct a visitor

pack-priv
HasNodeVisitor(Class<?>
the class of the node that we are looking for.
nodeClass
,
Class<?>
do not go below this node when searching for nodeClass.
skipOverClass
)

Construct a visitor

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean

Returns:

true/false
hasNode
()

Indicate whether we found the node in question

pack-priv void
reset()

Reset the status so it can be run again.

public boolean

Returns:

true/false
skipChildren
(Visitable
the node to process
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

Don't visit children under the skipOverClass node, if it isn't null.

public boolean

Returns:

true/false
stopTraversal
()

Implements org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Stop traversal if we found the target node

public Visitable

Returns:

me
visit
(Visitable
the node to process
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.visit.

If we have found the target node, we are done.

public boolean
visitChildrenFirst(Visitable
the top node of a sub-tree about to be visited
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Visit parent before children.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hasNodeback to summary
protected boolean hasNode
nodeClassback to summary
private Class<?> nodeClass
skipOverClassback to summary
private Class<?> skipOverClass

Constructor Detail

HasNodeVisitorback to summary
pack-priv HasNodeVisitor(Class<?> nodeClass)

Construct a visitor

Parameters
nodeClass:Class<?>

the class of the node that we are looking for.

HasNodeVisitorback to summary
pack-priv HasNodeVisitor(Class<?> nodeClass, Class<?> skipOverClass)

Construct a visitor

Parameters
nodeClass:Class<?>

the class of the node that we are looking for.

skipOverClass:Class<?>

do not go below this node when searching for nodeClass.

Method Detail

hasNodeback to summary
pack-priv boolean hasNode()

Indicate whether we found the node in question

Returns:boolean

true/false

resetback to summary
pack-priv void reset()

Reset the status so it can be run again.

skipChildrenback to summary
public boolean skipChildren(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

Don't visit children under the skipOverClass node, if it isn't null.

Parameters
node:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

the node to process

Returns:boolean

true/false

stopTraversalback to summary
public boolean stopTraversal()

Implements org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Stop traversal if we found the target node

Returns:boolean

true/false

visitback to summary
public Visitable visit(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.visit.

If we have found the target node, we are done.

Parameters
node:Visitable

the node to process

Returns:Visitable

me

visitChildrenFirstback to summary
public boolean visitChildrenFirst(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Visit parent before children.

Parameters
node:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

the top node of a sub-tree about to be visited

Returns:boolean

Doc from org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

true if node's children should be visited before node, false otherwise