运行时的注解如何被处理的
[举例]

java虚拟机运行api反射机制运行注解
注解语法
modifers @interface AnnotationName {
elementDeclaration1
elementDeclaration2
}
// 其中每个元素
type elementName()
注解元素类型
. 基本类型
. String
. Class
. enum 类型
. 注解类型
相关的标准注解

其中用于编译的注解
@Deprecated注解可以被添加到任何不被鼓励使用的项上
@SuppressWarnngs('unChecked')主旨特定类型的警告信息
@Override
@Generated
用于管理资源的注解
@PostContruct和@PreDestory注解用于控制对象生命周期
@Resource注解用于资源注入
元注解
@Target注解限制注解使用在哪方面上
@Documented
@Serializable
网友评论