org.springframework.validation.beanvalidation.CustomValidatorBean Java Examples

The following examples show how to use org.springframework.validation.beanvalidation.CustomValidatorBean. 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
@Test
public void testLazyValidatorForMethodValidation() {
	@SuppressWarnings("resource")
	AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(
			LazyMethodValidationConfig.class, CustomValidatorBean.class,
			MyValidBean.class, MyValidFactoryBean.class);
	ctx.getBeansOfType(MyValidInterface.class).values().forEach(bean -> bean.myValidMethod("value", 5));
}
 
Example #2
Source File: MethodValidationTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testLazyValidatorForMethodValidationWithProxyTargetClass() {
	@SuppressWarnings("resource")
	AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(
			LazyMethodValidationConfigWithProxyTargetClass.class, CustomValidatorBean.class,
			MyValidBean.class, MyValidFactoryBean.class);
	ctx.getBeansOfType(MyValidInterface.class).values().forEach(bean -> bean.myValidMethod("value", 5));
}
 
Example #3
Source File: MethodValidationTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testLazyValidatorForMethodValidation() {
	AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(
			LazyMethodValidationConfig.class, CustomValidatorBean.class,
			MyValidBean.class, MyValidFactoryBean.class);
	ctx.getBeansOfType(MyValidInterface.class).values().forEach(bean -> bean.myValidMethod("value", 5));
}
 
Example #4
Source File: MethodValidationTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testLazyValidatorForMethodValidationWithProxyTargetClass() {
	AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(
			LazyMethodValidationConfigWithProxyTargetClass.class, CustomValidatorBean.class,
			MyValidBean.class, MyValidFactoryBean.class);
	ctx.getBeansOfType(MyValidInterface.class).values().forEach(bean -> bean.myValidMethod("value", 5));
}
 
Example #5
Source File: BindingService.java    From spring-cloud-stream with Apache License 2.0 5 votes vote down vote up
public BindingService(BindingServiceProperties bindingServiceProperties,
		BinderFactory binderFactory, TaskScheduler taskScheduler) {
	this.bindingServiceProperties = bindingServiceProperties;
	this.binderFactory = binderFactory;
	this.validator = new CustomValidatorBean();
	this.validator.afterPropertiesSet();
	this.taskScheduler = taskScheduler;
}