org.ow2.jonas.lib.ejb21.sql
Class EjbqlVariableVisitor

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.sql.EjbqlAbstractVisitor
      extended by org.ow2.jonas.lib.ejb21.sql.EjbqlVariableVisitor
All Implemented Interfaces:
EJBQLVisitor

public class EjbqlVariableVisitor
extends EjbqlAbstractVisitor

Implementation of a visitor that creates a map of pairs [name,QueryTreeField] for all defined identifiers of the query.

Author:
Christophe Ney [cney@batisseurs.com] Initial developper, Helene Joanin:

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ow2.jonas.lib.ejb21.sql.EjbqlAbstractVisitor
EjbqlAbstractVisitor.IdValue, EjbqlAbstractVisitor.VisitorException
 
Constructor Summary
EjbqlVariableVisitor(ASTEJBQL ejbql, DeploymentDescEjb2 dd, org.objectweb.medor.query.jorm.lib.QueryBuilder qb, org.objectweb.jorm.metainfo.api.Manager mgr)
          constructor
 
Method Summary
 Map getFields()
          get the Map that was built from visiting the lexical query tree This map allows to get the org.objectweb.medor.api.Field from its name (ident or path).
 void traceIds(HashMap idsM)
          Trace the given ids structure
 Object visit(ASTAbstractSchemaName node, Object data)
          Push the Node to the stack
 Object visit(ASTAggregateSelectExpression node, Object data)
          visit child nodes
 Object visit(ASTArithmeticExpression node, Object data)
          visit child nodes
 Object visit(ASTArithmeticFactor node, Object data)
          visit child nodes
 Object visit(ASTArithmeticTerm node, Object data)
          visit child nodes
 Object visit(ASTBetweenExpression node, Object data)
          visit child nodes
 Object visit(ASTBooleanExpression node, Object data)
          visit child nodes
 Object visit(ASTCmpPathExpression node, Object data)
          visit child nodes
 Object visit(ASTCollectionMemberDeclaration node, Object data)
          visit child nodes
 Object visit(ASTCollectionMemberExpression node, Object data)
          visit child nodes
 Object visit(ASTCollectionValuedPathExpression node, Object data)
          visit child nodes
 Object visit(ASTComparisonExpression node, Object data)
          visit child nodes
 Object visit(ASTConditionalExpression node, Object data)
          visit child nodes
 Object visit(ASTConditionalFactor node, Object data)
          Visit child nodes and count the number of the unary operator NOT.
 Object visit(ASTConditionalTerm node, Object data)
          visit child nodes
 Object visit(ASTDatetimeExpression node, Object data)
          visit child nodes
 Object visit(ASTEmptyCollectionComparisonExpression node, Object data)
          visit child nodes and see if it's IS EMPTY or IS NOT EMPTY
 Object visit(ASTEntityBeanExpression node, Object data)
          visit child nodes
 Object visit(ASTFromClause node, Object data)
          visit child nodes
 Object visit(ASTFunctionsReturningNumerics node, Object data)
          visit child nodes
 Object visit(ASTFunctionsReturningStrings node, Object data)
          visit child nodes
 Object visit(ASTIdentificationVariable node, Object data)
          visit child nodes
 Object visit(ASTIdentifier node, Object data)
          Store the pair identifier,Node from the Stack in HashMap
 Object visit(ASTInExpression node, Object data)
          visit child nodes
 Object visit(ASTLikeExpression node, Object data)
          visit child nodes
 Object visit(ASTNullComparisonExpression node, Object data)
          visit child nodes
 Object visit(ASTOrderByClause node, Object data)
          visit child nodes
 Object visit(ASTOrderByItem node, Object data)
          visit child nodes
 Object visit(ASTPath node, Object data)
          Push the Node to the stack
 Object visit(ASTRangeVariableDeclaration node, Object data)
          visit child nodes
 Object visit(ASTSelectClause node, Object data)
          visit child nodes
 Object visit(ASTSelectExpression node, Object data)
          visit child nodes
 Object visit(ASTSingleValuedCmrPathExpression node, Object data)
          visit child nodes
 Object visit(ASTSingleValuedPathExpression node, Object data)
          visit child nodes
 Object visit(ASTStringExpression node, Object data)
          visit child nodes
 Object visit(ASTWhereClause node, Object data)
          visit child nodes
 
Methods inherited from class org.ow2.jonas.lib.ejb21.sql.EjbqlAbstractVisitor
basePath, endsWith, mergePath, mergePath, splitPath, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EjbqlVariableVisitor

public EjbqlVariableVisitor(ASTEJBQL ejbql,
                            DeploymentDescEjb2 dd,
                            org.objectweb.medor.query.jorm.lib.QueryBuilder qb,
                            org.objectweb.jorm.metainfo.api.Manager mgr)
                     throws Exception
constructor

Parameters:
ejbql - root of the lexical tree
dd - Deployment Descriptor
qb - query builder used to navigate paths
Throws:
Exception - when error parsing
Method Detail

getFields

public Map getFields()
get the Map that was built from visiting the lexical query tree This map allows to get the org.objectweb.medor.api.Field from its name (ident or path).

Returns:
the Fields map

traceIds

public void traceIds(HashMap idsM)
Trace the given ids structure

Parameters:
idsM - identifiocators Map

visit

public Object visit(ASTFromClause node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTCollectionMemberDeclaration node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTRangeVariableDeclaration node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTCollectionValuedPathExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTAbstractSchemaName node,
                    Object data)
Push the Node to the stack

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTIdentifier node,
                    Object data)
Store the pair identifier,Node from the Stack in HashMap

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTPath node,
                    Object data)
Push the Node to the stack

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTSelectClause node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTSelectExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTAggregateSelectExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTIdentificationVariable node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTSingleValuedPathExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTSingleValuedCmrPathExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTCmpPathExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTWhereClause node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTConditionalExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTConditionalTerm node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTConditionalFactor node,
                    Object data)
Visit child nodes and count the number of the unary operator NOT.

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTBetweenExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTInExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTLikeExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTNullComparisonExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTEmptyCollectionComparisonExpression node,
                    Object data)
visit child nodes and see if it's IS EMPTY or IS NOT EMPTY

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTCollectionMemberExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTComparisonExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTArithmeticExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTArithmeticTerm node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTArithmeticFactor node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTStringExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTDatetimeExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTBooleanExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTEntityBeanExpression node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTFunctionsReturningStrings node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTFunctionsReturningNumerics node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTOrderByClause node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack

visit

public Object visit(ASTOrderByItem node,
                    Object data)
visit child nodes

Specified by:
visit in interface EJBQLVisitor
Overrides:
visit in class EjbqlAbstractVisitor
Parameters:
node - the node to visit
data - the current stack
Returns:
the stack


Copyright © 2010 OW2 Consortium. All Rights Reserved.