Java Bean Validation - Dynamic Constraint Application

Is there a way in Java Bean Validation (JSR 303) to programmatically (dynamically) add constraints to the code before the validation method is called (in addition to the constraints declared as annotations in the bean)?

+4
source share
1 answer

The specification states

This JSR defines a metadata model and API for validating a JavaBean. The default metadata source is annotations, with the ability to override and extend metadata using XML validation descriptors.

therefore, I assume that if any software configuration exists, it is implementation-specific and therefore not portable.

+3
source

Source: https://habr.com/ru/post/1395861/


All Articles