home | news | road map | contribute | forum | bug tracker
Bean Validation
Welcome to the Bean Validation specification website.
What is Bean Validation
Bean Validation is a Java specification which
- lets you express constraints on object models via annotations
- lets you write custom constraints in an extensible way
- provides the APIs to validate objects and object graphs
- provides the APIs to validate parameters and return values of methods and constructors
- reports the set of violations (localized)
- runs in Java SE but is integrated in Java EE (6 and 7)
public class User {
@NotNull @Email
public String getEmail() { return email; }
public void setEmail(String email) {
this.email = email;
}
private String email;
}
public class UserService {
public void createUser(@Email email,
@NotNull String name) {
}
}
While you can run validation manually, it is more natural to let other specifications and framework validate data at the right time (user input in presentation frameworks, business service execution by CDI, entity insert or update by JPA).
In other words, run once, constrain anywhere.
Latest news
Stay up to date, subscribe to the news feed.
Bean Validation 1.1 is a spec
02 May 2013
It's now official, these couple of years of work have made it into an
official JCP specification.
Bean Validation is also part of Java EE 7 which has
been approved too
a few of days ago.
We have already discussed the features at great length here but to do a short
summary:
support for method and constructor...
Bean Validation 1.1 CR3 - Final Approval Ballot
21 March 2013
Bean Validation, Hibernate Validator (its Reference Implementation) and the
Test Compatibility Kit have been handed over to the JCP for what is called the
Final Approval Ballot. That's when the expert committee votes for the go /
no-go of the specification going final as it is.
We have found a few glitches when working...
Bean Validation 1.1 CR1 - Proposed Final Draft
20 February 2013
Our Proposed Final Draft has been officially handed over to the JCP last night.
After a frantic month of work culminating with two weeks of monomaniac focus, we
are finally handing over the Bean Validation 1.1 Proposed Final Draft to the
JCP. Of course everything is open source so you can get it...