public interface AnnotationMetadata extends ClassMetadata
StandardAnnotationMetadata
,
MetadataReader.getAnnotationMetadata()
Modifier and Type | Method and Description |
---|---|
Set<MethodMetadata> |
getAnnotatedMethods(String annotationType)
Retrieve the method metadata for all methods that are annotated
(or meta-annotated) with the given annotation type.
|
Map<String,Object> |
getAnnotationAttributes(String annotationType)
Retrieve the attributes of the annotation of the given type,
if any (i.e.
|
Map<String,Object> |
getAnnotationAttributes(String annotationType,
boolean classValuesAsString)
Retrieve the attributes of the annotation of the given type,
if any (i.e.
|
Set<String> |
getAnnotationTypes()
Return the names of all annotation types defined on the underlying class.
|
Set<String> |
getMetaAnnotationTypes(String annotationType)
Return the names of all meta-annotation types defined on the
given annotation type of the underlying class.
|
boolean |
hasAnnotatedMethods(String annotationType)
Determine whether the underlying class has any methods that are
annotated (or meta-annotated) with the given annotation type.
|
boolean |
hasAnnotation(String annotationType)
Determine whether the underlying class has an annotation of the given
type defined.
|
boolean |
hasMetaAnnotation(String metaAnnotationType)
Determine whether the underlying class has an annotation that
is itself annotated with the meta-annotation of the given type.
|
boolean |
isAnnotated(String annotationType)
Determine whether the underlying class has an annotation or
meta-annotation of the given type defined.
|
getClassName, getEnclosingClassName, getInterfaceNames, getMemberClassNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isConcrete, isFinal, isIndependent, isInterface
Set<String> getAnnotationTypes()
Set<String> getMetaAnnotationTypes(String annotationType)
annotationType
- the meta-annotation type to look forboolean hasAnnotation(String annotationType)
annotationType
- the annotation type to look forboolean hasMetaAnnotation(String metaAnnotationType)
metaAnnotationType
- the meta-annotation type to look forboolean isAnnotated(String annotationType)
This is equivalent to a "hasAnnotation || hasMetaAnnotation"
check. If this method returns true
, then
getAnnotationAttributes(java.lang.String)
will return a non-null Map.
annotationType
- the annotation type to look forMap<String,Object> getAnnotationAttributes(String annotationType)
annotationType
- the annotation type to look fornull
if no matching annotation is defined.Map<String,Object> getAnnotationAttributes(String annotationType, boolean classValuesAsString)
annotationType
- the annotation type to look forclassValuesAsString
- whether to convert class references to String
class names for exposure as values in the returned Map, instead of Class
references which might potentially have to be loaded firstnull
if no matching annotation is defined.boolean hasAnnotatedMethods(String annotationType)
Set<MethodMetadata> getAnnotatedMethods(String annotationType)
For any returned method, MethodMetadata.isAnnotated(java.lang.String)
will
return true
for the given annotation type.
annotationType
- the annotation type to look forMethodMetadata
for methods that have a matching
annotation. The return value will be an empty set if no methods match
the annotation type.