Creating a simple constraint - The error message
3.1.3. The error message Finally we need to specify the error message, that shall be used, in case a @CheckCase constraint is violated. To do so, we add the following to our custom ValidationMessages.properties (see also Section 2.2.4, “Message interpolation”) Example 3.6. Defining a custom error message for the CheckCase constraint com.mycompany.constraints.CheckCase.message=Case mode must be {value}. If a validation error occurs, the validation runtime will use the default value, that we specified for the message attribute of the @CheckCase annotation to look up the error message in this file.