Proposal for method-level validation
This proposition has not been integrated into the core specification
and is not part of it. It remains here for archaeological purposes and
will be seriously considered for a future revision of this
specification. This proposal is likely to be a bit out of sync with
the rest of the specification artifacts.
Note: Bean Validation providers are free to implement this proposal as
a specific extension. Such specific extension could for example be accessed
via the use of the Validator.unwrap method.
A popular demand was to provide a method and parameter level validation
mechanism reusing the constraint descriptions of the specification. This
set of APIs is meant to be used by interceptor frameworks such as:
application frameworks like
JSR-299
component frameworks like Enterprise Java Beans
aspect based frameworks
These frameworks can call the validation APIs to validate either the parameter list or the returned value of a method when such method is called. More precisely, validation occurs around a method invocation. This extension of the Bean Validation API allows to reuse the core engine as well as the constraint definition and declaration for such method level validations.