getAnnotation
原文:http://www.apihome.cn/api/java/Field.html
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
- 从接口
AnnotatedElement复制的描述 - 如果存在该元素的指定类型的注释,则返回这些注释,否则返回 null。
- 指定者:
- 接口
AnnotatedElement中的getAnnotation - 覆盖:
- 类
AccessibleObject中的getAnnotation
- 参数:
annotationClass- 对应于注释类型的 Class 对象- 返回:
- 如果该元素的指定注释类型的注释存在于此对象上,则返回这些注释,否则返回 null
- 抛出:
NullPointerException- 如果给定的注释类为 null- 从以下版本开始:
- 1.5

浙公网安备 33010602011771号