|
||||||||||
| 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(java.lang.reflect.Method annotationProperty,
java.lang.annotation.Annotation annotation)
|
|
static java.lang.reflect.Method |
getAnnotationPropertyWithName(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String annotationPropertyName)
|
|
static
|
getClassLevelAnnotation(java.lang.Class<T> annotationClass,
java.lang.Class<?> clazz)
|
|
static
|
getClassLevelAnnotationProperty(java.lang.Class<S> annotationClass,
java.lang.String annotationPropertyName,
T defaultValue,
java.lang.Class<?> clazz)
|
|
static
|
getFieldLevelAnnotations(java.lang.Class<?> clazz,
java.lang.Class<T> annotation)
|
|
static
|
getFieldsAnnotatedWith(java.lang.Class<? extends java.lang.Object> clazz,
java.lang.Class<T> annotation)
Returns the given class's declared fields that are marked with the given annotation |
|
static
|
getMethodLevelAnnotations(java.lang.Class<?> clazz,
java.lang.Class<T> annotation)
|
|
static
|
getMethodOrClassLevelAnnotation(java.lang.Class<T> annotationClass,
java.lang.reflect.Method method,
java.lang.Class<?> clazz)
|
|
static
|
getMethodOrClassLevelAnnotationProperty(java.lang.Class<S> annotationClass,
java.lang.String annotationPropertyName,
T defaultValue,
java.lang.reflect.Method method,
java.lang.Class<?> clazz)
|
|
static
|
getMethodsAnnotatedWith(java.lang.Class<?> clazz,
java.lang.Class<T> annotation)
Returns the given class's (and superclasses) declared methods that are marked with the given annotation |
|
static
|
getMethodsAnnotatedWith(java.lang.Class<?> clazz,
java.lang.Class<T> annotation,
boolean includeInherited)
Returns the given class's declared methods that are marked with the given annotation |
|
static boolean |
hasClassMethodOrFieldLevelAnnotation(java.lang.Class<?> clazz,
java.lang.Class<? extends java.lang.annotation.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 java.lang.annotation.Annotation> java.util.Set<java.lang.reflect.Field> getFieldsAnnotatedWith(java.lang.Class<? extends java.lang.Object> clazz,
java.lang.Class<T> annotation)
clazz - The class, not nullannotation - The annotation, not null
public static <T extends java.lang.annotation.Annotation> java.util.Set<java.lang.reflect.Method> getMethodsAnnotatedWith(java.lang.Class<?> clazz,
java.lang.Class<T> annotation)
clazz - The class, not nullannotation - The annotation, not null
public static <T extends java.lang.annotation.Annotation> java.util.Set<T> getMethodLevelAnnotations(java.lang.Class<?> clazz,
java.lang.Class<T> annotation)
public static <T extends java.lang.annotation.Annotation> java.util.Set<T> getFieldLevelAnnotations(java.lang.Class<?> clazz,
java.lang.Class<T> annotation)
public static <T extends java.lang.annotation.Annotation> java.util.Set<java.lang.reflect.Method> getMethodsAnnotatedWith(java.lang.Class<?> clazz,
java.lang.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 java.lang.annotation.Annotation> T getMethodOrClassLevelAnnotation(java.lang.Class<T> annotationClass,
java.lang.reflect.Method method,
java.lang.Class<?> clazz)
public static <T extends java.lang.annotation.Annotation> T getClassLevelAnnotation(java.lang.Class<T> annotationClass,
java.lang.Class<?> clazz)
public static <S extends java.lang.annotation.Annotation,T> T getMethodOrClassLevelAnnotationProperty(java.lang.Class<S> annotationClass,
java.lang.String annotationPropertyName,
T defaultValue,
java.lang.reflect.Method method,
java.lang.Class<?> clazz)
public static <S extends java.lang.annotation.Annotation,T> T getClassLevelAnnotationProperty(java.lang.Class<S> annotationClass,
java.lang.String annotationPropertyName,
T defaultValue,
java.lang.Class<?> clazz)
public static java.lang.reflect.Method getAnnotationPropertyWithName(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String annotationPropertyName)
public static <T> T getAnnotationPropertyValue(java.lang.reflect.Method annotationProperty,
java.lang.annotation.Annotation annotation)
public static boolean hasClassMethodOrFieldLevelAnnotation(java.lang.Class<?> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||