/** * Apply an intersection with the given ClassFilter. * @param other the ClassFilter to apply an intersection with * @return this composable pointcut (for call chaining) */ public ComposablePointcut intersection(ClassFilter other) { this.classFilter = ClassFilters.intersection(this.classFilter, other); return this; }
/** * Private constructor to share common code between impl-based delegate and reference-based delegate * (cannot use method such as init() to share common code, due the use of final fields). * @param interfaceType static field defining the introduction * @param typePattern type pattern the introduction is restricted to * @param interceptor the delegation advice as {@link IntroductionInterceptor} */ private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, IntroductionInterceptor interceptor) { this.advice = interceptor; this.introducedInterface = interfaceType; // Excludes methods implemented. ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern); ClassFilter exclusion = (clazz -> !this.introducedInterface.isAssignableFrom(clazz)); this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion); }
/** * Apply an intersection with the given Pointcut. * @param other the Pointcut to apply an intersection with * @return this composable pointcut (for call chaining) */ public ComposablePointcut intersection(Pointcut other) { this.classFilter = ClassFilters.intersection(this.classFilter, other.getClassFilter()); this.methodMatcher = MethodMatchers.intersection(this.methodMatcher, other.getMethodMatcher()); return this; }
@Test public void testIntersection() { assertTrue(exceptionFilter.matches(RuntimeException.class)); assertTrue(hasRootCauseFilter.matches(NestedRuntimeException.class)); ClassFilter intersection = ClassFilters.intersection(exceptionFilter, hasRootCauseFilter); assertFalse(intersection.matches(RuntimeException.class)); assertFalse(intersection.matches(TestBean.class)); assertTrue(intersection.matches(NestedRuntimeException.class)); }
/** * Apply an intersection with the given ClassFilter. * @param other the ClassFilter to apply an intersection with * @return this composable pointcut (for call chaining) */ public ComposablePointcut intersection(ClassFilter other) { this.classFilter = ClassFilters.intersection(this.classFilter, other); return this; }
/** * Apply an intersection with the given ClassFilter. * @param other the ClassFilter to apply an intersection with * @return this composable pointcut (for call chaining) */ public ComposablePointcut intersection(ClassFilter other) { this.classFilter = ClassFilters.intersection(this.classFilter, other); return this; }
public ComposablePointcut intersection(ClassFilter filter) { this.classFilter = ClassFilters.intersection(this.classFilter, filter); return this; }
/** * Private constructor to share common code between impl-based delegate and reference-based delegate * (cannot use method such as init() to share common code, due the use of final fields). * @param interfaceType static field defining the introduction * @param typePattern type pattern the introduction is restricted to * @param interceptor the delegation advice as {@link IntroductionInterceptor} */ private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, IntroductionInterceptor interceptor) { this.advice = interceptor; this.introducedInterface = interfaceType; // Excludes methods implemented. ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern); ClassFilter exclusion = (clazz -> !this.introducedInterface.isAssignableFrom(clazz)); this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion); }
/** * Private constructor to share common code between impl-based delegate and reference-based delegate * (cannot use method such as init() to share common code, due the use of final fields) * @param interfaceType static field defining the introduction * @param typePattern type pattern the introduction is restricted to * @param interceptor the delegation advice as {@link IntroductionInterceptor} */ private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, IntroductionInterceptor interceptor) { this.advice = interceptor; this.introducedInterface = interfaceType; // Excludes methods implemented. ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern); ClassFilter exclusion = new ClassFilter() { @Override public boolean matches(Class<?> clazz) { return !introducedInterface.isAssignableFrom(clazz); } }; this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion); }
/** * Apply an intersection with the given Pointcut. * @param other the Pointcut to apply an intersection with * @return this composable pointcut (for call chaining) */ public ComposablePointcut intersection(Pointcut other) { this.classFilter = ClassFilters.intersection(this.classFilter, other.getClassFilter()); this.methodMatcher = MethodMatchers.intersection(this.methodMatcher, other.getMethodMatcher()); return this; }
public ComposablePointcut intersection(Pointcut other) { this.classFilter = ClassFilters.intersection(this.classFilter, other.getClassFilter()); this.methodMatcher = MethodMatchers.intersection(this.methodMatcher, other.getMethodMatcher()); return this; }
/** * Apply an intersection with the given Pointcut. * @param other the Pointcut to apply an intersection with * @return this composable pointcut (for call chaining) */ public ComposablePointcut intersection(Pointcut other) { this.classFilter = ClassFilters.intersection(this.classFilter, other.getClassFilter()); this.methodMatcher = MethodMatchers.intersection(this.methodMatcher, other.getMethodMatcher()); return this; }