當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalValidatorFactoryBean.setMessageInterpolator方法代碼示例

本文整理匯總了Java中org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.setMessageInterpolator方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalValidatorFactoryBean.setMessageInterpolator方法的具體用法?Java LocalValidatorFactoryBean.setMessageInterpolator怎麽用?Java LocalValidatorFactoryBean.setMessageInterpolator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.validation.beanvalidation.LocalValidatorFactoryBean的用法示例。


在下文中一共展示了LocalValidatorFactoryBean.setMessageInterpolator方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validatorFactoryBean

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
/**
 * Creates the validator factory bean that Spring uses to
 * construct a Validator.
 *
 * @return a Validator Factory Bean
 */
@Bean
public LocalValidatorFactoryBean validatorFactoryBean() {
  BeanConstraintValidatorFactory validatorFactory = ctx.getBean(BeanConstraintValidatorFactory.class);
  MessageInterpolator messageInterpolator = ctx.getBean(MessageInterpolator.class);
  LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean();
  factoryBean.setMessageInterpolator(messageInterpolator);
  factoryBean.setConstraintValidatorFactory(validatorFactory);
  return factoryBean;
}
 
開發者ID:cloudera,項目名稱:cm_ext,代碼行數:16,代碼來源:DefaultValidatorConfiguration.java

示例2: csvLocalValidatorFactoryBean

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
@Description("Spring用のBeanValidatorのValidatorの定義")
public Validator csvLocalValidatorFactoryBean() {
    
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    
    // メッセージなどをカスタマイズ
    validator.setMessageInterpolator(new MessageInterpolatorAdapter(
            springMessageResolver(), new MessageInterpolator()));
    return validator;
}
 
開發者ID:mygreen,項目名稱:super-csv-annotation,代碼行數:12,代碼來源:SpringTestConfig.java

示例3: validator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
    bean.setMessageInterpolator(new ResourceBundleMessageInterpolator());
    return bean;
}
 
開發者ID:mattpwest,項目名稱:entelect-spring-webapp-template,代碼行數:7,代碼來源:SpringMVCConfig.java

示例4: springfieldWebmvcValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean springfieldWebmvcValidator() {
	LocalValidatorFactoryBean v = new LocalValidatorFactoryBean();
	v.setMessageInterpolator(springfieldWebmvcValidatorMessageInterpolator());
	return v;
}
 
開發者ID:u2ware,項目名稱:springfield,代碼行數:7,代碼來源:WebmvcConfiguration.java

示例5: mvcValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean mvcValidator() {
	LocalValidatorFactoryBean v = new LocalValidatorFactoryBean();
	v.setMessageInterpolator(mvcValidatorMessageInterpolator());
	return v;
}
 
開發者ID:u2ware,項目名稱:springfield,代碼行數:7,代碼來源:ContextWebmvcBase.java


注:本文中的org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.setMessageInterpolator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。