- java.lang.Object
-
- com.rabbitmq.jms.parse.sql.SqlTypeSetterVisitor
-
- All Implemented Interfaces:
Visitor<com.rabbitmq.jms.parse.sql.SqlTreeNode>
public class SqlTypeSetterVisitor extends java.lang.Object implements Visitor<com.rabbitmq.jms.parse.sql.SqlTreeNode>
This visitor sets the type of the expression at a node of a tree, using the type of node and theSqlExpressionTypeof the children nodes.To type a whole tree this can be applied to it by visiting the subtrees in ‘post-order’; each node visited then has its child nodes already visited and therefore typed. In consequence, this visitor does nothing in its
Visitor.visitBefore(Object, Object[])implementation.The visitor has a (final) map state which pre-specifies the
SqlExpressionTypeof some identifiers, otherwise identifiers are of typeSqlExpressionType.ANY.
-
-
Constructor Summary
Constructors Constructor Description SqlTypeSetterVisitor()SqlTypeSetterVisitor(java.util.Map<java.lang.String,SqlExpressionType> identifierType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanvisitAfter(com.rabbitmq.jms.parse.sql.SqlTreeNode parent, com.rabbitmq.jms.parse.sql.SqlTreeNode[] 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(com.rabbitmq.jms.parse.sql.SqlTreeNode parent, com.rabbitmq.jms.parse.sql.SqlTreeNode[] 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.
-
-
-
Constructor Detail
-
SqlTypeSetterVisitor
public SqlTypeSetterVisitor(java.util.Map<java.lang.String,SqlExpressionType> identifierType)
-
SqlTypeSetterVisitor
public SqlTypeSetterVisitor()
-
-
Method Detail
-
visitBefore
public boolean visitBefore(com.rabbitmq.jms.parse.sql.SqlTreeNode parent, com.rabbitmq.jms.parse.sql.SqlTreeNode[] children)Description copied from interface:VisitorVisit 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.- Specified by:
visitBeforein interfaceVisitor<com.rabbitmq.jms.parse.sql.SqlTreeNode>- 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
public boolean visitAfter(com.rabbitmq.jms.parse.sql.SqlTreeNode parent, com.rabbitmq.jms.parse.sql.SqlTreeNode[] children)Description copied from interface:VisitorVisit 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.- Specified by:
visitAfterin interfaceVisitor<com.rabbitmq.jms.parse.sql.SqlTreeNode>- 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).
-
-