Java自定义属性注解

代码:

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 "";
}
原文地址:https://www.cnblogs.com/Big-Boss/p/9771940.html