org.aspectj.weaver.internal.tools
Class PointcutExpressionImpl

java.lang.Object
  extended by org.aspectj.weaver.internal.tools.PointcutExpressionImpl
All Implemented Interfaces:
PointcutExpression

public class PointcutExpressionImpl
extends java.lang.Object
implements PointcutExpression

Map from weaver.tools interface to internal Pointcut implementation...


Nested Class Summary
static class PointcutExpressionImpl.Handler
           
 
Constructor Summary
PointcutExpressionImpl(Pointcut pointcut, java.lang.String expression, PointcutParameter[] params, World inWorld)
           
 
Method Summary
 boolean couldMatchJoinPointsInType(java.lang.Class aClass)
          Determine whether or not this pointcut could ever match a join point in the given class.
 java.lang.String getPointcutExpression()
          Return a string representation of this pointcut expression.
 Pointcut getUnderlyingPointcut()
           
 ShadowMatch matchesAdviceExecution(java.lang.reflect.Method aMethod)
          Determine whether or not this pointcut matches the execution of a given piece of advice.
 ShadowMatch matchesConstructorCall(java.lang.reflect.Constructor aConstructor, java.lang.Class callerType)
          Determine whether or not this pointcut matches a method call to the given constructor, made outside of the scope of any method or constructor, but within the callerType.
 ShadowMatch matchesConstructorCall(java.lang.reflect.Constructor aConstructor, java.lang.reflect.Member withinCode)
          Determine whether or not this pointcut matches a method call to the given constructor, made during the execution of the given method or constructor.
 ShadowMatch matchesConstructorExecution(java.lang.reflect.Constructor aConstructor)
          Determine whether or not this pointcut matches the execution of a given constructor.
 ShadowMatch matchesFieldGet(java.lang.reflect.Field aField, java.lang.Class withinType)
          Determine whether or not this pointcut matches a get of the given field outside of the scope of any method or constructor, but within the given type (for example, during static initialization).
 ShadowMatch matchesFieldGet(java.lang.reflect.Field aField, java.lang.reflect.Member withinCode)
          Determine whether or not this pointcut matches a get of the given field from within the given method or constructor.
 ShadowMatch matchesFieldSet(java.lang.reflect.Field aField, java.lang.Class withinType)
          Determine whether or not this pointcut matches a set of the given field outside of the scope of any method or constructor, but within the given type (for example, during static initialization).
 ShadowMatch matchesFieldSet(java.lang.reflect.Field aField, java.lang.reflect.Member withinCode)
          Determine whether or not this pointcut matches a set of the given field from within the given method or constructor.
 ShadowMatch matchesHandler(java.lang.Class exceptionType, java.lang.Class handlingType)
          Determine whether or not this pointcut matches the execution of a given exception handler outside of the scope of any method or constructor, but within the handling type.
 ShadowMatch matchesHandler(java.lang.Class exceptionType, java.lang.reflect.Member withinCode)
          Determine whether or not this pointcut matches the execution of a given exception handler within the given method or constructor
 ShadowMatch matchesInitialization(java.lang.reflect.Constructor aConstructor)
          Determine whether or not this pointcut matches the initialization of an object initiated by a call to the given constructor.
 ShadowMatch matchesMethodCall(java.lang.reflect.Method aMethod, java.lang.Class callerType)
          Determine whether or not this pointcut matches a method call to the given method, made outside of the scope of any method or constructor, but within the callerType (for example, during static initialization of the type).
 ShadowMatch matchesMethodCall(java.lang.reflect.Method aMethod, java.lang.reflect.Member withinCode)
          Determine whether or not this pointcut matches a method call to the given method, made during the execution of the given method or constructor.
 ShadowMatch matchesMethodExecution(java.lang.reflect.Method aMethod)
          Determine whether or not this pointcut matches the execution of a given method.
 ShadowMatch matchesPreInitialization(java.lang.reflect.Constructor aConstructor)
          Determine whether or not this pointcut matches the pre-initialization of an object initiated by a call to the given constructor.
 ShadowMatch matchesStaticInitialization(java.lang.Class aClass)
          Determine whether or not this pointcut matches the static initialization of the given class.
 boolean mayNeedDynamicTest()
          Returns true iff this pointcut contains any expression that might necessitate a dynamic test at some join point (e.g.
 void setMatchingContext(MatchingContext aMatchContext)
          Set the matching context to be used for subsequent calls to match.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointcutExpressionImpl

public PointcutExpressionImpl(Pointcut pointcut,
                              java.lang.String expression,
                              PointcutParameter[] params,
                              World inWorld)
Method Detail

getUnderlyingPointcut

public Pointcut getUnderlyingPointcut()

setMatchingContext

public void setMatchingContext(MatchingContext aMatchContext)
Description copied from interface: PointcutExpression
Set the matching context to be used for subsequent calls to match.

Specified by:
setMatchingContext in interface PointcutExpression
See Also:
MatchingContext

couldMatchJoinPointsInType

public boolean couldMatchJoinPointsInType(java.lang.Class aClass)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut could ever match a join point in the given class.

Specified by:
couldMatchJoinPointsInType in interface PointcutExpression
Parameters:
aClass - the candidate class
Returns:
true iff this pointcut may match a join point within(aClass), and false otherwise

mayNeedDynamicTest

public boolean mayNeedDynamicTest()
Description copied from interface: PointcutExpression
Returns true iff this pointcut contains any expression that might necessitate a dynamic test at some join point (e.g. args)

Specified by:
mayNeedDynamicTest in interface PointcutExpression

matchesMethodExecution

public ShadowMatch matchesMethodExecution(java.lang.reflect.Method aMethod)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the execution of a given method.

Specified by:
matchesMethodExecution in interface PointcutExpression
Parameters:
aMethod - the method being executed
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the method.

matchesConstructorExecution

public ShadowMatch matchesConstructorExecution(java.lang.reflect.Constructor aConstructor)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the execution of a given constructor.

Specified by:
matchesConstructorExecution in interface PointcutExpression
Parameters:
aConstructor - the constructor being executed
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the constructor.

matchesStaticInitialization

public ShadowMatch matchesStaticInitialization(java.lang.Class aClass)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the static initialization of the given class.

Specified by:
matchesStaticInitialization in interface PointcutExpression
Parameters:
aClass - the class being statically initialized
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matchs join points representing the static initialization of the given type

matchesAdviceExecution

public ShadowMatch matchesAdviceExecution(java.lang.reflect.Method aMethod)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the execution of a given piece of advice.

Specified by:
matchesAdviceExecution in interface PointcutExpression
Parameters:
aMethod - a method representing the advice being executed
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the advice.

matchesInitialization

public ShadowMatch matchesInitialization(java.lang.reflect.Constructor aConstructor)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the initialization of an object initiated by a call to the given constructor.

Specified by:
matchesInitialization in interface PointcutExpression
Parameters:
aConstructor - the constructor initiating the initialization
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing initialization via the given constructor.

matchesPreInitialization

public ShadowMatch matchesPreInitialization(java.lang.reflect.Constructor aConstructor)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the pre-initialization of an object initiated by a call to the given constructor.

Specified by:
matchesPreInitialization in interface PointcutExpression
Parameters:
aConstructor - the constructor initiating the initialization
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing pre-initialization via the given constructor.

matchesMethodCall

public ShadowMatch matchesMethodCall(java.lang.reflect.Method aMethod,
                                     java.lang.reflect.Member withinCode)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a method call to the given method, made during the execution of the given method or constructor.

Specified by:
matchesMethodCall in interface PointcutExpression
Parameters:
aMethod - the method being called
withinCode - the Method or Constructor from within which the call is made
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing a call to this method during the execution of the given member.

matchesMethodCall

public ShadowMatch matchesMethodCall(java.lang.reflect.Method aMethod,
                                     java.lang.Class callerType)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a method call to the given method, made outside of the scope of any method or constructor, but within the callerType (for example, during static initialization of the type).

Specified by:
matchesMethodCall in interface PointcutExpression
Parameters:
aMethod - the method being called
callerType - the declared type of the caller
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing a call to this method during the execution of the given member.

matchesConstructorCall

public ShadowMatch matchesConstructorCall(java.lang.reflect.Constructor aConstructor,
                                          java.lang.Class callerType)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a method call to the given constructor, made outside of the scope of any method or constructor, but within the callerType.

Specified by:
matchesConstructorCall in interface PointcutExpression
Parameters:
aConstructor - the cosstructor being called
callerType - the declared type of the caller
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing a call to this constructor during the execution of the given member.

matchesConstructorCall

public ShadowMatch matchesConstructorCall(java.lang.reflect.Constructor aConstructor,
                                          java.lang.reflect.Member withinCode)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a method call to the given constructor, made during the execution of the given method or constructor.

Specified by:
matchesConstructorCall in interface PointcutExpression
Parameters:
aConstructor - the constructor being called
withinCode - the Method or Constructor from within which the call is made
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing a call to this constructor during the execution of the given member.

matchesHandler

public ShadowMatch matchesHandler(java.lang.Class exceptionType,
                                  java.lang.Class handlingType)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the execution of a given exception handler outside of the scope of any method or constructor, but within the handling type.

Specified by:
matchesHandler in interface PointcutExpression
Parameters:
exceptionType - the static type of the exception being handled
handlingType - the type in which the handler block is executing
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the handling of the given exception

matchesHandler

public ShadowMatch matchesHandler(java.lang.Class exceptionType,
                                  java.lang.reflect.Member withinCode)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches the execution of a given exception handler within the given method or constructor

Specified by:
matchesHandler in interface PointcutExpression
Parameters:
exceptionType - the static type of the exception being handled
withinCode - the method or constructor in which the catch block is declared
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the handling of the given exception

matchesFieldGet

public ShadowMatch matchesFieldGet(java.lang.reflect.Field aField,
                                   java.lang.Class withinType)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a get of the given field outside of the scope of any method or constructor, but within the given type (for example, during static initialization).

Specified by:
matchesFieldGet in interface PointcutExpression
Parameters:
aField - the field being accessed
withinType - the type owning the call site
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field get join points for the given field and call site.

matchesFieldGet

public ShadowMatch matchesFieldGet(java.lang.reflect.Field aField,
                                   java.lang.reflect.Member withinCode)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a get of the given field from within the given method or constructor.

Specified by:
matchesFieldGet in interface PointcutExpression
Parameters:
aField - the field being updated
withinCode - the Method or Constructor owning the call site
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field get join points for the given field and call site.

matchesFieldSet

public ShadowMatch matchesFieldSet(java.lang.reflect.Field aField,
                                   java.lang.Class withinType)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a set of the given field outside of the scope of any method or constructor, but within the given type (for example, during static initialization).

Specified by:
matchesFieldSet in interface PointcutExpression
Parameters:
aField - the field being updated
withinType - the type owning the call site
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field set join points for the given field and call site.

matchesFieldSet

public ShadowMatch matchesFieldSet(java.lang.reflect.Field aField,
                                   java.lang.reflect.Member withinCode)
Description copied from interface: PointcutExpression
Determine whether or not this pointcut matches a set of the given field from within the given method or constructor.

Specified by:
matchesFieldSet in interface PointcutExpression
Parameters:
aField - the field being updated
withinCode - the Method or Constructor owning the call site
Returns:
a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field set join points for the given field and call site.

getPointcutExpression

public java.lang.String getPointcutExpression()
Description copied from interface: PointcutExpression
Return a string representation of this pointcut expression.

Specified by:
getPointcutExpression in interface PointcutExpression