Bean Validation 2.0 Specification

You can read the full Bean Validation 2.0 specification or browse its API JavaDocs.

Changes between Bean Validation 2.0 and 1.1

Bean Validation 2.0 focused on the following topics:

  • support for validating container elements by annotating type arguments of parameterized types e.g. List<@Positive Integer> positiveNumbers. This also includes:

    • more flexible cascaded validation of container types

    • support for java.util.Optional

    • support for the property types declared by JavaFX

    • support for custom container types

  • support for the new date/time data types (JSR 310) for @Past and @Future

  • new built-in constraints: @Email, @NotEmpty, @NotBlank, @Positive, @PositiveOrZero, @Negative, @NegativeOrZero, @PastOrPresent and @FutureOrPresent

  • leverage the JDK 8 new features (built-in constraints are marked repeatable, parameter names are retrieved via reflection)

You can consult an HTML diff between the 1.1 specification and the 2.0 specification here.

For more information, check out the full list of changes.

History

If you are interested in the various drafts that led to Bean Validation 2.0, check out the history page.

Feedback

Do you have feedback? Talk to us:

If you want to take the next step and contribute, read how to contribute.