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 CharSequence must match the specified regular expression. The regular expression follows the Java regular expression conventions see Pattern.

Accepts CharSequence. null elements are considered valid.

Author:
Emmanuel Bernard

Required Element Summary
 String regexp
           
 
Optional Element Summary
 Pattern.Flag[] flags
           
 Class<?>[] groups
           
 String message
           
 Class<? extends Payload>[] payload
           
 

Element Detail

regexp

public abstract String regexp
Returns:
the regular expression to match

flags

public abstract Pattern.Flag[] flags
Returns:
array of Flags 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-2013 Red Hat Inc. All Rights Reserved. Released under the Apache Software License 2.0.