Annotation Interface Regex


正则表达式校验

默认被校验对象是null时,通过校验

Since:
Java 17+
Author:
Kimi Liu
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    默认使用的异常码
    默认使用的异常信息
    被校验字段名称
    校验器组
     
    boolean
    如果长度为0,判断能否通过校验 默认为false true:表示长度为零,默认通过校验;false:表示长度为0,仍然要进行正则验证
  • Element Details

    • pattern

      @Filler("pattern") String pattern
      Default:
      ""
    • zeroAble

      boolean zeroAble
      如果长度为0,判断能否通过校验 默认为false true:表示长度为零,默认通过校验;false:表示长度为0,仍然要进行正则验证
      Returns:
      the boolean
      Default:
      false
    • errcode

      String errcode
      默认使用的异常码
      Returns:
      the string
      Default:
      "-1"
    • errmsg

      String errmsg
      默认使用的异常信息
      Returns:
      the string
      Default:
      "${field}\u9a8c\u8bc1\u5931\u8d25,\u8bf7\u68c0\u67e5\u6570\u636e\u683c\u5f0f"
    • group

      String[] group
      校验器组
      Returns:
      the array
      Default:
      {}
    • field

      String field
      被校验字段名称
      Returns:
      the string
      Default:
      "field"