public final class Annotations
extends java.lang.Object
java.lang.reader.RetentionPolicy.RUNTIME
annotations when running Java 1.5.x).Constructor and Description |
---|
Annotations() |
Modifier and Type | Method and Description |
---|---|
static Annotation |
getAnnotation(java.lang.Class annotationType,
java.lang.Class target)
Return the annotation with a specific name for a specific class.
|
static Annotation |
getAnnotation(java.lang.Class annotationType,
java.lang.reflect.Constructor constructor)
Return the annotation with a specific name for a specific constructor.
|
static Annotation |
getAnnotation(java.lang.Class annotationType,
java.lang.reflect.Field field)
Return the annotation with a specific name for a specific field.
|
static Annotation |
getAnnotation(java.lang.Class annotationType,
java.lang.reflect.Method method)
Return the annotation with a specific name for a specific method.
|
static Annotation[] |
getAnnotations(java.lang.Class target)
Return all the annotations for a specific class.
|
static Annotation[] |
getAnnotations(java.lang.reflect.Constructor constructor)
Return all the annotations for a specific constructor.
|
static Annotation[] |
getAnnotations(java.lang.reflect.Field field)
Return all the annotations for a specific field.
|
static Annotation[] |
getAnnotations(java.lang.reflect.Method method)
Return all the annotations for a specific method.
|
static boolean |
isAnnotationPresent(java.lang.Class annotationType,
java.lang.Class target)
Checks if an annotation is present at a specific class.
|
static boolean |
isAnnotationPresent(java.lang.Class annotationType,
java.lang.reflect.Constructor constructor)
Checks if an annotation is present at a specific method.
|
static boolean |
isAnnotationPresent(java.lang.Class annotationType,
java.lang.reflect.Field field)
Checks if an annotation is present at a specific field.
|
static boolean |
isAnnotationPresent(java.lang.Class annotationType,
java.lang.reflect.Method method)
Checks if an annotation is present at a specific method.
|
public static boolean isAnnotationPresent(java.lang.Class annotationType, java.lang.Class target)
annotationType
- the annotation typetarget
- the annotated typepublic static Annotation[] getAnnotations(java.lang.Class target)
target
- the java.lang.Class object to find the annotations on.public static Annotation getAnnotation(java.lang.Class annotationType, java.lang.Class target)
annotationType
- the annotation classtarget
- the java.lang.Class object to find the annotation on.public static boolean isAnnotationPresent(java.lang.Class annotationType, java.lang.reflect.Method method)
annotationType
- the annotation typemethod
- the annotated typepublic static Annotation[] getAnnotations(java.lang.reflect.Method method)
method
- the java.lang.reflect.Method object to find the annotations on.public static Annotation getAnnotation(java.lang.Class annotationType, java.lang.reflect.Method method)
annotationType
- the annotation classmethod
- the java.lang.refect.Method object to find the annotation on.public static boolean isAnnotationPresent(java.lang.Class annotationType, java.lang.reflect.Constructor constructor)
annotationType
- the annotation typeconstructor
- the annotated typepublic static Annotation[] getAnnotations(java.lang.reflect.Constructor constructor)
constructor
- the java.lang.reflect.Constructor object to find the annotations on.public static Annotation getAnnotation(java.lang.Class annotationType, java.lang.reflect.Constructor constructor)
annotationType
- the annotation classconstructor
- the java.lang.refect.Constructor object to find the annotation on.public static boolean isAnnotationPresent(java.lang.Class annotationType, java.lang.reflect.Field field)
annotationType
- the annotation typefield
- the annotated typepublic static Annotation[] getAnnotations(java.lang.reflect.Field field)
field
- the java.lang.reflect.Field object to find the annotations on.public static Annotation getAnnotation(java.lang.Class annotationType, java.lang.reflect.Field field)
annotationType
- the annotation classfield
- the java.lang.reflect.Field object to find the annotation on.