请问能举一个源码注解的例子吗?
查看spring注解的源码吧
// 课的状态 public enum ClassType { @ClassEnum(ZH_Message = "课已经结束",EN_Message = "Class was end") CLASS_END, @ClassEnum(ZH_Message = "课已经取消",EN_Message = "Class was cancal") CLASS_CANCAL, }
@Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface ClassEnum { String EN_Message(); String ZH_Message(); }
java 的源代码 中一时没找到。但是枚举注解非常有用。比如上面 的:中文,英文