javax.validation.constraints
Annotation Type Pattern


@Target(value={METHOD,FIELD,ANNOTATION_TYPE})
@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 java.util.regex.Pattern. Accepts String. null elements are considered valid.

Author:
Emmanuel Bernard

Required Element Summary
 java.lang.String regexp
          regular expression to match
 
Optional Element Summary
 Pattern.Flag[] flags
          Flags considered when resolving the regular expression
 java.lang.Class<?>[] groups
          groups the constraint belongs to
 java.lang.String message
          error message template
 

Element Detail

regexp

public abstract java.lang.String regexp
regular expression to match

flags

public abstract Pattern.Flag[] flags
Flags considered when resolving the regular expression

Default:
{}

message

public abstract java.lang.String message
error message template

Default:
"{constraint.pattern}"

groups

public abstract java.lang.Class<?>[] groups
groups the constraint belongs to

Default:
{}


Copyright © 2007-2009. All Rights Reserved.