注释类型 ErrorCode


@Target(TYPE) @Retention(RUNTIME) @Documented @Overlay public @interface ErrorCode
用来标识一个类是错误代码类,该类中,所有的public static final int类型的域均会作为错误信息进行注册

获取一个code的模板时,如果指定了ErrorCode.Template.value(),则使用此模板,否则concrete会通过I18N进行搜索, 键为: ErrorCode.value() + '.' + Key.value(); Key.value默认为code的值,ErrorCode.value的默认值为“message”

  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    static @interface 
    错误代码模板在I18N中的键
    static @interface 
    该类型为客户端请求错误,服务端默认不显示
    static @interface 
    错误代码的模板
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
     
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final String
     
  • 字段详细资料

  • 元素详细资料

    • value

      String value
      返回:
      此异常类的命名空间,默认为message
      默认值:
      "message"