构造器和说明 |
---|
AnnotationUtils() |
限定符和类型 | 方法和说明 |
---|---|
static <A extends Annotation> |
findAnnotation(Class<?> clazz,
Class<A> annotationType)
查询指定class的指定类型的注释,包括该类的接口、父类
|
static <A extends Annotation> |
findAnnotation(Method method,
Class<A> annotationType) |
static Class<?> |
findAnnotationDeclaringClass(Class<? extends Annotation> annotationType,
Class<?> clazz) |
static <A extends Annotation> |
getAnnotation(Method method,
Class<A> annotationType)
如果存在该元素的指定类型的注释,则返回这些注释,否则返回 null。
|
static Map<String,Object> |
getAnnotationAttributes(Annotation annotation)
取得
Annotation 对象的所有属性值 |
static Annotation[] |
getAnnotations(Class<?> clazz) |
static Annotation[] |
getAnnotations(Method method)
返回此元素上存在的所有注释
|
static Object |
getDefaultValue(Annotation annotation)
取得
Annotation 对象的value属性的默认值 |
static Object |
getDefaultValue(Annotation annotation,
String attributeName)
取得
Annotation 对象的指定属性的默认值 |
static Object |
getDefaultValue(Class<? extends Annotation> annotationType) |
static Object |
getDefaultValue(Class<? extends Annotation> annotationType,
String attributeName)
取得
Annotation 的默认属性的默认值 |
static Object |
getValue(Annotation annotation)
取得
Annotation 对象的value值 |
static Object |
getValue(Annotation annotation,
String attributeName)
取得
Annotation 对象的指定属性值 |
static boolean |
isAnnotationDeclaredLocally(Class<? extends Annotation> annotationType,
Class<?> clazz) |
static boolean |
isAnnotationInherited(Class<? extends Annotation> annotationType,
Class<?> clazz) |
public static Annotation[] getAnnotations(Method method)
method
- public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType)
A
- method
- annotationType
- public static <A extends Annotation> A findAnnotation(Method method, Class<A> annotationType)
public static Annotation[] getAnnotations(Class<?> clazz)
public static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A> annotationType)
A
- clazz
- annotationType
- public static Class<?> findAnnotationDeclaringClass(Class<? extends Annotation> annotationType, Class<?> clazz)
public static boolean isAnnotationDeclaredLocally(Class<? extends Annotation> annotationType, Class<?> clazz)
public static boolean isAnnotationInherited(Class<? extends Annotation> annotationType, Class<?> clazz)
annotationType
- clazz
- public static Map<String,Object> getAnnotationAttributes(Annotation annotation)
Annotation
对象的所有属性值annotation
- public static Object getValue(Annotation annotation)
Annotation
对象的value值annotation
- public static Object getValue(Annotation annotation, String attributeName)
Annotation
对象的指定属性值annotation
- attributeName
- public static Object getDefaultValue(Annotation annotation)
Annotation
对象的value属性的默认值annotation
- public static Object getDefaultValue(Annotation annotation, String attributeName)
Annotation
对象的指定属性的默认值annotation
- attributeName
- public static Object getDefaultValue(Class<? extends Annotation> annotationType)
public static Object getDefaultValue(Class<? extends Annotation> annotationType, String attributeName)
Annotation
的默认属性的默认值annotationType
- attributeName
- Copyright © 2016–2018. All rights reserved.