1 16 17 package org.springframework.aop.support.annotation; 18 19 import java.lang.annotation.Annotation ; 20 21 import org.springframework.aop.ClassFilter; 22 import org.springframework.util.Assert; 23 24 32 public class AnnotationClassFilter implements ClassFilter { 33 34 private final Class <? extends Annotation > annotationType; 35 36 37 41 public AnnotationClassFilter(Class <? extends Annotation > annotationType) { 42 Assert.notNull(annotationType, "Annotation type must not be null"); 43 this.annotationType = annotationType; 44 } 45 46 47 public boolean matches(Class clazz) { 48 return clazz.isAnnotationPresent(this.annotationType); 49 } 50 51 } 52 | Popular Tags |