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

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

Element Detail

regexp

public abstract java.lang.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 java.lang.String message
Returns:
The error message template.
Default:
"{javax.validation.constraints.Pattern.message}"

groups

public abstract java.lang.Class<?>[] groups
Returns:
The groups the constraint belongs to.
Default:
{}

payload

public abstract java.lang.Class<? extends Payload>[] payload
Returns:
The payload associated to the constraint
Default:
{}


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41