本文整理汇总了Java中org.springframework.validation.beanvalidation.MethodValidationPostProcessor类的典型用法代码示例。如果您正苦于以下问题:Java MethodValidationPostProcessor类的具体用法?Java MethodValidationPostProcessor怎么用?Java MethodValidationPostProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MethodValidationPostProcessor类属于org.springframework.validation.beanvalidation包,在下文中一共展示了MethodValidationPostProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cronTaskWithMethodValidation
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Test(expected = BeanCreationException.class)
public void cronTaskWithMethodValidation() throws InterruptedException {
BeanDefinition validationDefinition = new RootBeanDefinition(MethodValidationPostProcessor.class);
BeanDefinition processorDefinition = new RootBeanDefinition(ScheduledAnnotationBeanPostProcessor.class);
BeanDefinition targetDefinition = new RootBeanDefinition(CronTestBean.class);
context.registerBeanDefinition("methodValidation", validationDefinition);
context.registerBeanDefinition("postProcessor", processorDefinition);
context.registerBeanDefinition("target", targetDefinition);
context.refresh();
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:ScheduledAnnotationBeanPostProcessorTests.java
示例2: testMethodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Test
public void testMethodValidationPostProcessor() {
StaticApplicationContext ac = new StaticApplicationContext();
ac.registerSingleton("mvpp", MethodValidationPostProcessor.class);
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.add("beforeExistingAdvisors", false);
ac.registerSingleton("aapp", AsyncAnnotationBeanPostProcessor.class, pvs);
ac.registerSingleton("bean", MyValidBean.class);
ac.refresh();
doTestProxyValidation(ac.getBean("bean", MyValidInterface.class));
ac.close();
}
示例3: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor(Validator validator) {
MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
processor.setValidator(validator);
return processor;
}
示例4: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor(ConstraintViolationExceptionMapper<?> exceptionMapper) {
MethodValidationPostProcessor postProcessor = new CustomMethodValidationPostProcessor(exceptionMapper);
postProcessor.setValidator(localValidatorFactoryBean());
return postProcessor;
}
示例5: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor(){
return new MethodValidationPostProcessor();
}
示例6: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
return new MethodValidationPostProcessor();
}
示例7: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
return new MethodValidationPostProcessor();
}
示例8: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public BeanPostProcessor methodValidationPostProcessor() {
MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
return processor;
}
示例9: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() throws ClassNotFoundException {
MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
processor.setValidator(this.localValidatorFactoryBean());
return processor;
}
示例10: getMethodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor getMethodValidationPostProcessor(Validator validator) {
MethodValidationPostProcessor methodValidationPostProcessor = new MethodValidationPostProcessor();
methodValidationPostProcessor.setValidator(validator);
return methodValidationPostProcessor;
}
示例11: getMethodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor getMethodValidationPostProcessor() {
final MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
processor.setValidator(validator());
return processor;
}
示例12: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
/**
* 注册bean验证
* @return
*/
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor(){
MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
return processor;
}
示例13: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {//用于参数验证
return new MethodValidationPostProcessor();
}
示例14: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {//开启bean验证
return new MethodValidationPostProcessor();
}
示例15: methodValidationPostProcessor
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; //导入依赖的package包/类
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
processor.setValidator(validator());
return processor;
}