Package org.dellroad.stuff.validation
Annotation Interface Pattern
@Documented
@Constraint(validatedBy=PatternValidator.class)
@Target({METHOD,FIELD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@ReportAsSingleViolation
public @interface Pattern
Works like the standard
@Pattern
but applies to any
type of object, converting to String
as necessary via Object.toString()
, and recursing
on collection types.-
Required Element Summary
-
Optional Element Summary
-
Element Details
-
regexp
String regexpRegular expression that must be matched.- Returns:
- regular expression
-
-
-
message
String message- Default:
- "Does not match the pattern \"{regexp}\""
-
groups
Class<?>[] groups- Default:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payload- Default:
- {}
-
flags
jakarta.validation.constraints.Pattern.Flag[] flagsRegular expression flags.- Returns:
- regular expression flags
- Default:
- {}
-