Here is the documentation for implementing the user restriction .
Simple failure:
- You define your own annotation with the appropriate attributes
- You define a class that will validate
- You define verification messages.
- You are using annotation
So maybe your annotation might look like this:
@Constraint(validatedBy=YourChecker.class) //other annotations public @interface AllowedValues { int[] value(); }
Bozho source share