/** * Retrieve the message for the validator. */ public String interpolate(String message, Validator validator, MessageInterpolator defaultInterpolator) { if (annotationMessage != null && annotationMessage.equals(message)) { // short cut return interpolateMessage; } else { message = message.replaceAll("[\\{\\}]", ""); String string = null; string = messageSourceAccessor != null ? messageSourceAccessor.getMessage(message, new Object[0], Locale .getDefault()) : null; if (StringUtils.isEmpty(string)) { log.info("Message not found in messageSourceAccessor (it may not exist), " + "trying Hibernate default messages"); return defaultInterpolator.interpolate(message, validator, defaultInterpolator); } return string; } }