You can check the Jakarta Bean Validation 2.0 specification at http://beanvalidation.org/2.0/spec/. The full source code of this recipe is at https://github.com/eldermoraes/javaee8-cookbook/tree/master/chapter01/ch01-beanvalidation/.