Java 类org.hibernate.validator.Validator 实例源码

项目:spring-rich-client    文件:HibernateRulesMessageInterpolator.java   
/**
 * 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;
    }
}
项目:spring-richclient    文件:HibernateRulesMessageInterpolator.java   
/**
 * 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;
    }
}