public 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 and Description |
|---|---|
protected boolean |
hasNode |
private java.lang.Class |
nodeClass |
private java.lang.Class |
skipOverClass |
| Constructor and 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 and Description |
|---|---|
boolean |
hasNode()
Indicate whether we found the node in
question
|
void |
reset()
Reset the status so it can be run again.
|
boolean |
skipChildren(Visitable node)
Don't visit childen 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
public HasNodeVisitor(java.lang.Class nodeClass)
nodeClass - the class of the node that
we are looking for.public 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 Visitorpublic boolean skipChildren(Visitable node)
skipChildren in interface Visitornode - the node to processpublic boolean visitChildrenFirst(Visitable node)
visitChildrenFirst in interface Visitornode - the top node of a sub-tree about to be visitedtrue if node's children should be visited
before node, false otherwisepublic boolean hasNode()
public void reset()
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.