下面这两篇文章对JAVA中注解的实现原理进行简单的讲解,还算比较好理解,可以试着实现简单的demo; 一小时搞明白自定义注解(Annotation) 一小时搞明白注解处理器(Annotation Processor Tool) Android APT(编译时代码生成)最佳实践 demo地址