Top Description Methods
org.aspectj.weaver.tools

public Interface PointcutExpression

Known Direct Implementers
org.aspectj.weaver.internal.tools.PointcutExpressionImpl
Imports
java.lang.reflect.Constructor, .Field, .Member, .Method

Represents an AspectJ pointcut expression and provides convenience methods to determine whether or not the pointcut matches join points specified in terms of the java.lang.reflect interfaces.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true iff this pointcut may match a join point within(aClass), and false otherwise
couldMatchJoinPointsInType
(Class<T>
the candidate class
aClass
)

Determine whether or not this pointcut could ever match a join point in the given class.

public String
getPointcutExpression()

Return a string representation of this pointcut expression.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the advice.
matchesAdviceExecution
(Method
a method representing the advice being executed
anAdviceMethod
)

Determine whether or not this pointcut matches the execution of a given piece of advice.

public ShadowMatch

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
(Constructor<T>
the constructor being called
aConstructor
,
Member
the Method or Constructor from within which the call is made
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.

public ShadowMatch

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
(Constructor<T>
the cosstructor being called
aConstructor
,
Class<T>
the declared type of the caller
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.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the constructor.
matchesConstructorExecution
(Constructor<T>
the constructor being executed
aConstructor
)

Determine whether or not this pointcut matches the execution of a given constructor.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field get join points for the given field and call site.
matchesFieldGet
(Field
the field being updated
aField
,
Member
the Method or Constructor owning the call site
withinCode
)

Determine whether or not this pointcut matches a get of the given field from within the given method or constructor.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field get join points for the given field and call site.
matchesFieldGet
(Field
the field being accessed
aField
,
Class<T>
the type owning the call site
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).

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field set join points for the given field and call site.
matchesFieldSet
(Field
the field being updated
aField
,
Member
the Method or Constructor owning the call site
withinCode
)

Determine whether or not this pointcut matches a set of the given field from within the given method or constructor.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field set join points for the given field and call site.
matchesFieldSet
(Field
the field being updated
aField
,
Class<T>
the type owning the call site
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).

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the handling of the given exception
matchesHandler
(Class<T>
the static type of the exception being handled
exceptionType
,
Member
the method or constructor in which the catch block is declared
withinCode
)

Determine whether or not this pointcut matches the execution of a given exception handler within the given method or constructor

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the handling of the given exception
matchesHandler
(Class<T>
the static type of the exception being handled
exceptionType
,
Class<T>
the type in which the handler block is executing
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.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing initialization via the given constructor.
matchesInitialization
(Constructor<T>
the constructor initiating the initialization
aConstructor
)

Determine whether or not this pointcut matches the initialization of an object initiated by a call to the given constructor.

public ShadowMatch

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
(Method
the method being called
aMethod
,
Member
the Method or Constructor from within which the call is made
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.

public ShadowMatch

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
(Method
the method being called
aMethod
,
Class<T>
the declared type of the caller
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).

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the method.
matchesMethodExecution
(Method
the method being executed
aMethod
)

Determine whether or not this pointcut matches the execution of a given method.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing pre-initialization via the given constructor.
matchesPreInitialization
(Constructor<T>
the constructor initiating the initialization
aConstructor
)

Determine whether or not this pointcut matches the pre-initialization of an object initiated by a call to the given constructor.

public ShadowMatch

Returns:

a ShadowMatch indicating whether the pointcut always, sometimes, or never matchs join points representing the static initialization of the given type
matchesStaticInitialization
(Class<T>
the class being statically initialized
aClass
)

Determine whether or not this pointcut matches the static initialization of the given class.

public boolean
mayNeedDynamicTest()

Returns true iff this pointcut contains any expression that might necessitate a dynamic test at some join point (e.g. args)

public void
setMatchingContext(MatchingContext aMatchContext)

Set the matching context to be used for subsequent calls to match.

Method Detail

couldMatchJoinPointsInTypeback to summary
public boolean couldMatchJoinPointsInType(Class<T> aClass)

Determine whether or not this pointcut could ever match a join point in the given class.

Parameters
aClass:Class<T>

the candidate class

Returns:boolean

true iff this pointcut may match a join point within(aClass), and false otherwise

getPointcutExpressionback to summary
public String getPointcutExpression()

Return a string representation of this pointcut expression.

matchesAdviceExecutionback to summary
public ShadowMatch matchesAdviceExecution(Method anAdviceMethod)

Determine whether or not this pointcut matches the execution of a given piece of advice.

Parameters
anAdviceMethod:Method

a method representing the advice being executed

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the advice.

matchesConstructorCallback to summary
public ShadowMatch matchesConstructorCall(Constructor<T> aConstructor, 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.

Parameters
aConstructor:Constructor<T>

the constructor being called

withinCode:Member

the Method or Constructor from within which the call is made

Returns:ShadowMatch

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.

matchesConstructorCallback to summary
public ShadowMatch matchesConstructorCall(Constructor<T> aConstructor, Class<T> 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.

Parameters
aConstructor:Constructor<T>

the cosstructor being called

callerType:Class<T>

the declared type of the caller

Returns:ShadowMatch

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.

matchesConstructorExecutionback to summary
public ShadowMatch matchesConstructorExecution(Constructor<T> aConstructor)

Determine whether or not this pointcut matches the execution of a given constructor.

Parameters
aConstructor:Constructor<T>

the constructor being executed

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the constructor.

matchesFieldGetback to summary
public ShadowMatch matchesFieldGet(Field aField, Member withinCode)

Determine whether or not this pointcut matches a get of the given field from within the given method or constructor.

Parameters
aField:Field

the field being updated

withinCode:Member

the Method or Constructor owning the call site

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field get join points for the given field and call site.

matchesFieldGetback to summary
public ShadowMatch matchesFieldGet(Field aField, Class<T> 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).

Parameters
aField:Field

the field being accessed

withinType:Class<T>

the type owning the call site

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field get join points for the given field and call site.

matchesFieldSetback to summary
public ShadowMatch matchesFieldSet(Field aField, Member withinCode)

Determine whether or not this pointcut matches a set of the given field from within the given method or constructor.

Parameters
aField:Field

the field being updated

withinCode:Member

the Method or Constructor owning the call site

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field set join points for the given field and call site.

matchesFieldSetback to summary
public ShadowMatch matchesFieldSet(Field aField, Class<T> 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).

Parameters
aField:Field

the field being updated

withinType:Class<T>

the type owning the call site

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches field set join points for the given field and call site.

matchesHandlerback to summary
public ShadowMatch matchesHandler(Class<T> exceptionType, Member withinCode)

Determine whether or not this pointcut matches the execution of a given exception handler within the given method or constructor

Parameters
exceptionType:Class<T>

the static type of the exception being handled

withinCode:Member

the method or constructor in which the catch block is declared

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the handling of the given exception

matchesHandlerback to summary
public ShadowMatch matchesHandler(Class<T> exceptionType, Class<T> 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.

Parameters
exceptionType:Class<T>

the static type of the exception being handled

handlingType:Class<T>

the type in which the handler block is executing

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the handling of the given exception

matchesInitializationback to summary
public ShadowMatch matchesInitialization(Constructor<T> aConstructor)

Determine whether or not this pointcut matches the initialization of an object initiated by a call to the given constructor.

Parameters
aConstructor:Constructor<T>

the constructor initiating the initialization

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing initialization via the given constructor.

matchesMethodCallback to summary
public ShadowMatch matchesMethodCall(Method aMethod, 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.

Parameters
aMethod:Method

the method being called

withinCode:Member

the Method or Constructor from within which the call is made

Returns:ShadowMatch

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.

matchesMethodCallback to summary
public ShadowMatch matchesMethodCall(Method aMethod, Class<T> 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).

Parameters
aMethod:Method

the method being called

callerType:Class<T>

the declared type of the caller

Returns:ShadowMatch

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.

matchesMethodExecutionback to summary
public ShadowMatch matchesMethodExecution(Method aMethod)

Determine whether or not this pointcut matches the execution of a given method.

Parameters
aMethod:Method

the method being executed

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing the execution of the method.

matchesPreInitializationback to summary
public ShadowMatch matchesPreInitialization(Constructor<T> aConstructor)

Determine whether or not this pointcut matches the pre-initialization of an object initiated by a call to the given constructor.

Parameters
aConstructor:Constructor<T>

the constructor initiating the initialization

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matches join points representing pre-initialization via the given constructor.

matchesStaticInitializationback to summary
public ShadowMatch matchesStaticInitialization(Class<T> aClass)

Determine whether or not this pointcut matches the static initialization of the given class.

Parameters
aClass:Class<T>

the class being statically initialized

Returns:ShadowMatch

a ShadowMatch indicating whether the pointcut always, sometimes, or never matchs join points representing the static initialization of the given type

mayNeedDynamicTestback to summary
public boolean mayNeedDynamicTest()

Returns true iff this pointcut contains any expression that might necessitate a dynamic test at some join point (e.g. args)

setMatchingContextback to summary
public void setMatchingContext(MatchingContext aMatchContext)

Set the matching context to be used for subsequent calls to match.

See Also
MatchingContext