public class AnnotationUtils extends Object
| Constructor and Description |
|---|
AnnotationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getAnnotationPropertyValue(Method annotationProperty,
Annotation annotation) |
static Method |
getAnnotationPropertyWithName(Class<? extends Annotation> annotation,
String annotationPropertyName) |
static <T extends Annotation> |
getClassLevelAnnotation(Class<T> annotationClass,
Class<?> clazz) |
static <S extends Annotation,T> |
getClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Class<?> clazz) |
static <T extends Annotation> |
getFieldLevelAnnotations(Class<?> clazz,
Class<T> annotation) |
static <T extends Annotation> |
getFieldsAnnotatedWith(Class<? extends Object> clazz,
Class<T> annotation)
Returns the given class's declared fields that are marked with the given annotation
|
static <T extends Annotation> |
getMethodLevelAnnotations(Class<?> clazz,
Class<T> annotation) |
static <T extends Annotation> |
getMethodOrClassLevelAnnotation(Class<T> annotationClass,
Method method,
Class<?> clazz) |
static <S extends Annotation,T> |
getMethodOrClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Method method,
Class<?> clazz) |
static <T extends Annotation> |
getMethodsAnnotatedWith(Class<?> clazz,
Class<T> annotation)
Returns the given class's (and superclasses) declared methods that are marked with the given annotation
|
static <T extends Annotation> |
getMethodsAnnotatedWith(Class<?> clazz,
Class<T> annotation,
boolean includeInherited)
Returns the given class's declared methods that are marked with the given annotation
|
static boolean |
hasClassMethodOrFieldLevelAnnotation(Class<?> clazz,
Class<? extends Annotation> annotation) |
public static <T extends Annotation> Set<Field> getFieldsAnnotatedWith(Class<? extends Object> clazz, Class<T> annotation)
clazz - The class, not nullannotation - The annotation, not nullpublic static <T extends Annotation> Set<Method> getMethodsAnnotatedWith(Class<?> clazz, Class<T> annotation)
clazz - The class, not nullannotation - The annotation, not nullpublic static <T extends Annotation> Set<T> getMethodLevelAnnotations(Class<?> clazz, Class<T> annotation)
public static <T extends Annotation> Set<T> getFieldLevelAnnotations(Class<?> clazz, Class<T> annotation)
public static <T extends Annotation> Set<Method> getMethodsAnnotatedWith(Class<?> clazz, Class<T> annotation, boolean includeInherited)
clazz - The class, not nullannotation - The annotation, not nullincludeInherited - True for also looking for methods in super-classespublic static <T extends Annotation> T getMethodOrClassLevelAnnotation(Class<T> annotationClass, Method method, Class<?> clazz)
public static <T extends Annotation> T getClassLevelAnnotation(Class<T> annotationClass, Class<?> clazz)
public static <S extends Annotation,T> T getMethodOrClassLevelAnnotationProperty(Class<S> annotationClass, String annotationPropertyName, T defaultValue, Method method, Class<?> clazz)
public static <S extends Annotation,T> T getClassLevelAnnotationProperty(Class<S> annotationClass, String annotationPropertyName, T defaultValue, Class<?> clazz)
public static Method getAnnotationPropertyWithName(Class<? extends Annotation> annotation, String annotationPropertyName)
public static <T> T getAnnotationPropertyValue(Method annotationProperty, Annotation annotation)
public static boolean hasClassMethodOrFieldLevelAnnotation(Class<?> clazz, Class<? extends Annotation> annotation)
Copyright © 2016. All Rights Reserved.