本文整理匯總了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;
}
示例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;
}
示例3: validator
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean validator() {
LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
bean.setMessageInterpolator(new ResourceBundleMessageInterpolator());
return bean;
}
示例4: springfieldWebmvcValidator
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean springfieldWebmvcValidator() {
LocalValidatorFactoryBean v = new LocalValidatorFactoryBean();
v.setMessageInterpolator(springfieldWebmvcValidatorMessageInterpolator());
return v;
}
示例5: mvcValidator
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean mvcValidator() {
LocalValidatorFactoryBean v = new LocalValidatorFactoryBean();
v.setMessageInterpolator(mvcValidatorMessageInterpolator());
return v;
}