Top Description Inners Methods
jakarta.validation.constraints

public @Interface Pattern

extends Annotation
Annotations
@Target:METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE
@Retention:RUNTIME
@Repeatable:List
@Documented
@Constraint
validatedBy:
Static Imports
java.lang.annotation.ElementType.ANNOTATION_TYPE, .ElementType.CONSTRUCTOR, .ElementType.FIELD, .ElementType.METHOD, .ElementType.PARAMETER, .ElementType.TYPE_USE, .RetentionPolicy.RUNTIME

The annotated CharSequence must match the specified regular expression. The regular expression follows the Java regular expression conventions see java.util.regex.Pattern.

Accepts CharSequence. null elements are considered valid.

Author
Emmanuel Bernard

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Pattern.Flag

Possible Regexp flags.

public static @interface
Pattern.List

Defines several Pattern annotations on the same element.

Method Summary

Modifier and TypeMethod and Description
public Pattern.Flag[]

Returns:

array of Flags considered when resolving the regular expression
flags
()

public Class<?>[]

Returns:

the groups the constraint belongs to
groups
()

public String

Returns:

the error message template
message
()

public Class<? extends Payload>[]

Returns:

the payload associated to the constraint
payload
()

public String

Returns:

the regular expression to match
regexp
()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

flagsback to summary
public Pattern.Flag[] flags()
Returns:Pattern.Flag[]

array of Flags considered when resolving the regular expression

groupsback to summary
public Class<?>[] groups()
Returns:Class<?>[]

the groups the constraint belongs to

messageback to summary
public String message()
Returns:String

the error message template

payloadback to summary
public Class<? extends Payload>[] payload()
Returns:Class<? extends Payload>[]

the payload associated to the constraint

regexpback to summary
public String regexp()
Returns:String

the regular expression to match

jakarta.validation.constraints back to summary

public final Enum Pattern.Flag

extends Enum<Pattern.Flag>
Class Inheritance

Possible Regexp flags.

Field Summary

Modifier and TypeField and Description
public static final Pattern.Flag
CANON_EQ

Enables canonical equivalence.

public static final Pattern.Flag
CASE_INSENSITIVE

Enables case-insensitive matching.

public static final Pattern.Flag
COMMENTS

Permits whitespace and comments in pattern.

public static final Pattern.Flag
DOTALL

Enables dotall mode.

public static final Pattern.Flag
MULTILINE

Enables multiline mode.

public static final Pattern.Flag
UNICODE_CASE

Enables Unicode-aware case folding.

public static final Pattern.Flag
UNIX_LINES

Enables Unix lines mode.

private final int

Constructor Summary

AccessConstructor and Description
private
Flag(int value)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

flag value as defined in java.util.regex.Pattern
getValue
()

public static Pattern.Flag
public static Pattern.Flag[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CANON_EQback to summary
public static final Pattern.Flag CANON_EQ

Enables canonical equivalence.

See Also
java.util.regex.Pattern#CANON_EQ
CASE_INSENSITIVEback to summary
public static final Pattern.Flag CASE_INSENSITIVE

Enables case-insensitive matching.

See Also
java.util.regex.Pattern#CASE_INSENSITIVE
COMMENTSback to summary
public static final Pattern.Flag COMMENTS

Permits whitespace and comments in pattern.

See Also
java.util.regex.Pattern#COMMENTS
DOTALLback to summary
public static final Pattern.Flag DOTALL

Enables dotall mode.

See Also
java.util.regex.Pattern#DOTALL
MULTILINEback to summary
public static final Pattern.Flag MULTILINE

Enables multiline mode.

See Also
java.util.regex.Pattern#MULTILINE
UNICODE_CASEback to summary
public static final Pattern.Flag UNICODE_CASE

Enables Unicode-aware case folding.

See Also
java.util.regex.Pattern#UNICODE_CASE
UNIX_LINESback to summary
public static final Pattern.Flag UNIX_LINES

Enables Unix lines mode.

See Also
java.util.regex.Pattern#UNIX_LINES
valueback to summary
private final int value

Constructor Detail

Flagback to summary
private Flag(int value)

Method Detail

getValueback to summary
public int getValue()
Returns:int

flag value as defined in java.util.regex.Pattern

valueOfback to summary
public static Pattern.Flag valueOf(String name)
valuesback to summary
public static Pattern.Flag[] values()
jakarta.validation.constraints back to summary

public @Interface Pattern.List

extends Annotation
Annotations
@Target:METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE
@Retention:RUNTIME
@Documented

Defines several Pattern annotations on the same element.
See Also
Pattern

Method Summary

Modifier and TypeMethod and Description
public Pattern[]
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public Pattern[] value()