What is Bean Validation

Bean Validation is a Java specification conducted under the JCP umbrella and lead by Emmanuel Bernard / Red Hat. Bean Validation provides a unified way of declaring and defining constraints on an object model.

public class User {
    @NotNull @Email 
    public String getEmail() { return email; }
    public void setEmail(String email) { 
      this.email = email; 
    }
    private String email;
}

Bean Validation also defines a runtime to validate objects. Layers of your application (presentation, business layer, persistence) can delegate validation logic to Bean Validation and reuse constraints declared on your domain model. In the Java EE space, JSF, JPA, EJB and CDI components are integrating Bean Validation.

Read the Bean Validation 1.0 specification.