|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.util.AnnotationUtils
public class AnnotationUtils
Utilities for retrieving and working with annotations.
Constructor Summary | |
---|---|
AnnotationUtils()
|
Method Summary | ||
---|---|---|
static
|
getAnnotationPropertyValue(Method annotationProperty,
Annotation annotation)
|
|
static Method |
getAnnotationPropertyWithName(Class<? extends Annotation> annotation,
String annotationPropertyName)
|
|
static
|
getClassLevelAnnotation(Class<T> annotationClass,
Class<?> clazz)
|
|
static
|
getClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Class<?> clazz)
|
|
static
|
getFieldLevelAnnotations(Class<?> clazz,
Class<T> annotation)
|
|
static
|
getFieldsAnnotatedWith(Class<? extends Object> clazz,
Class<T> annotation)
Returns the given class's declared fields that are marked with the given annotation |
|
static
|
getMethodLevelAnnotations(Class<?> clazz,
Class<T> annotation)
|
|
static
|
getMethodOrClassLevelAnnotation(Class<T> annotationClass,
Method method,
Class<?> clazz)
|
|
static
|
getMethodOrClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Method method,
Class<?> clazz)
|
|
static
|
getMethodsAnnotatedWith(Class<?> clazz,
Class<T> annotation)
Returns the given class's (and superclasses) declared methods that are marked with the given annotation |
|
static
|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationUtils()
Method Detail |
---|
public static <T extends Annotation> Set<Field> getFieldsAnnotatedWith(Class<? extends Object> clazz, Class<T> annotation)
clazz
- The class, not nullannotation
- The annotation, not null
public static <T extends Annotation> Set<Method> getMethodsAnnotatedWith(Class<?> clazz, Class<T> annotation)
clazz
- The class, not nullannotation
- The annotation, not null
public 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-classes
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |