public class AnnotationUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static Field |
AnnotationData_annotations |
static Constructor<?> |
AnnotationData_constructor |
static Field |
AnnotationData_declaredAnotations |
static Constructor<?> |
AnnotationInvocationHandler_constructor |
static Method |
Atomic_casAnnotationData |
static Class<?> |
Atomic_class |
static Method |
Class_annotationData |
static Field |
Class_classRedefinedCount |
static Field |
Field_Excutable_DeclaredAnnotations |
static Field |
Field_Field_DeclaredAnnotations |
| 构造器和说明 |
|---|
AnnotationUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addAnnotation(Class<?> c,
Annotation 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 Object |
createAnnotationData(Class<?> c,
Object annotationData,
Annotation annotation,
int classRedefinedCount) |
static <T extends Annotation> |
createAnnotationFromMap(Class<T> annotationClass,
Map<String,Object> valuesMap)
Create annotation from the given map.
|
public static final Constructor<?> AnnotationInvocationHandler_constructor
public static final Constructor<?> AnnotationData_constructor
public static final Method Class_annotationData
public static final Field Class_classRedefinedCount
public static final Field AnnotationData_annotations
public static final Field AnnotationData_declaredAnotations
public static final Method Atomic_casAnnotationData
public static final Class<?> Atomic_class
public static final Field Field_Excutable_DeclaredAnnotations
public static final Field Field_Field_DeclaredAnnotations
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 void addAnnotation(Field field, Annotation annotation)
field - annotation - Field,
createAnnotationFromMap(Class, Map),
ReflectUtil.getRootFields(Class)public static void addAnnotation(Class<?> c, Annotation annotation)
c - annotation - Class,
createAnnotationFromMap(Class, Map)public static Object createAnnotationData(Class<?> c, Object annotationData, Annotation annotation, int classRedefinedCount) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
public static <T extends Annotation> T createAnnotationFromMap(Class<T> annotationClass, Map<String,Object> valuesMap)
annotationClass - valuesMap - Copyright © 2017. All rights reserved.