Bean Validation : Hibernate Validator framework
Bean Validation with Hibernate Validator framework JSR 303 This JSR will define a meta-data model and API for JavaBean TM validation based on annotations, with overrides and extended meta-data through the use of XML validation descriptors. http://jcp.org/en/jsr/detail?id=309 JSR 349 Bean Validation standardizes constraint definition, declaration and validation for the Java platform. For more information on Bean Validation and how to participate, check out http://beanvalidation.org . http://jcp.org/en/jsr/detail?id=349 Hibernate Validator Hibernate Validator 5.x is the reference implementation for JSR 349 - Bean Validation 1.1 of which Red Hat is the specification lead. http://www.hibernate.org/subprojects/validator.html Sample Implementation. In the sample implementation, we have a class User.java with validation annotations. A test class to validate the object and to print the error messages at the console. The code is completely self explanatory. User.java