javax.validation.constraints
Annotation Type Pattern
@Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
@Retention(value=RUNTIME)
@Documented
@Constraint(validatedBy={})
public @interface Pattern
The annotated String must match the following regular expression.
The regular expression follows the Java regular expression conventions
see Pattern
.
Accepts String. null
elements are considered valid.
- Author:
- Emmanuel Bernard
regexp
public abstract String regexp
- Returns:
- The regular expression to match.
flags
public abstract Pattern.Flag[] flags
- Returns:
- Array of
Flag
s considered when resolving the regular expression.
- Default:
- {}
message
public abstract String message
- Returns:
- The error message template.
- Default:
- "{javax.validation.constraints.Pattern.message}"
groups
public abstract Class<?>[] groups
- Returns:
- The groups the constraint belongs to.
- Default:
- {}
payload
public abstract Class<? extends Payload>[] payload
- Returns:
- The payload associated to the constraint
- Default:
- {}
Copyright © 2007-2012. All Rights Reserved.