Annotation Interface NotEmptyPattern


@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Repeatable(List.class) @Documented @Constraint(validatedBy={}) public @interface NotEmptyPattern
表单字段验证:正则表达式

跟 jakarta.validation.constraints.Pattern 的区别在于: 本类校验时,传递过来的参数为null或者""时,不会校验正则表达式

Author:
zuihou
  • Element Details

    • regexp

      String regexp
      Returns:
      the regular expression to match
    • flags

      Returns:
      array of Flags considered when resolving the regular expression
      Default:
      {}
    • message

      String message
      Returns:
      the error message template
      Default:
      "{jakarta.validation.constraints.Pattern.message}"
    • groups

      Class<?>[] groups
      Returns:
      the groups the constraint belongs to
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Returns:
      the payload associated to the constraint
      Default:
      {}