What are custom constraints
Chapter 3. Creating custom constraints 3.1. Creating a simple constraint 3.1.1. The constraint annotation 3.1.2. The constraint validator 3.1.3. The error message 3.1.4. Using the constraint 3.2. Constraint composition Though the Bean Validation API defines a whole set of standard constraint annotations one can easily think of situations in which these standard annotations won't suffice. For these cases you are able to create custom constraints tailored to your specific validation requirements in a simple manner.