}
private boolean invokeValidatorDefaultValidateMethod(Object validator) {
if (validator instanceof Validator) {
// Spring Framework Validator type
Validator springValidator = (Validator) validator;
if (logger.isDebugEnabled()) {
logger.debug("Invoking Spring Validator '" + ClassUtils.getShortName(validator.getClass()) + "'");
}
if (springValidator.supports(model.getClass())) {
MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
model, expressionParser, messageCodesResolver, mappingResults);
if (this.validationHints != null) {
if (springValidator instanceof SmartValidator) {
((SmartValidator) springValidator).validate(model, errors, this.validationHints);
}
else {
logger.warn("Validation hints provided but validator not an instance of SmartValidator: ["
+ springValidator.getClass().getName() + "]");
}
}
else {
springValidator.validate(model, errors);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Spring Validator '" + ClassUtils.getShortName(validator.getClass())
+ "' doesn't support model class " + model.getClass());