Visitor
HasTableFunctionVisitor
class HasNodeVisitor extends java.lang.Object implements Visitor
Can find any type of node -- the class or class name of the target node is passed in as a constructor parameter.
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
hasNode |
|
private java.lang.Class<?> |
nodeClass |
|
private java.lang.Class<?> |
skipOverClass |
Constructor | Description |
---|---|
HasNodeVisitor(java.lang.Class<?> nodeClass) |
Construct a visitor
|
HasNodeVisitor(java.lang.Class<?> nodeClass,
java.lang.Class<?> skipOverClass) |
Construct a visitor
|
Modifier and Type | Method | Description |
---|---|---|
(package private) boolean |
hasNode() |
Indicate whether we found the node in
question
|
(package private) void |
reset() |
Reset the status so it can be run again.
|
boolean |
skipChildren(Visitable node) |
Don't visit children under the skipOverClass
node, if it isn't null.
|
boolean |
stopTraversal() |
Stop traversal if we found the target node
|
Visitable |
visit(Visitable node) |
If we have found the target node, we are done.
|
boolean |
visitChildrenFirst(Visitable node) |
Visit parent before children.
|
protected boolean hasNode
private java.lang.Class<?> nodeClass
private java.lang.Class<?> skipOverClass
HasNodeVisitor(java.lang.Class<?> nodeClass)
nodeClass
- the class of the node that
we are looking for.HasNodeVisitor(java.lang.Class<?> nodeClass, java.lang.Class<?> skipOverClass)
nodeClass
- the class of the node that
we are looking for.skipOverClass
- do not go below this
node when searching for nodeClass.public boolean stopTraversal()
stopTraversal
in interface Visitor
public boolean skipChildren(Visitable node)
skipChildren
in interface Visitor
node
- the node to processpublic boolean visitChildrenFirst(Visitable node)
visitChildrenFirst
in interface Visitor
node
- the top node of a sub-tree about to be visitedtrue
if node
's children should be visited
before node
, false
otherwiseboolean hasNode()
void reset()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.