|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Part of a Pointcut. Checks whether the target method is eligible for advice.
A MethodMatcher may be evaluated statically or at runtime (dynamically). Static matching involves method and (possibly) method attributes. Dynamic matching also makes arguments for a particular call available, and any effects of running previous advice applying to the joinpoint.
If an implementation returns false in its isRuntime() method, evaluation can be performed statically, and the result will be the same for all invocations of this method, whatever their arguments. If the isRuntime() method returns false, the 3-arg matches() method will never be invoked.
If an implementation returns true in its 2-arg matches() method, and its isRuntime() method returns true, the 3-argument matches() method will be invoked immediately before each potential execution of the related advice, to decide whether the advice should run. All previous advice, such as earlier interceptors in an interceptor chain, will have run, so any state changes they have produced in parameters or ThreadLocal state, will be available at the time of evaluation.
Field Summary | |
static MethodMatcher |
TRUE
Canonical instance that matches all methods. |
Method Summary | |
boolean |
isRuntime()
Is this MethodMatcher dynamic? |
boolean |
matches(java.lang.reflect.Method m,
java.lang.Class targetClass)
Perform static checking. |
boolean |
matches(java.lang.reflect.Method m,
java.lang.Class targetClass,
java.lang.Object[] args)
Is there a runtime (dynamic) match for this method, which must have matched statically. |
Field Detail |
public static final MethodMatcher TRUE
Method Detail |
public boolean matches(java.lang.reflect.Method m, java.lang.Class targetClass)
m
- candidate methodtargetClass
- target class (may be null, in which case the candidate
class must be taken to be the method's declaring class)
public boolean isRuntime()
Note: Could be pulled up into a Matcher super-interface to apply to fields also.
public boolean matches(java.lang.reflect.Method m, java.lang.Class targetClass, java.lang.Object[] args)
m
- candidate methodtargetClass
- target classargs
- arguments to the method
matches(Method, Class)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |