public final class AnnotationInfo<T> extends Object
Annotation closest to the represented type (the overriding one) is kept.| Modifier and Type | Method and Description |
|---|---|
<A extends Annotation> |
getAnnotation(Class<A> annotationType)
Version of
Class.getAnnotation(Class) also considering annotations "inherited" from
super-types for this getType(). |
<A extends Annotation> |
getAnnotation(Class<A> annotationType,
AnnotatedElement element)
Version of
AnnotatedElement.getAnnotation(Class) also considering annotations "inherited" from
super-types. |
<A extends Annotation> |
getAnnotation(Class<A> annotationType,
Field field)
Version of
Field.getAnnotation(Class) also considering annotations "inherited" from overridden fields
of super-types. |
<A extends Annotation> |
getAnnotation(Class<A> annotationType,
Method method)
Version of
Method.getAnnotation(Class) also considering annotations "inherited" from overridden methods
of super-types. |
<A extends Annotation> |
getAnnotation(Class<A> annotationType,
Parameter parameter)
Version of
Parameter.getAnnotation(Class) also considering annotations "inherited" from overridden
methods of super-types. |
int |
getAnnotationCount(Parameter parameter)
Counts the annotation on a
Parameter including those present on same parameter of an overridden method
should the method be overridden. |
Class<T> |
getType() |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType)
Version of
Class.isAnnotationPresent(Class) also considering annotations "inherited" from super-types. |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType,
AnnotatedElement element)
Version of
AnnotatedElement.isAnnotationPresent(Class) also considering annotations "inherited" from
super-types. |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType,
Field field)
Version of
AccessibleObject.isAnnotationPresent(Class) also considering annotations "inherited" from super-types. |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType,
Method method)
Version of
AccessibleObject.isAnnotationPresent(Class) also considering annotations "inherited" from super-types. |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType,
Parameter parameter)
Version of
AnnotatedElement.isAnnotationPresent(Class) also considering annotations "inherited" from super-types. |
boolean |
isAnyAnnotationPresent(AnnotatedElement element,
Class<? extends Annotation>... annotationTypes) |
static <T> AnnotationInfo<T> |
valueOf(Class<T> type) |
public static <T> AnnotationInfo<T> valueOf(Class<T> type)
public <A extends Annotation> A getAnnotation(Class<A> annotationType)
Class.getAnnotation(Class) also considering annotations "inherited" from
super-types for this getType().annotationType - annotation type to checknull otherwisepublic <A extends Annotation> A getAnnotation(Class<A> annotationType, Field field)
Field.getAnnotation(Class) also considering annotations "inherited" from overridden fields
of super-types.public <A extends Annotation> A getAnnotation(Class<A> annotationType, Method method)
Method.getAnnotation(Class) also considering annotations "inherited" from overridden methods
of super-types.public <A extends Annotation> A getAnnotation(Class<A> annotationType, Parameter parameter)
Parameter.getAnnotation(Class) also considering annotations "inherited" from overridden
methods of super-types.public <A extends Annotation> A getAnnotation(Class<A> annotationType, AnnotatedElement element)
AnnotatedElement.getAnnotation(Class) also considering annotations "inherited" from
super-types.public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Class.isAnnotationPresent(Class) also considering annotations "inherited" from super-types.annotationType - annotation type to checkpublic boolean isAnnotationPresent(Class<? extends Annotation> annotationType, Field field)
AccessibleObject.isAnnotationPresent(Class) also considering annotations "inherited" from super-types.annotationType - annotation type to checkgetType() or any of its super-types.public boolean isAnnotationPresent(Class<? extends Annotation> annotationType, Method method)
AccessibleObject.isAnnotationPresent(Class) also considering annotations "inherited" from super-types.annotationType - annotation type to checkmethod - the method checked for annotation. The method must be defined or inherited by this
getType() or any of its super-types.public boolean isAnnotationPresent(Class<? extends Annotation> annotationType, Parameter parameter)
AnnotatedElement.isAnnotationPresent(Class) also considering annotations "inherited" from super-types.annotationType - annotation type to checkparameter - the parameter checked for annotations. The parameter must belong to a method defined or
inherited by this getType()public boolean isAnnotationPresent(Class<? extends Annotation> annotationType, AnnotatedElement element)
AnnotatedElement.isAnnotationPresent(Class) also considering annotations "inherited" from
super-types.@SafeVarargs public final boolean isAnyAnnotationPresent(AnnotatedElement element, Class<? extends Annotation>... annotationTypes)
public int getAnnotationCount(Parameter parameter)
Parameter including those present on same parameter of an overridden method
should the method be overridden.parameter - the parameter of which to count annotations forParameter including annotations present on the same
parameter of an potentially overridden method.Copyright © 2019. All rights reserved.