Package org.springframework.aop.support
Class MethodMatchers
java.lang.Object
org.springframework.aop.support.MethodMatchers
Static utility methods for composing 
MethodMatchers.
 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, Sam Brannen
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic MethodMatcherintersection(MethodMatcher mm1, MethodMatcher mm2) Match all methods that both of the given MethodMatchers match.static booleanmatches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) Apply the given MethodMatcher to the given Method, supporting anIntroductionAwareMethodMatcher(if applicable).static MethodMatchernegate(MethodMatcher methodMatcher) Return a method matcher that represents the logical negation of the specified matcher instance.static MethodMatcherunion(MethodMatcher mm1, MethodMatcher mm2) Match all methods that either (or both) of the given MethodMatchers matches.
- 
Constructor Details- 
MethodMatcherspublic MethodMatchers()
 
- 
- 
Method Details- 
unionMatch all methods that either (or both) of the given MethodMatchers matches.- Parameters:
- mm1- the first MethodMatcher
- mm2- the second MethodMatcher
- Returns:
- a distinct MethodMatcher that matches all methods that either of the given MethodMatchers matches
 
- 
intersectionMatch all methods that both of the given MethodMatchers match.- Parameters:
- mm1- the first MethodMatcher
- mm2- the second MethodMatcher
- Returns:
- a distinct MethodMatcher that matches all methods that both of the given MethodMatchers match
 
- 
negateReturn a method matcher that represents the logical negation of the specified matcher instance.- Parameters:
- methodMatcher- the- MethodMatcherto negate
- Returns:
- a matcher that represents the logical negation of the specified matcher
- Since:
- 6.1
 
- 
matchespublic 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 method
- targetClass- the target class
- hasIntroductions-- trueif the object on whose behalf we are asking is the subject on one or more introductions;- falseotherwise
- Returns:
- whether this method matches statically
 
 
-