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 | |
| private Class | |
| private Class |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| 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 |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| pack-priv void | |
| 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 | Returns: true/falseImplements org. Stop traversal if we found the target node |
| 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. Visit parent before children. |
| hasNode | back to summary |
|---|---|
| protected boolean hasNode | |
| nodeClass | back to summary |
|---|---|
| private Class<?> nodeClass | |
| skipOverClass | back to summary |
|---|---|
| private Class<?> skipOverClass | |
| HasNodeVisitor | back to summary |
|---|---|
| pack-priv HasNodeVisitor(Class<?> nodeClass) Construct a visitor
| |
| HasNodeVisitor | back to summary |
|---|---|
| pack-priv HasNodeVisitor(Class<?> nodeClass, Class<?> skipOverClass) Construct a visitor | |
| hasNode | back to summary |
|---|---|
| pack-priv boolean hasNode() Indicate whether we found the node in question
| |
| reset | back to summary |
|---|---|
| pack-priv void reset() Reset the status so it can be run again. | |
| 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. Stop traversal if we found the target node
| |
| 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. Visit parent before children.
| |