org.codehaus.aspectwerkz.definition.expression
Class Expression

java.lang.Object
  extended byorg.codehaus.aspectwerkz.definition.expression.Expression
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExpressionExpression, LeafExpression

public abstract class Expression
extends java.lang.Object
implements java.io.Serializable

Base abstract class for the expressions.

An expression is wether an ExpressionExpression (algebra) wether a LeafExpression

Evaluates nested pointcut patterns with unlimited depth.

Uses the composite pattern.

Author:
Jonas Bonér, Alexandre Vasseur
See Also:
Serialized Form

Method Summary
abstract  java.util.Map getCflowExpressions()
          Return a Map(name->Expression) of expression involved in the IN and NOT IN sub-expression of this Expression (can be empty)
 java.lang.String getExpression()
          Returns the expression as a string.
 java.lang.String getName()
          Returns the name for the expression (if available, else null).
 ExpressionNamespace getNamespace()
          Returns the namespace for the expression.
 PointcutType getType()
          Returns the expression type.
abstract  boolean match(ClassMetaData classMetaData)
          Checks if the expression matches a certain join point.
abstract  boolean match(ClassMetaData classMetaData, MemberMetaData memberMetaData)
          Checks if the expression matches a certain join point.
abstract  boolean match(ClassMetaData classMetaData, MemberMetaData memberMetaData, java.lang.String exceptionType)
          Checks if the expression matches a certain join point.
abstract  boolean matchInOrNotIn(ClassMetaData classMetaData)
          Checks if the expression matches a certain join point as regards the IN and NOT IN parts if any.
abstract  boolean matchInOrNotIn(ClassMetaData classMetaData, MemberMetaData memberMetaData)
          Checks if the expression matches a certain join point as regards IN / NOT IN parts Each IN / NOT IN part is evaluated independantly from the boolean algebra (TF time)
 java.lang.String toString()
          Overridden toString.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Returns the name for the expression (if available, else null).

Returns:
the name

getExpression

public java.lang.String getExpression()
Returns the expression as a string.

Returns:
the expression as a string

getNamespace

public ExpressionNamespace getNamespace()
Returns the namespace for the expression.

Returns:
the namespace for the expression

getType

public PointcutType getType()
Returns the expression type.

Returns:
the expression type

match

public abstract boolean match(ClassMetaData classMetaData)
Checks if the expression matches a certain join point.

Only checks for a class match to allow early filtering.

Only does a qualified guess, does not evaluate the whole expression since doing it only on class level would give the false results.

Parameters:
classMetaData - the class meta-data
Returns:
boolean

matchInOrNotIn

public abstract boolean matchInOrNotIn(ClassMetaData classMetaData)
Checks if the expression matches a certain join point as regards the IN and NOT IN parts if any. Each IN / NOT IN part is evaluated independantly from the boolean algebra (TF time)

Only checks for a class match to allow early filtering.

Only does a qualified guess, does not evaluate the whole expression since doing it only on class level would give the false results.

Parameters:
classMetaData - the class meta-data
Returns:
boolean

match

public abstract boolean match(ClassMetaData classMetaData,
                              MemberMetaData memberMetaData)
Checks if the expression matches a certain join point.

Parameters:
classMetaData - the class meta-data
memberMetaData - the meta-data for the member
Returns:
boolean

matchInOrNotIn

public abstract boolean matchInOrNotIn(ClassMetaData classMetaData,
                                       MemberMetaData memberMetaData)
Checks if the expression matches a certain join point as regards IN / NOT IN parts Each IN / NOT IN part is evaluated independantly from the boolean algebra (TF time)

Parameters:
classMetaData - the class meta-data
memberMetaData - the meta-data for the member
Returns:
boolean

match

public abstract boolean match(ClassMetaData classMetaData,
                              MemberMetaData memberMetaData,
                              java.lang.String exceptionType)
Checks if the expression matches a certain join point.

Special case in the API which tries to match exception types as well.

Parameters:
classMetaData - the class meta-data
memberMetaData - the meta-data for the member
exceptionType - the exception type (null => match all)
Returns:
boolean

getCflowExpressions

public abstract java.util.Map getCflowExpressions()
Return a Map(name->Expression) of expression involved in the IN and NOT IN sub-expression of this Expression (can be empty)

Returns:
Map(name->Expression)

toString

public java.lang.String toString()
Overridden toString.

Returns:
the string representation of the Expression instance


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.