类 AnnotationTypeFilter
java.lang.Object
cn.taketoday.core.type.filter.AbstractTypeHierarchyTraversingFilter
cn.taketoday.core.type.filter.AnnotationTypeFilter
- 所有已实现的接口:
TypeFilter
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 my be disabled.
Similarly, the search for annotations on interfaces may optionally be enabled.
Consult the various constructors in this class for details.
- 从以下版本开始:
- 4.0
- 作者:
- Mark Fisher, Ramnivas Laddad, Juergen Hoeller, Sam Brannen, TODAY
-
字段概要
字段 -
构造器概要
构造器构造器说明AnnotationTypeFilter(Class<? extends Annotation> annotationType) Create a newAnnotationTypeFilterfor the given annotation type.AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations) Create a newAnnotationTypeFilterfor the given annotation type.AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations, boolean considerInterfaces) Create a newAnnotationTypeFilterfor the given annotation type. -
方法概要
修饰符和类型方法说明final Class<? extends Annotation>Return theAnnotationthat this instance is using to filter candidates.protected BooleanhasAnnotation(String typeName) protected BooleanmatchInterface(String interfaceName) Override this to match on interface type name.protected booleanmatchSelf(MetadataReader metadataReader) Override this to match self characteristics alone.protected BooleanmatchSuperClass(String superClassName) Override this to match on super type name.从类继承的方法 cn.taketoday.core.type.filter.AbstractTypeHierarchyTraversingFilter
match, matchClassName
-
字段详细资料
-
annotationType
-
considerMetaAnnotations
private final boolean considerMetaAnnotations
-
-
构造器详细资料
-
AnnotationTypeFilter
Create a newAnnotationTypeFilterfor 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.
- 参数:
annotationType- the annotation type to match
-
AnnotationTypeFilter
public AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations) Create a newAnnotationTypeFilterfor the given annotation type.The filter will not match interfaces.
- 参数:
annotationType- the annotation type to matchconsiderMetaAnnotations- whether to also match on meta-annotations
-
AnnotationTypeFilter
public AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations, boolean considerInterfaces) Create a newAnnotationTypeFilterfor the given annotation type.- 参数:
annotationType- the annotation type to matchconsiderMetaAnnotations- whether to also match on meta-annotationsconsiderInterfaces- whether to also match interfaces
-
-
方法详细资料
-
getAnnotationType
Return theAnnotationthat this instance is using to filter candidates. -
matchSelf
Override this to match self characteristics alone. Typically, the implementation will use a visitor to extract information to perform matching. -
matchSuperClass
Override this to match on super type name. -
matchInterface
Override this to match on interface type name. -
hasAnnotation
-