Spring Framework AnnotationMethodMatcher - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AnnotationMethodMatcher class.

This code example shows how to use the following methods:
	 * Create a new AnnotationClassFilter for the given annotation type. 
	 * 
	 * @param annotationType the annotation type to look for 
	 */ 
	public MetaAnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
		super(annotationType);
		this.annotationType = annotationType;
	} 
 
 
	@Override 
	@SuppressWarnings("rawtypes") 
	public boolean matches(Method method, Class targetClass) {
		if (AnnotationUtils.getAnnotation(method, this.annotationType) != null) {
			return true; 
		} 
		// The method may be on an interface, so let's check on the target class as well. 
		Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass);
		return (specificMethod != method &&
				(AnnotationUtils.getAnnotation(specificMethod, this.annotationType) != null));
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java