org.codehaus.aspectwerkz.expression
Class ExpressionInfo

java.lang.Object
  extended byorg.codehaus.aspectwerkz.expression.ExpressionInfo

public class ExpressionInfo
extends Object

Abstraction that holds info about the expression and the different visitors.
We are using a lazy initialization for m_hasCflowPointcut field to allow to fully resolve each expression (that is f.e. on IBM compiler, fields are in the reverse order, thus pointcut reference in aspect defined with annotations may not be resolved until the whole class has been parsed.

Author:
Jonas Bonér , Alexandre Vasseur

Constructor Summary
ExpressionInfo(String expression, String namespace)
          Creates a new expression info instance.
 
Method Summary
 void addArgument(String name, String className)
          Add an argument extracted from the call signature of the expression info.
 AdvisedCflowClassFilterExpressionVisitor getAdvisedCflowClassFilterExpression()
          Returns the advised cflow class filter expression.
 AdvisedClassFilterExpressionVisitor getAdvisedClassFilterExpression()
          Returns the advised class filter expression.
 ArgsIndexVisitor getArgsIndexMapper()
          Returns the regular expression.
 int getArgumentIndex(String parameterName)
          Returns the argument index.
 Set getArgumentNames()
          Returns all argument names.
 String getArgumentType(String parameterName)
          Returns the argumen type.
 CflowExpressionVisitor getCflowExpression()
          Returns the cflow expression.
 CflowExpressionVisitorRuntime getCflowExpressionRuntime()
          Returns the runtime cflow expression.
 ExpressionVisitor getExpression()
          Returns the regular expression.
 String getExpressionAsString()
          Returns the expression as string.
 String getNamespace()
          Returns the namespace
static ExpressionParser getParser()
          Returns the parser.
 boolean hasCflowPointcut()
          Checks if the expression has a cflow pointcut node.
 String toString()
          Returns the expression as string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpressionInfo

public ExpressionInfo(String expression,
                      String namespace)
Creates a new expression info instance.

Parameters:
expression - the expression
namespace - the namespace
Method Detail

getExpressionAsString

public String getExpressionAsString()
Returns the expression as string.

Returns:
the expression as string

getExpression

public ExpressionVisitor getExpression()
Returns the regular expression.

Returns:
the regular expression

getNamespace

public String getNamespace()
Returns the namespace

Returns:

getArgsIndexMapper

public ArgsIndexVisitor getArgsIndexMapper()
Returns the regular expression.

Returns:
the regular expression

getCflowExpression

public CflowExpressionVisitor getCflowExpression()
Returns the cflow expression.

Returns:
the cflow expression

getCflowExpressionRuntime

public CflowExpressionVisitorRuntime getCflowExpressionRuntime()
Returns the runtime cflow expression.

Returns:
the cflow expression

getAdvisedClassFilterExpression

public AdvisedClassFilterExpressionVisitor getAdvisedClassFilterExpression()
Returns the advised class filter expression.

Returns:
the advised class filter expression

getAdvisedCflowClassFilterExpression

public AdvisedCflowClassFilterExpressionVisitor getAdvisedCflowClassFilterExpression()
Returns the advised cflow class filter expression.

Returns:
the advised cflow class filter expression

getParser

public static ExpressionParser getParser()
Returns the parser.

Returns:
the parser

hasCflowPointcut

public boolean hasCflowPointcut()
Checks if the expression has a cflow pointcut node.

Returns:

toString

public String toString()
Returns the expression as string.

Returns:
the expression as string

addArgument

public void addArgument(String name,
                        String className)
Add an argument extracted from the call signature of the expression info. Check is made to ensure that the argument is part of an args(..) or pointcutReference(..) subexpression. TODO: support this() target()

Parameters:
name -
className -

getArgumentType

public String getArgumentType(String parameterName)
Returns the argumen type.

Parameters:
parameterName -
Returns:

getArgumentIndex

public int getArgumentIndex(String parameterName)
Returns the argument index.

Parameters:
parameterName -
Returns:

getArgumentNames

public Set getArgumentNames()
Returns all argument names.

Returns:


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.