public final class Annotations extends Object
Modifier and Type | Method | Description |
---|---|---|
static <T extends Annotation> |
findAnnotation(Class<?> klass,
Method method,
Class<T> annotationClass) |
Find expected annotation on:
Method if annotation is defined.
Class if annotation is defined.
|
static <T extends Annotation> |
findStaticFieldAnnotatedWith(Class<?> klass,
Class<T> annotation) |
Get all static fields annotated with given annotation.
|
static <T extends Annotation> |
findStaticMethodAnnotatedWith(Class<?> klass,
Class<T> annotation) |
Get all static fields annotated with given annotation.
|
public static <T extends Annotation> T findAnnotation(Class<?> klass, Method method, Class<T> annotationClass)
T
- Type of annotation.klass
- Class.method
- Method in given class
.annotationClass
- Annotation class to look for.null
otherwise.public static <T extends Annotation> List<Field> findStaticFieldAnnotatedWith(Class<?> klass, Class<T> annotation)
T
- Type of annotation.klass
- Class to analyze.annotation
- Annotation to look for.public static <T extends Annotation> List<Method> findStaticMethodAnnotatedWith(Class<?> klass, Class<T> annotation)
T
- Type of annotation.klass
- Class to analyze.annotation
- Annotation to look for.Copyright © 2017. All rights reserved.