AnnotationTypeFilter (Spring Framework 7.0.8 API) JavaScript is disabled on your browser.     Skip navigation links Overview Class Use Tree Deprecated Index Search Help Spring Framework org.springframework.core.type.filter AnnotationTypeFilter Contents  Description Field Summary Constructor Summary Method Summary Constructor Details AnnotationTypeFilter(Class) AnnotationTypeFilter(Class, boolean) AnnotationTypeFilter(Class, boolean, boolean) Method Details getAnnotationType() matchSelf(MetadataReader) matchSuperClass(String) matchInterface(String) hasAnnotation(String) Hide sidebar  Show sidebar Class AnnotationTypeFilter java.lang.Object org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter org.springframework.core.type.filter.AnnotationTypeFilter All Implemented Interfaces: TypeFilter public class AnnotationTypeFilter extends AbstractTypeHierarchyTraversingFilter A simple TypeFilter which matches classes with a given annotation, checking inherited annotations as well. By default, the matching logic mirrors that of AnnotationUtils.getAnnotation(java.lang.reflect.AnnotatedElement, Class), supporting annotations that are present or meta-present for a single level of meta-annotations. The search for meta-annotations may be disabled. Similarly, the search for annotations on interfaces may optionally be enabled. Consult the various constructors in this class for details. Since: 2.5 Author: Mark Fisher, Ramnivas Laddad, Juergen Hoeller, Sam Brannen Field Summary Fields inherited from class AbstractTypeHierarchyTraversingFilter logger Constructor Summary Constructors Constructor Description AnnotationTypeFilter(Class<? extends Annotation> annotationType) Create a new AnnotationTypeFilter for the given annotation type. AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations) Create a new AnnotationTypeFilter for the given annotation type. AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations, boolean considerInterfaces) Create a new AnnotationTypeFilter for the given annotation type. Method Summary All MethodsInstance MethodsConcrete Methods Modifier and Type Method Description final Class<? extends Annotation> getAnnotationType() Return the Annotation that this instance is using to filter candidates. protected @Nullable Boolean hasAnnotation(String typeName)   protected @Nullable Boolean matchInterface(String interfaceName) Override this to match on interface type name. protected boolean matchSelf(MetadataReader metadataReader) Override this to match self characteristics alone. protected @Nullable Boolean matchSuperClass(String superClassName) Override this to match on supertype name. Methods inherited from class AbstractTypeHierarchyTraversingFilter match, matchClassName Methods inherited from class Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Constructor Details AnnotationTypeFilter public AnnotationTypeFilter(Class<? extends Annotation> annotationType) Create a new AnnotationTypeFilter for the given annotation type. The filter will also match meta-annotations. To disable the meta-annotation matching, use the constructor that accepts a 'considerMetaAnnotations' argument. The filter will not match interfaces. Parameters: annotationType - the annotation type to match AnnotationTypeFilter public AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations) Create a new AnnotationTypeFilter for the given annotation type. The filter will not match interfaces. Parameters: annotationType - the annotation type to match considerMetaAnnotations - whether to also match on meta-annotations AnnotationTypeFilter public AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations, boolean considerInterfaces) Create a new AnnotationTypeFilter for the given annotation type. Parameters: annotationType - the annotation type to match considerMetaAnnotations - whether to also match on meta-annotations considerInterfaces - whether to also match interfaces Method Details getAnnotationType public final Class<? extends Annotation> getAnnotationType() Return the Annotation that this instance is using to filter candidates. Since: 5.0 matchSelf protected boolean matchSelf(MetadataReader metadataReader) Description copied from class: AbstractTypeHierarchyTraversingFilter Override this to match self characteristics alone. Typically, the implementation will use a visitor to extract information to perform matching. Overrides: matchSelf in class AbstractTypeHierarchyTraversingFilter matchSuperClass protected @Nullable Boolean matchSuperClass(String superClassName) Description copied from class: AbstractTypeHierarchyTraversingFilter Override this to match on supertype name. Overrides: matchSuperClass in class AbstractTypeHierarchyTraversingFilter matchInterface protected @Nullable Boolean matchInterface(String interfaceName) Description copied from class: AbstractTypeHierarchyTraversingFilter Override this to match on interface type name. Overrides: matchInterface in class AbstractTypeHierarchyTraversingFilter hasAnnotation protected @Nullable Boolean hasAnnotation(String typeName)