}
catch (InvalidPropertyException e) {
dataBinder.getBindingResult().addError(new FieldError("options", e.getPropertyName(), e.getMessage()));
}
CustomValidatorBean validator = new CustomValidatorBean();
validator.afterPropertiesSet();
dataBinder.setValidator(validator);
Class<?>[] groups = determineGroupsToUse(beanWrapper.getWrappedInstance());
dataBinder.validate((Object[]) groups);