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或者""时,不会校验正则表达式
- 作者:
- zuihou
-
嵌套类概要
嵌套类修饰符和类型类说明static enumPossible Regexp flags.static @interfaceDefines severalNotEmptyPatternannotations on the same element. -
必需元素概要
所需元素 -
可选元素概要
可选元素
-
元素详细资料
-
regexp
String regexp- 返回:
- the regular expression to match
-
-
-
flags
NotEmptyPattern.Flag[] flags- 返回:
- array of
Flags considered when resolving the regular expression
- 默认值:
- {}
-
message
String message- 返回:
- the error message template
- 默认值:
- "{jakarta.validation.constraints.Pattern.message}"
-
groups
Class<?>[] groups- 返回:
- the groups the constraint belongs to
- 默认值:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payload- 返回:
- the payload associated to the constraint
- 默认值:
- {}
-