O'Reilly logo

Mastering NetBeans by David Salter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Java Bean Validation framework

The Java Bean Validation framework 1.0 (JSR 303) was introduced into Java EE 6 to allow validation constraints to be added onto Java beans. The latest release of the Bean Validation framework, version 1.1 (JSR 349), further enhances the validation model, allowing additional features such as method level validation and full support for CDI.

Bean Validation works by adding a constraint onto a field, method, or class in the form of an annotation. The framework provides many constraints as well as an API, allowing new constraints to be developed. Some of the more common annotations are:

  • @NotNull: The value of the property must not be null
  • @Pattern: The value of the property conforms to the specified regular expression ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required