Using hibernate-validator-4.2.0.Final.jar
and the ClassValidator
class is nowhere to be found inside of it. The official PDF for the 3.1.0.GA
release shows it as existing inside the org.hibernate.validator
package, but inside both my jar and the official repo it is not there.
This leads me to believe either:
If it has been deprecated then what is the best way to use the annotations and to check if something validates (or not)? If it has been deprecated, then the "old" way of doing this was to use:
ClassValidator<SomeBeanClass> validator = new ClassValidator<SomeBeanClass>();
SomeBeanClass bean = new SomeBeanClass();
// use bean
InvalidValues[] badVals = validator.getInvalidValues(bean);
And if its been moved, then where is it?!?! Thanks in advance!
ClassValidator
is part of the 3.x version of Hibernate Validator.
Hibernate Validator 4.x is a new development which is also the reference implementation of JSR 303 ("Bean Validation"). The equivalent class there is javax.validation.Validator
.
I recommend to have a look at the quickstart guide of the HV 4.x reference manual which gives an introduction on how to use the API.