Annotation Interface Each


对数组、集合、Map元素进行校验, 注意,Map对象,只校验内部的值列表

对象为null, 忽略校验

如果不是数组或集合、Map,则忽略校验

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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Matcher>[]
    校验器类数组, 当校验器名称数组为空时,使用校验器类数组中的校验器
    默认使用的异常码
    默认使用的异常信息
    被校验字段名称
    校验器组
    校验器名称数组,优先使用校验器名称中的校验器,并忽略校验器类中的校验器
  • Element Details

    • value

      String[] value
      校验器名称数组,优先使用校验器名称中的校验器,并忽略校验器类中的校验器
      Returns:
      the array
      Default:
      {}
    • classes

      Class<? extends Matcher>[] classes
      校验器类数组, 当校验器名称数组为空时,使用校验器类数组中的校验器
      Returns:
      the object
      Default:
      {}
    • errcode

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

      String errmsg
      默认使用的异常信息
      Returns:
      the string
      Default:
      "${field}\u53c2\u6570\u6821\u9a8c\u5931\u8d25"
    • group

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

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