public final class AnnotationAccess extends Object
| Modifier and Type | Method and Description |
|---|---|
static <A extends Annotation> |
getAnnotation(Class<?> c,
Class<A> annotationType) |
static Annotation[] |
getAnnotations(Class<?> c) |
static <A extends Annotation> |
getDeclaredAnnotation(AnnotatedElement element,
Class<A> annotationClass)
Returns the annotation if it exists.
|
static List<Annotation> |
getDeclaredAnnotations(AnnotatedElement element)
Returns the annotations on
element. |
static Object |
getDefaultValue(Method method) |
static Class<?> |
getEnclosingClass(Class<?> c)
Returns the class of which
c is a direct member. |
static AccessibleObject |
getEnclosingMethodOrConstructor(Class<?> c) |
static Class<?>[] |
getExceptions(AnnotatedElement element) |
static int |
getInnerClassFlags(Class<?> c,
int defaultValue) |
static String |
getInnerClassName(Class<?> c) |
static Class<?>[] |
getMemberClasses(Class<?> c) |
static Annotation[][] |
getParameterAnnotations(Class<?> declaringClass,
int methodDexIndex)
Returns the parameter annotations on
member. |
static String |
getSignature(AnnotatedElement element) |
static boolean |
isAnnotationPresent(Class<?> c,
Class<? extends Annotation> annotationType)
Returns true if
c is annotated by annotationType. |
static boolean |
isAnonymousClass(Class<?> c) |
static boolean |
isDeclaredAnnotationPresent(AnnotatedElement element,
Class<? extends Annotation> annotationClass)
Returns true if the annotation exists.
|
public static <A extends Annotation> A getAnnotation(Class<?> c, Class<A> annotationType)
public static Annotation[] getAnnotations(Class<?> c)
public static boolean isAnnotationPresent(Class<?> c, Class<? extends Annotation> annotationType)
c is annotated by annotationType.public static List<Annotation> getDeclaredAnnotations(AnnotatedElement element)
element.public static <A extends Annotation> A getDeclaredAnnotation(AnnotatedElement element, Class<A> annotationClass)
public static boolean isDeclaredAnnotationPresent(AnnotatedElement element, Class<? extends Annotation> annotationClass)
public static Annotation[][] getParameterAnnotations(Class<?> declaringClass, int methodDexIndex)
member.public static Class<?> getEnclosingClass(Class<?> c)
c is a direct member. If c is
defined in a method or constructor, this is not transitive.public static AccessibleObject getEnclosingMethodOrConstructor(Class<?> c)
public static String getSignature(AnnotatedElement element)
element - a class, a field, a method or a constructor.public static Class<?>[] getExceptions(AnnotatedElement element)
element - a method or a constructor.public static int getInnerClassFlags(Class<?> c, int defaultValue)
public static boolean isAnonymousClass(Class<?> c)