标签:document key provider update 部分 定义 method 第三方 author
源注解:注解的注解
package com.ann.自己定义注解;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD,ElementType.TYPE})//注解作用范围:方法、类接口
@Retention(RetentionPolicy.RUNTIME)//注解生命周期:SOURCE CLASS RUNTIME
@Inherited//(标识性的原注解)同意子类继承
@Documented//生成javadoc时会包括注解
//使用@integrfacekeyword定义注解,表示定义的不是类也不接口
public @interface Description {
//成员以无參数无异常方式声明
//成员类型是受限的,合法的类型包括原始类型以及String Class Annotation Enumeration
//大部分自己定义的注解用原始类型和String就足够了
//假设注解仅仅有一个成员,则成员名必须取名为value(),在使用时能够忽略成员名和赋值号(=)
//注解类能够没有成员。没有成员的注解称为标识注解
String desc();
String author();
int age() default 18;//能够用default为成员制定一个默认值
}
标签:document key provider update 部分 定义 method 第三方 author
原文地址:http://www.cnblogs.com/yangykaifa/p/6853296.html