logger.debug("Validating object in path '" + errors.getNestedPath() + "'");
}
// loading the bean validation configuration based on the validated object class.
Class clazz = obj.getClass();
BeanValidationConfiguration configuration = configurationLoader.loadConfiguration(clazz);
if (configuration == null) {
return; // no validation configuration for this object, then there's nothing to validate.
}
// applying all the validation rules for the object and registering the object as "validated"
applyBeanValidation(configuration, obj, errors);
validatedObjects.add(obj);
// after all the validation rules where applied, checking what properties of the object require their own
// validation and recursively calling this method on them.
CascadeValidation[] cascadeValidations = configuration.getCascadeValidations();
BeanWrapper wrapper = wrapBean(obj);
for (int i=0; i<cascadeValidations.length; i++) {
CascadeValidation cascadeValidation = cascadeValidations[i];
Condition applicabilityCondition = cascadeValidation.getApplicabilityCondition();