-
- All Known Implementing Classes:
SqlTypeSetterVisitor
public interface Visitor<Node>A visitor is guided by aParseTreeTraverserto eachVisitorof a tree.It is intended that
visitBefore(Object, Object[])andvisitAfter(Object, Object[])are called for each node in the tree. The order of traversal is both pre- and post-order:visitBefore(Object, Object[])is called on a parent before the children are called, andvisitAfter(Object, Object[])is called after the children are called.The returned
booleanis interpreted by the caller and its meaning is not part of theVisitorcontract.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanvisitAfter(Node parent, Node[] children)Visit a place in the tree: the Node for this place in the tree, and an array ofVisitors of the immediate children, are passed as parameters.booleanvisitBefore(Node parent, Node[] children)Visit a place in the tree: the Node for this place in the tree, and an array ofVisitors of the immediate children, are passed as parameters.
-
-
-
Method Detail
-
visitBefore
boolean visitBefore(Node parent, Node[] children)
Visit a place in the tree: the Node for this place in the tree, and an array ofVisitors of the immediate children, are passed as parameters.- Parameters:
parent- - the node (value) of the parent at this point in the tree; can be updated.children- - array of the nodes of the children of this parent (can be zero-length array; must not be null).- Returns:
trueorfalse- interpreted by the caller (typically a tree traversal algorithm).
-
visitAfter
boolean visitAfter(Node parent, Node[] children)
Visit a place in the tree: the Node for this place in the tree, and an array ofVisitors of the immediate children, are passed as parameters.- Parameters:
parent- - the node (value) of the parent at this point in the tree; can be updated.children- - array of the nodes of the children of this parent (can be zero-length array; must not be null).- Returns:
trueorfalse- interpreted by the caller (typically a tree traversal algorithm).
-
-