org.springframework.aop.IntroductionAwareMethodMatcher Java Examples

The following examples show how to use org.springframework.aop.IntroductionAwareMethodMatcher. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MethodMatchers.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Apply the given MethodMatcher to the given Method, supporting an
 * {@link org.springframework.aop.IntroductionAwareMethodMatcher}
 * (if applicable).
 * @param mm the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)
 * @param method the candidate method
 * @param targetClass the target class
 * @param hasIntroductions {@code true} if the object on whose behalf we are
 * asking is the subject on one or more introductions; {@code false} otherwise
 * @return whether or not this method matches statically
 */
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {
	Assert.notNull(mm, "MethodMatcher must not be null");
	return (mm instanceof IntroductionAwareMethodMatcher ?
			((IntroductionAwareMethodMatcher) mm).matches(method, targetClass, hasIntroductions) :
			mm.matches(method, targetClass));
}
 
Example #2
Source File: MethodMatchers.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Apply the given MethodMatcher to the given Method, supporting an
 * {@link org.springframework.aop.IntroductionAwareMethodMatcher}
 * (if applicable).
 * @param mm the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)
 * @param method the candidate method
 * @param targetClass the target class
 * @param hasIntroductions {@code true} if the object on whose behalf we are
 * asking is the subject on one or more introductions; {@code false} otherwise
 * @return whether or not this method matches statically
 */
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {
	Assert.notNull(mm, "MethodMatcher must not be null");
	return (mm instanceof IntroductionAwareMethodMatcher ?
			((IntroductionAwareMethodMatcher) mm).matches(method, targetClass, hasIntroductions) :
			mm.matches(method, targetClass));
}
 
Example #3
Source File: MethodMatchers.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Apply the given MethodMatcher to the given Method, supporting an
 * {@link org.springframework.aop.IntroductionAwareMethodMatcher}
 * (if applicable).
 * @param mm the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)
 * @param method the candidate method
 * @param targetClass the target class (may be {@code null}, in which case
 * the candidate class must be taken to be the method's declaring class)
 * @param hasIntroductions {@code true} if the object on whose behalf we are
 * asking is the subject on one or more introductions; {@code false} otherwise
 * @return whether or not this method matches statically
 */
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {
	Assert.notNull(mm, "MethodMatcher must not be null");
	return ((mm instanceof IntroductionAwareMethodMatcher &&
			((IntroductionAwareMethodMatcher) mm).matches(method, targetClass, hasIntroductions)) ||
			mm.matches(method, targetClass));
}
 
Example #4
Source File: MethodMatchers.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Apply the given MethodMatcher to the given Method, supporting an
 * {@link org.springframework.aop.IntroductionAwareMethodMatcher}
 * (if applicable).
 * @param mm the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)
 * @param method the candidate method
 * @param targetClass the target class (may be {@code null}, in which case
 * the candidate class must be taken to be the method's declaring class)
 * @param hasIntroductions {@code true} if the object on whose behalf we are
 * asking is the subject on one or more introductions; {@code false} otherwise
 * @return whether or not this method matches statically
 */
public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {
	Assert.notNull(mm, "MethodMatcher must not be null");
	return ((mm instanceof IntroductionAwareMethodMatcher &&
			((IntroductionAwareMethodMatcher) mm).matches(method, targetClass, hasIntroductions)) ||
			mm.matches(method, targetClass));
}
 
Example #5
Source File: MethodMatchers.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches.
 * @param mm1 the first MethodMatcher
 * @param mm2 the second MethodMatcher
 * @return a distinct MethodMatcher that matches all methods that either
 * of the given MethodMatchers matches
 */
public static MethodMatcher union(MethodMatcher mm1, MethodMatcher mm2) {
	return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ?
			new UnionIntroductionAwareMethodMatcher(mm1, mm2) : new UnionMethodMatcher(mm1, mm2));
}
 
Example #6
Source File: MethodMatchers.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches.
 * @param mm1 the first MethodMatcher
 * @param cf1 the corresponding ClassFilter for the first MethodMatcher
 * @param mm2 the second MethodMatcher
 * @param cf2 the corresponding ClassFilter for the second MethodMatcher
 * @return a distinct MethodMatcher that matches all methods that either
 * of the given MethodMatchers matches
 */
static MethodMatcher union(MethodMatcher mm1, ClassFilter cf1, MethodMatcher mm2, ClassFilter cf2) {
	return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ?
			new ClassFilterAwareUnionIntroductionAwareMethodMatcher(mm1, cf1, mm2, cf2) :
			new ClassFilterAwareUnionMethodMatcher(mm1, cf1, mm2, cf2));
}
 
Example #7
Source File: MethodMatchers.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Match all methods that <i>both</i> of the given MethodMatchers match.
 * @param mm1 the first MethodMatcher
 * @param mm2 the second MethodMatcher
 * @return a distinct MethodMatcher that matches all methods that both
 * of the given MethodMatchers match
 */
public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2) {
	return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ?
			new IntersectionIntroductionAwareMethodMatcher(mm1, mm2) : new IntersectionMethodMatcher(mm1, mm2));
}
 
Example #8
Source File: MethodMatchers.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches.
 * @param mm1 the first MethodMatcher
 * @param mm2 the second MethodMatcher
 * @return a distinct MethodMatcher that matches all methods that either
 * of the given MethodMatchers matches
 */
public static MethodMatcher union(MethodMatcher mm1, MethodMatcher mm2) {
	return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ?
			new UnionIntroductionAwareMethodMatcher(mm1, mm2) : new UnionMethodMatcher(mm1, mm2));
}
 
Example #9
Source File: MethodMatchers.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches.
 * @param mm1 the first MethodMatcher
 * @param cf1 the corresponding ClassFilter for the first MethodMatcher
 * @param mm2 the second MethodMatcher
 * @param cf2 the corresponding ClassFilter for the second MethodMatcher
 * @return a distinct MethodMatcher that matches all methods that either
 * of the given MethodMatchers matches
 */
static MethodMatcher union(MethodMatcher mm1, ClassFilter cf1, MethodMatcher mm2, ClassFilter cf2) {
	return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ?
			new ClassFilterAwareUnionIntroductionAwareMethodMatcher(mm1, cf1, mm2, cf2) :
			new ClassFilterAwareUnionMethodMatcher(mm1, cf1, mm2, cf2));
}
 
Example #10
Source File: MethodMatchers.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Match all methods that <i>both</i> of the given MethodMatchers match.
 * @param mm1 the first MethodMatcher
 * @param mm2 the second MethodMatcher
 * @return a distinct MethodMatcher that matches all methods that both
 * of the given MethodMatchers match
 */
public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2) {
	return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ?
			new IntersectionIntroductionAwareMethodMatcher(mm1, mm2) : new IntersectionMethodMatcher(mm1, mm2));
}