org.objectweb.jonas_ejb.lib
Class EjbqlAbstractVisitor

java.lang.Object
  extended byorg.objectweb.jonas_ejb.lib.EjbqlAbstractVisitor
All Implemented Interfaces:
EJBQLVisitor
Direct Known Subclasses:
EjbqlOrderByVisitor, EjbqlQueryFilterVisitor, EjbqlSelectVisitor, EjbqlVariableVisitor

public class EjbqlAbstractVisitor
extends java.lang.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] contributor(s): - 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  java.lang.String[] basePath(java.lang.String[] path)
          merge the first tokens into a dot separated path.
protected  boolean endsWith(java.lang.String[] path, java.lang.String suffix)
          return true if the last token of the path is equal to the suffix.
protected  java.lang.String mergePath(java.lang.String[] path)
          merge tokens into a dot separated path
protected  java.lang.String mergePath(java.lang.String[] path, int begin, int length)
          merge tokens (from the begin index to the (begin+length) index into a dot separated path
protected  java.lang.String[] splitPath(java.lang.String path)
          split a dot separated path into tokens
 java.lang.Object visit(ASTAbstractSchemaName node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTAggregateSelectExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTArithmeticExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTArithmeticFactor node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTArithmeticLiteral node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTArithmeticTerm node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTBetweenExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTBooleanExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTBooleanLiteral node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTCmpPathExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTCollectionMemberDeclaration node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTCollectionMemberExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTCollectionValuedPathExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTComparisonExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTConditionalExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTConditionalFactor node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTConditionalTerm node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTDatetimeExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTEJBQL node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTEmptyCollectionComparisonExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTEntityBeanExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTFromClause node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTFunctionsReturningNumerics node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTFunctionsReturningStrings node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTIdentificationVariable node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTIdentifier node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTInExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTInputParameter node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTLikeExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTLiteral node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTNullComparisonExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTOrderByClause node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTOrderByItem node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTPath node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTRangeVariableDeclaration node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTSelectClause node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTSelectExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTSingleValuedCmrPathExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTSingleValuedPathExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTStringExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTStringLiteral node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTWhereClause node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(SimpleNode node)
          Visit method to call from constructor.
 java.lang.Object visit(SimpleNode node, java.lang.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 java.lang.String[] splitPath(java.lang.String path)
split a dot separated path into tokens


mergePath

protected java.lang.String mergePath(java.lang.String[] path,
                                     int begin,
                                     int length)
merge tokens (from the begin index to the (begin+length) index into a dot separated path


mergePath

protected java.lang.String mergePath(java.lang.String[] path)
merge tokens into a dot separated path


endsWith

protected boolean endsWith(java.lang.String[] path,
                           java.lang.String suffix)
return true if the last token of the path is equal to the suffix.


basePath

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


visit

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

Throws:
java.lang.Exception - any nested exception thrown from other visit method

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor

visit

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

Specified by:
visit in interface EJBQLVisitor