Spring Framework StaticMethodMatcher - 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 StaticMethodMatcher 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 AnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
		Assert.notNull(annotationType, "Annotation type must not be null");
		this.annotationType = annotationType;
	} 
 
 
	@Override 
	public boolean matches(Method method, Class<?> targetClass) {
		if (method.isAnnotationPresent(this.annotationType)) {
			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 && specificMethod.isAnnotationPresent(this.annotationType));
	} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java