Package co.ecg.alpaca.toolkit.validation
Annotation Interface Pattern
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy=PatternValidator.class)
public @interface Pattern
Custom implementation of Pattern that allows the annotated object to be any type.
The validation occurs against the objects toString value.
The regular expression follows the Java regular expression conventions
see
Pattern.
Accepts Any. null elements are considered valid.
- Author:
- Emmanuel Bernard, Matthew Keathley
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPossible Regexp flagsstatic @interfaceDefines several@Patternannotations on the same element -
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
regexp
String regexp- Returns:
- The regular expression to match.
-
flags
Pattern.Flag[] flags- Returns:
- Array of
Flags considered when resolving the regular expression.
- Default:
{}
-
message
String message- Returns:
- The error message template.
- Default:
"{co.ecg.alpaca.toolkit.validation.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:
{}
-