Package jakarta.validation.constraints
Annotation Type Pattern
-
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Repeatable(List.class) @Documented @Constraint(validatedBy={}) public @interface Pattern
The annotatedCharSequence
must match the specified regular expression. The regular expression follows the Java regular expression conventions seePattern
.Accepts
CharSequence
.null
elements are considered valid.- Author:
- Emmanuel Bernard
-
-
Element Detail
-
regexp
String regexp
- Returns:
- the regular expression to match
-
-
-
flags
Pattern.Flag[] flags
- Returns:
- array of
Flag
s 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:
- {}
-
-