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

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.sql.EjbqlAbstractVisitor
All Implemented Interfaces:
EJBQLVisitor
Direct Known Subclasses:
EjbqlLimitVisitor, EjbqlOrderByVisitor, EjbqlQueryFilterVisitor, EjbqlSelectVisitor, EjbqlVariableVisitor

public class EjbqlAbstractVisitor
extends Object
implements EJBQLVisitor

Base class with visitor utility class and default implementation of visit methods Created on Sep 12, 2002

Author:
Christophe Ney [cney@batisseurs.com]: Initial developer, Helene Joanin: Add the toString() method to IdValue., Helene Joanin: Add some utility methods as endsWith(), basePath()., Helene Joanin: Take into account the ORDER BY clause., Helene Joanin: Take into account the EJBQL version 2.1 syntax.

Nested Class Summary
protected  class EjbqlAbstractVisitor.IdValue
          Values associated with each declared identifiers
protected  class EjbqlAbstractVisitor.VisitorException
          Runtime Exception used to wrap exceptions thrown in visit methods
 
Constructor Summary
EjbqlAbstractVisitor()
           
 
Method Summary
protected  String[] basePath(String[] path)
          merge the first tokens into a dot separated path.
protected  boolean endsWith(String[] path, String suffix)
           
protected  String mergePath(String[] path)
           
protected  String mergePath(String[] path, int begin, int length)
           
protected  String[] splitPath(String path)
          split a dot separated path into tokens
 Object visit(ASTAbstractSchemaName node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTAggregateSelectExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTArithmeticExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTArithmeticFactor node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTArithmeticLiteral node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTArithmeticTerm node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTBetweenExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTBooleanExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTBooleanLiteral node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTCmpPathExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTCollectionMemberDeclaration node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTCollectionMemberExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTCollectionValuedPathExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTComparisonExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTConditionalExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTConditionalFactor node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTConditionalTerm node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTDatetimeExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTEJBQL node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTEmptyCollectionComparisonExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTEntityBeanExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTFloatingPointLiteral node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTFromClause node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTFunctionsReturningNumerics node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTFunctionsReturningStrings node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTIdentificationVariable node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTIdentifier node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTInExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTInputParameter node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTIntegerLiteral node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTLikeExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTLimitClause node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTLimitExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTLiteral node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTNullComparisonExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTOrderByClause node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTOrderByItem node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTPath node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTRangeVariableDeclaration node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTSelectClause node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTSelectExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTSingleValuedCmrPathExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTSingleValuedPathExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTStringExpression node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTStringLiteral node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(ASTWhereClause node, Object data)
          null implementation of the visit method for the corresponding parameter type
 Object visit(SimpleNode node)
          Visit method to call from constructor.
 Object visit(SimpleNode node, Object data)
          Generic visit method that traverses all child nodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EjbqlAbstractVisitor

public EjbqlAbstractVisitor()
Method Detail

splitPath

protected String[] splitPath(String path)
split a dot separated path into tokens

Parameters:
path - the input path
Returns:
the splitted path

mergePath

protected String mergePath(String[] path,
                           int begin,
                           int length)
Parameters:
path - the input path
begin - the beginning index
length - the length
Returns:
the merge of the tokens (from the begin index to the (begin+length) index into a dot separated path

mergePath

protected String mergePath(String[] path)
Parameters:
path - the input path
Returns:
the merge tokens into a dot separated path

endsWith

protected boolean endsWith(String[] path,
                           String suffix)
Parameters:
path - the input path
suffix - the input suffix
Returns:
true if the last token of the path is equal to the suffix.

basePath

protected String[] basePath(String[] path)
merge the first tokens into a dot separated path. (The last token is left)

Parameters:
path - the input path
Returns:
the base path

visit

public Object visit(SimpleNode node)
             throws Exception
Visit method to call from constructor. Child node visitors get a java.util.Stack as data parameter.

Parameters:
node - the node to visit
Returns:
the stack
Throws:
Exception - any nested exception thrown from other visit method

visit

public Object visit(SimpleNode node,
                    Object data)
Generic visit method that traverses all child nodes

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

visit

public Object visit(ASTEJBQL node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTFromClause node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTCollectionMemberDeclaration node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTRangeVariableDeclaration node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTSingleValuedPathExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTCmpPathExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTSingleValuedCmrPathExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTCollectionValuedPathExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTSelectClause node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTSelectExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTAggregateSelectExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTOrderByClause node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTOrderByItem node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTLimitClause node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTLimitExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTWhereClause node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTConditionalExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTConditionalTerm node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTConditionalFactor node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTBetweenExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTInExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTLikeExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTNullComparisonExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTEmptyCollectionComparisonExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTCollectionMemberExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTComparisonExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTArithmeticExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTIntegerLiteral node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTFloatingPointLiteral node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTArithmeticTerm node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTArithmeticFactor node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTStringExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTDatetimeExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTBooleanExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTEntityBeanExpression node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTFunctionsReturningStrings node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTFunctionsReturningNumerics node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTAbstractSchemaName node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTIdentificationVariable node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTIdentifier node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTPath node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTLiteral node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTStringLiteral node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTArithmeticLiteral node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTBooleanLiteral node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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

visit

public Object visit(ASTInputParameter node,
                    Object data)
null implementation of the visit method for the corresponding parameter type

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


Copyright © 2010 OW2 Consortium. All Rights Reserved.