public class AnnotationUtil extends Object
| 构造器和说明 |
|---|
AnnotationUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T extends Annotation> |
addAnnotation(Class<?> c,
T annotation) |
static void |
addAnnotation(Executable ex,
Annotation annotation)
Add annotation to Executable(Method or Constructor)
Note that you may need to give the root method. |
static void |
addAnnotation(Field field,
Annotation annotation)
Add annotation to Field
Note that you may need to give the root field. |
static Object |
changeAnnotationValue(Annotation annotation,
String key,
Object newValue)
Changes the annotation value for the given key of the given annotation to newValue and returns
the previous value.
|
static <T extends Annotation> |
copyAnnotation(T anno) |
static <T extends Annotation> |
createAnnotationFromMap(Class<T> annotationClass,
Map<String,Object> valuesMap)
Create annotation from the given map.
|
static <T extends Annotation> |
getAnnotationDefaultMap(Class<T> annotationClass) |
static <T extends Annotation> |
removeAnnotation(Class<?> c,
Class<T> annotationType) |
static <T extends Annotation> |
removeAnnotation(Executable ex,
Class<T> annotationType) |
static <T extends Annotation> |
removeAnnotation(Field field,
Class<T> annotationType) |
public static Object changeAnnotationValue(Annotation annotation, String key, Object newValue)
public static void addAnnotation(Executable ex, Annotation annotation)
ex - annotation - Executable,
createAnnotationFromMap(Class, Map),
ReflectUtil.getRootMethods(Class)public static <T extends Annotation> T removeAnnotation(Executable ex, Class<T> annotationType)
public static void addAnnotation(Field field, Annotation annotation)
field - annotation - Field,
createAnnotationFromMap(Class, Map),
ReflectUtil.getRootFields(Class)public static <T extends Annotation> T removeAnnotation(Field field, Class<T> annotationType)
public static <T extends Annotation> void addAnnotation(Class<?> c, T annotation)
c - annotation - Class,
createAnnotationFromMap(Class, Map)public static <T extends Annotation> T removeAnnotation(Class<?> c, Class<T> annotationType)
public static <T extends Annotation> T createAnnotationFromMap(Class<T> annotationClass, Map<String,Object> valuesMap)
annotationClass - valuesMap - public static <T extends Annotation> Map<String,Object> getAnnotationDefaultMap(Class<T> annotationClass)
public static <T extends Annotation> T copyAnnotation(T anno)
Copyright © 2018. All rights reserved.