if (!validatorCache.containsKey(contextResolver)) {
final ValidateOnExecutionHandler validateOnExecutionHandler =
new ValidateOnExecutionHandler(validationConfig, !isValidateOnExecutableOverrideCheckDisabled());
final ValidatorContext context = getDefaultValidatorContext(validateOnExecutionHandler);
final ValidationConfig config = contextResolver.getContext(ValidationConfig.class);
if (config != null) {
// MessageInterpolator
if (config.getMessageInterpolator() != null) {
context.messageInterpolator(config.getMessageInterpolator());
}
// TraversableResolver
if (config.getTraversableResolver() != null) {
context.traversableResolver(
getTraversableResolver(config.getTraversableResolver(), validateOnExecutionHandler));
}
// ConstraintValidatorFactory
if (config.getConstraintValidatorFactory() != null) {
context.constraintValidatorFactory(config.getConstraintValidatorFactory());
}
// ParameterNameProvider
if (config.getParameterNameProvider() != null) {
context.parameterNameProvider(config.getParameterNameProvider());
}
}
validatorCache.put(contextResolver,
new ConfiguredValidatorImpl(context.getValidator(), this.validationConfig, validateOnExecutionHandler));