Validating data is a common task that occurs throughout all application layers, from the presentation to the persistence layer.
Often the same validation logic is implemented in each layer which is time consuming and error-prone.
The default metadata source are annotations, with the ability to override and extend the meta-data through the use of XML.
The API is not tied to a specific application tier nor programming model.
It is specifically not tied to either web or persistence tier, and is available for both server-side application programming, as well as rich client Swing application developers.
Hibernate Validator is the reference implementation of this JSR 349.
The implementation itself as well as the Bean Validation API and TCK are all provided and distributed under the Apache Software License 2.0.
Hibernate Validator requires an implementation of the Unified Expression Language (JSR 341) for evaluating dynamic expressions in constraint violation messages (see Section 4.1, “Default message interpolation”).
When your application runs in a Java EE container such as JBoss AS, an EL implementation is already provided by the container.
In a Java SE environment, however, you have to add an implementation as dependency to your POM file.
For instance you can add the following two dependencies to use the JSR 341 reference implementation: EE, JSR 346).