|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.test4j.tools.commons.AnnotationHelper
public class AnnotationHelper
Annotation工具类
| 构造方法摘要 | |
|---|---|
AnnotationHelper()
|
|
| 方法摘要 | ||
|---|---|---|
static
|
getAnnotationPropertyValue(Method annotationProperty,
Annotation annotation)
|
|
static
|
getClassLevelAnnotation(Class<T> annotationClass,
Class clazz)
|
|
static
|
getClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Class clazz)
获得class上annotation的属性值 |
|
static
|
getClassWithAnnotation(Class<T> annotationClass,
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)
获得方法或者class上annotation的属性值 |
|
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)
|
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public AnnotationHelper()
| 方法详细信息 |
|---|
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 <T extends Annotation> Class getClassWithAnnotation(Class<T> annotationClass,
Class clazz)
public static <S extends Annotation,T> T getMethodOrClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Method method,
Class clazz)
S - T - annotationClass - 要获取属性的Annotation classannotationPropertyName - 要获取的属性值的属性名称defaultValue - 属性的默认值method - 要获取Annotation属性的方法clazz - 要获取Annotation属性的类
public static <S extends Annotation,T> T getClassLevelAnnotationProperty(Class<S> annotationClass,
String annotationPropertyName,
T defaultValue,
Class clazz)
S - T - annotationClass - 要获取属性的Annotation classannotationPropertyName - 要获取的属性值的属性名称defaultValue - 要获取Annotation属性的方法clazz - 要获取Annotation属性的类
public static <T> T getAnnotationPropertyValue(Method annotationProperty,
Annotation annotation)
public static boolean hasClassMethodOrFieldLevelAnnotation(Class clazz,
Class<? extends Annotation> annotation)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||