Open Draymonders opened 4 years ago
javac xxx.java => 生成 xxx.class
javap -v xxx => 反编译xxx.class
AnnotationElement
三个常用的方法
// 获取类型为T的注解
<T extends Annotation> T getAnnotation(Class<T> var1);
// 获取所有的注解
Annotation[] getAnnotations();
// 判断当前元素是否含有 annotationClass 注解
default boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
return this.getAnnotation(annotationClass) != null;
}
三种注解