Package org.springframework.aop.support
Class MethodMatchers
- java.lang.Object
- org.springframework.aop.support.MethodMatchers
public abstract class MethodMatchers extends Object
Static utility methods for composingMethodMatchers
.A MethodMatcher may be evaluated statically (based on method and target class) or need further evaluation dynamically (based on arguments at the time of method invocation).
- Since:
- 11.11.2003
- Author:
- Rod Johnson, Rob Harrop, Juergen Hoeller
- See Also:
ClassFilters
,Pointcuts
Constructor Summary
Constructors Constructor Description MethodMatchers()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MethodMatcher
intersection(MethodMatcher mm1, MethodMatcher mm2)
Match all methods that both of the given MethodMatchers match.static boolean
matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions)
Apply the given MethodMatcher to the given Method, supporting anIntroductionAwareMethodMatcher
(if applicable).static MethodMatcher
union(MethodMatcher mm1, MethodMatcher mm2)
Match all methods that either (or both) of the given MethodMatchers matches.
Constructor Detail
MethodMatchers
public MethodMatchers()
Method Detail
union
public static MethodMatcher union(MethodMatcher mm1, MethodMatcher mm2)
Match all methods that either (or both) of the given MethodMatchers matches.- Parameters:
mm1
- the first MethodMatchermm2
- the second MethodMatcher- Returns:
- a distinct MethodMatcher that matches all methods that either of the given MethodMatchers matches
intersection
public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2)
Match all methods that both of the given MethodMatchers match.- Parameters:
mm1
- the first MethodMatchermm2
- the second MethodMatcher- Returns:
- a distinct MethodMatcher that matches all methods that both of the given MethodMatchers match
matches
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions)
Apply the given MethodMatcher to the given Method, supporting anIntroductionAwareMethodMatcher
(if applicable).- Parameters:
mm
- the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)method
- the candidate methodtargetClass
- the target class (may benull
, in which case the candidate class must be taken to be the method's declaring class)hasIntroductions
-true
if the object on whose behalf we are asking is the subject on one or more introductions;false
otherwise- Returns:
- whether or not this method matches statically