@Pattern annotation

back to index

Action

Checks that the value conforms to a specified pattern. Null values are considered incorrect always.

Javadoc Ref :  Javadoc reference@Pattern

 Input Types 1
Object
 Output Types
Object
   

1Automatic conversion will take place if the provided input does not match any of the input classes, as described in the conversions part of the manual.

Arguments

value

Pattern to check

message

Literal message to use if validation fails.

errorCode
Error code to use if validation fails.
messageKey
Message key to use if validation fails.

 

Example

@Pattern("abc*def")
private String field1;