总结了主要内容:
@CustomTypeAnnotationpublic class MyAnnotatedClass { @CustomFieldAnnotation private String foo; @CustomConstructorAnnotation public MyAnnotatedClass() { } @CustomMethodAnnotation public String bar(@CustomParameterAnnotation String str) { @CustomLocalVariableAnnotation String asdf = "asdf"; return asdf + str; }}ANNOTATION_TYPE是另一个注释上的注释,如下所示:
@CustomAnnotationTypeAnnotationpublic @interface SomeAnnotation { ..}包是在包中的
package-info.java文件中定义的,如下所示:
@CustomPackageLevelAnnotationpackage com.some.package;import com.some.package.annotation.PackageLevelAnnotation;



