@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Column {
String value();
String remark() default "";
}
@interface
是申明一个注解,你可以把它当做是一个标记(或者可以看做是一种特殊的接口), String remark() default "" ,其中String表示返回数据类型,remark()表示方法名,default “”表示默认值为空串(意思就是说使用该注解的时候可以不传这个参数),没有default的方法为必传参数。建议学习一下java注解:最通俗易懂的讲解
这是java8的语法,接口的方法可以拥有default
https://www.cnblogs.com/deptop/p/9150592.html
Java Annotation 的定义。
这个是java的自定义注解,之前写过一个简单的使用介绍https://blog.csdn.net/VICTOR_fusheng/article/details/100039449
想了解更多可以搜索java自定义注解看看