Java Reference
In-Depth Information
Latest improvements in action
Chapter 2 of the Bean Validation 1.1 Specification Document presents the major
changes of this version. These are: openness, support for dependency injection,
better integration with CDI, support for method and constructor validation, support
for group conversion, and finally support for message interpolation using expression
language.
Openness
The implementation of the Bean Validation 1.1 Specification has been managed as
an open source project. Thus, the source code, reference implementation and test
compatibility kit of the API are accessible to the community. For more information,
please access the site http://beanvalidation.org .
Support for dependency injection and CDI integration
The Bean Validation 1.1 Specification has standardized the management of objects
used to implement validators inside a container and reviewed all the services that
wereofferedtotheseobjects.ThathelpedsupportdependencyinjectioninBeanVal-
idation components and improve integration with CDI. Henceforth, we can use the
@Resource and @Inject annotations to inject objects of type ValidatorFact-
ory and Validator . The following example demonstrates the use of the @Inject
annotation to validate an object using Bean Validation components:
Search WWH ::




Custom Search