public class AnnotationTypeFilter extends AbstractTypeHierarchyTraversingFilter
The matching logic mirrors that of Class.isAnnotationPresent(Class)
.
logger
Constructor and Description |
---|
AnnotationTypeFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Create a new AnnotationTypeFilter for the given annotation type.
|
AnnotationTypeFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
boolean considerMetaAnnotations)
Create a new AnnotationTypeFilter for the given annotation type.
|
AnnotationTypeFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
boolean considerMetaAnnotations,
boolean considerInterfaces)
Create a new
AnnotationTypeFilter for the given annotation type. |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends java.lang.annotation.Annotation> |
getAnnotationType()
Return the
Annotation that this instance is using to filter
candidates. |
protected java.lang.Boolean |
hasAnnotation(java.lang.String typeName) |
protected java.lang.Boolean |
matchInterface(java.lang.String interfaceName)
Override this to match on interface type name.
|
protected boolean |
matchSelf(MetadataReader metadataReader)
Override this to match self characteristics alone.
|
protected java.lang.Boolean |
matchSuperClass(java.lang.String superClassName)
Override this to match on super type name.
|
match, matchClassName
public AnnotationTypeFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
considerMetaAnnotations
' argument. The filter will
not match interfaces.annotationType
- the annotation type to matchpublic AnnotationTypeFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, boolean considerMetaAnnotations)
annotationType
- the annotation type to matchconsiderMetaAnnotations
- whether to also match on meta-annotationspublic AnnotationTypeFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, boolean considerMetaAnnotations, boolean considerInterfaces)
AnnotationTypeFilter
for the given annotation type.annotationType
- the annotation type to matchconsiderMetaAnnotations
- whether to also match on meta-annotationsconsiderInterfaces
- whether to also match interfacespublic final java.lang.Class<? extends java.lang.annotation.Annotation> getAnnotationType()
Annotation
that this instance is using to filter
candidates.protected boolean matchSelf(MetadataReader metadataReader)
AbstractTypeHierarchyTraversingFilter
matchSelf
in class AbstractTypeHierarchyTraversingFilter
@Nullable protected java.lang.Boolean matchSuperClass(java.lang.String superClassName)
AbstractTypeHierarchyTraversingFilter
matchSuperClass
in class AbstractTypeHierarchyTraversingFilter
@Nullable protected java.lang.Boolean matchInterface(java.lang.String interfaceName)
AbstractTypeHierarchyTraversingFilter
matchInterface
in class AbstractTypeHierarchyTraversingFilter
@Nullable protected java.lang.Boolean hasAnnotation(java.lang.String typeName)