org.springframework.aop.support.annotation.AnnotationClassFilter Java Examples

The following examples show how to use org.springframework.aop.support.annotation.AnnotationClassFilter. 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: MetaAnnotationMatchingPointcut.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new MetaAnnotationMatchingPointcut for the given annotation type.
 *
 * @param classAnnotationType	the annotation type to look for at the class level
 *                             (can be <code>null</code>)
 * @param methodAnnotationType the annotation type to look for at the method level
 *                             (can be <code>null</code>)
 */
public MetaAnnotationMatchingPointcut(
		Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> 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 MetaAnnotationMethodMatcher(methodAnnotationType);
	} else {
		this.methodMatcher = MethodMatcher.TRUE;
	}
}
 
Example #2
Source File: MetaAnnotationMatchingPointcut.java    From camunda-bpm-platform with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new MetaAnnotationMatchingPointcut for the given annotation type.
 *
 * @param classAnnotationType the annotation type to look for at the class level
 * @param checkInherited			whether to explicitly check the superclasses and
 *                            interfaces for the annotation type as well (even if the annotation type
 *                            is not marked as inherited itself)
 */
public MetaAnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, boolean checkInherited) {
	this.classFilter = new AnnotationClassFilter(classAnnotationType, checkInherited);
	this.methodMatcher = MethodMatcher.TRUE;
}