Bean Validation is defined as JSR 349, and the complete specification can be downloaded.
Bean Validation provides a class-level constraint declaration and validation facility for Java applications.
The constraints can be declared in the form of annotations placed on a field, property, method parameter, or class. Constraints can be defined on interfaces or superclasses. Specifying a constraint on an interface ensures the constraint is enforced on classes implementing the interface. Similarly, all classes inheriting from a superclass inherit the validation behavior as well. Constraints declared on an interface or superclass are validated along with any constraints defined on the implementing or overriding class.
Validation constraints and configuration information can also be defined through XML validation descriptors in META-INF/validation.xml. The descriptors override and extend the metadata defined via annotations. This chapter will cover annotation-based constraint validations only.
The specification also includes a constraint metadata repository and the capability to query it. This is primarily targeted toward tool development as well as integration with other frameworks and libraries.
Bean Validation offers a built-in set of constraint definitions that can be used on beans. Multiple constraints can be specified on a bean to ensure different validation requirements are met. These constraints can also be used for composing other constraints. ...