You can create a
DataBinder for the object you are validating, create a
MutablePropertyValues object, set the values you want to set on the object by calling
mutableProperties.add("propertyName", value), call
dataBinder.apply(mutablePropertyValues) to attempt to bind the values to the target object, then call
dataBinder.getBindingResult() - this returns an instance of a
BindingResult, which also implements the
Errors interface. The BindingResult returned originally contains any errors that occurred during the bind, like any conversion/casting errors on the values, but now you can also use the BindingResult to use in your Validator's
validate(target, errors) method.