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 |
|---|---|
| private final Class | |
| private final List | |
| private final Class |
| Access | Constructor and Description |
|---|---|
| public | CollectNodesVisitor(Class<T>
the class of the node that
we are looking for. nodeClass)Construct a visitor |
| public | CollectNodesVisitor(Class<T>
the class of the node that
we are looking for. nodeClass, Class<? extends Visitable> do not go below this
node when searching for nodeClass. skipOverClass)Construct a visitor |
| Modifier and Type | Method and Description |
|---|---|
| public List | |
| public boolean | Returns: true/falsethe node to process node)Implements org. Don't visit children under the skipOverClass node, if it isn't null. |
| public boolean | stopTraversal()
Implements org. Method that is called to see if query tree traversal should be stopped before visiting all nodes. |
| public Visitable | Returns: methe node to process node)Implements org. 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. Method that is called to see if |
| nodeClass | back to summary |
|---|---|
| private final Class<T> nodeClass | |
| nodeList | back to summary |
|---|---|
| private final List<T> nodeList | |
| skipOverClass | back to summary |
|---|---|
| private final Class<? extends Visitable> skipOverClass | |
| CollectNodesVisitor | back to summary |
|---|---|
| public CollectNodesVisitor(Class<T> nodeClass) Construct a visitor
| |
| CollectNodesVisitor | back to summary |
|---|---|
| public CollectNodesVisitor(Class<T> nodeClass, Class<? extends Visitable> skipOverClass) Construct a visitor | |
| getList | back to summary |
|---|---|
| public List Return the list of matching nodes.
The returned list may be empty, if there are no matching nodes. It
is never | |
| skipChildren | back to summary |
|---|---|
| public boolean skipChildren(Visitable node) Implements org. Don't visit children under the skipOverClass node, if it isn't null.
| |
| stopTraversal | back to summary |
|---|---|
| public boolean stopTraversal() Implements org. Doc from org. 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.
| |
| visit | back to summary |
|---|---|
| public Visitable visit(Visitable node) Implements org. If we have found the target node, we are done. | |
| visitChildrenFirst | back to summary |
|---|---|
| public boolean visitChildrenFirst(Visitable node) Implements org. Doc from org. Method that is called to see if
| |