Java Code Examples for org.springframework.validation.beanvalidation.MethodValidationPostProcessor#setValidator()

The following examples show how to use org.springframework.validation.beanvalidation.MethodValidationPostProcessor#setValidator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MethodValidationTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Bean
public static MethodValidationPostProcessor methodValidationPostProcessor(@Lazy Validator validator) {
	MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
	postProcessor.setValidator(validator);
	postProcessor.setProxyTargetClass(true);
	return postProcessor;
}
 
Example 2
Source File: ValidatorConfig.java    From Milkomeda with MIT License 5 votes vote down vote up
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
    MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
    // 设置validator模式为快速失败返回
    postProcessor.setValidator(validator());
    return postProcessor;
}
 
Example 3
Source File: MethodValidationTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Bean
public static MethodValidationPostProcessor methodValidationPostProcessor(@Lazy Validator validator) {
	MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
	postProcessor.setValidator(validator);
	postProcessor.setProxyTargetClass(true);
	return postProcessor;
}
 
Example 4
Source File: ValidatorConfig.java    From spring-boot-vue-admin with Apache License 2.0 5 votes vote down vote up
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
  final MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
  // 设置 validator 模式为快速失败返回
  postProcessor.setValidator(this.validatorFailFast());
  return postProcessor;
  // 默认是普通模式,会返回所有的验证不通过信息集合
  // return new MethodValidationPostProcessor();
}
 
Example 5
Source File: MethodValidationTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Bean
public static MethodValidationPostProcessor methodValidationPostProcessor(@Lazy Validator validator) {
	MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
	postProcessor.setValidator(validator);
	return postProcessor;
}
 
Example 6
Source File: MethodValidationTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public static MethodValidationPostProcessor methodValidationPostProcessor(@Lazy Validator validator) {
	MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
	postProcessor.setValidator(validator);
	return postProcessor;
}