org.apache.cxf.validation.BeanValidationProvider Java Examples
The following examples show how to use
org.apache.cxf.validation.BeanValidationProvider.
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: JAXRSClientServerValidationTest.java From cxf with Apache License 2.0 | 6 votes |
protected void run() { JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setResourceClasses(BookStoreWithValidation.class); sf.setResourceProvider(BookStoreWithValidation.class, new SingletonResourceProvider(new BookStoreWithValidation())); sf.setProvider(new ValidationExceptionMapper() { @Override public Response toResponse(ValidationException exception) { Response r = super.toResponse(exception); return JAXRSUtils.toResponseBuilder( r.getStatus()).type("application/xml").entity(new Book("Validation", 123L)).build(); } }); sf.setAddress("http://localhost:" + PORT + "/"); BeanValidationInInterceptor in = new JAXRSBeanValidationInInterceptor(); in.setProvider(new BeanValidationProvider(new JAXRSParameterNameProvider())); sf.setInInterceptors(Arrays.< Interceptor< ? extends Message > >asList( in)); sf.setOutInterceptors(Arrays.< Interceptor< ? extends Message > >asList( new JAXRSBeanValidationOutInterceptor())); sf.create(); }
Example #2
Source File: PackageUtilsTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testSharedPackageNameIgnoreProxyClasses() { // build any proxy object resulting in com.sun.proxy... Object proxy = ProxyHelper.getProxy(BeanValidationProvider.class.getClassLoader(), new Class[]{Serializable.class}, new ReflectionInvokationHandler(new ValidationConfiguration())); String packageName = PackageUtils.getSharedPackageName( Arrays.asList(proxy.getClass(), org.apache.cxf.bus.spring.BusApplicationContext.class, org.apache.cxf.configuration.spring.JAXBBeanFactory.class)); assertEquals("org.apache.cxf", packageName); }
Example #3
Source File: RESTCXFContext.java From syncope with Apache License 2.0 | 4 votes |
@Bean public BeanValidationProvider validationProvider() { return new BeanValidationProvider(); }
Example #4
Source File: RESTCXFTestContext.java From syncope with Apache License 2.0 | 4 votes |
@Bean public BeanValidationProvider validationProvider() { return new BeanValidationProvider(); }
Example #5
Source File: BookStoreWithValidation.java From cxf with Apache License 2.0 | 4 votes |
public void setProvider(BeanValidationProvider provider) { this.provider = provider; }
Example #6
Source File: JAXRSBeanValidationInvoker.java From cxf with Apache License 2.0 | 4 votes |
public void setProvider(BeanValidationProvider provider) { this.provider = provider; }
Example #7
Source File: JAXRSBeanValidationFeature.java From cxf with Apache License 2.0 | 4 votes |
public void setProvider(BeanValidationProvider provider) { delegate.setProvider(provider); }
Example #8
Source File: JAXRSBeanValidationFeature.java From cxf with Apache License 2.0 | 4 votes |
public void setProvider(BeanValidationProvider provider) { this.validationProvider = provider; }