代码:
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* 自定义属性注解
* @author 【】
*
*/
@Target({ ElementType.FIELD, ElementType.TYPE })
@Retention(RUNTIME)
public @interface Comment {
// 定义注解中的属性,默认值为空字符串
String value() default "";
}