public AnnotationMatchingPointcut(Class classAnnotationType,
Class methodAnnotationType) {
Assert.isTrue((classAnnotationType != null || methodAnnotationType != null),
"Either Class annotation type or Method annotation type needs to be specified (or both)");
if (classAnnotationType != null) {
this.classFilter = new AnnotationClassFilter(classAnnotationType);
}
else {
this.classFilter = ClassFilter.TRUE;
}
if (methodAnnotationType != null) {
this.methodMatcher = new AnnotationMethodMatcher(methodAnnotationType);
}
else {
this.methodMatcher = MethodMatcher.TRUE;
}
}
Create a new AnnotationMatchingPointcut for the given annotation type. Parameters:
classAnnotationType - the annotation type to look for at the class level
(can be null)
methodAnnotationType - the annotation type to look for at the method level
(can be null)
|