package java.lang.annotation;
/**
* 代码注释文档化(javadoc),即:归档时,注释也编译
* @author TCM
* @create 2017年10月17日下午4:47:54
* @since 1.5
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documented {
}
package java.lang.annotation;
/**
* 目的:注释自动继承父类,直至Object为止。
* 注意:从超类继承,而不是接口,即使实现接口,也不继承。
* @author TCM
* @create 2017年10月18日上午8:53:43
* @since 1.5
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Inherited {
}
package java.lang.annotation;
/**
* 目的:所有注解类型都继承该接口
* 1. 该接口不能作为一个注解
* 2. 该接口本身不能定义annotation类型
* @author TCM
* @create 2017年10月18日上午9:15:29
* @since 1.5
*/
public interface Annotation {
/**
* 判定注解是否相等
*/
boolean equals(Object obj);
/**
* 注解的哈希值
*/
int hashCode();
String toString();
/**
* 判定该注解的注解类型
*/
Class<? extends Annotation> annotationType();
}