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 "";
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM