Package org.apache.cxf.validation

Examples of org.apache.cxf.validation.ValidationProvider


   
    @Override
    public Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object> params) {
        Message message = JAXRSUtils.getCurrentMessage();
       
        ValidationProvider theProvider = getProvider(message);
       
        if (isValidateServiceObject()) {
            theProvider.validateBean(serviceObject);
        }
       
        theProvider.validateParameters(serviceObject, m, params.toArray());
       
        Object response = super.invoke(exchange, serviceObject, m, params);
       
        if (response instanceof MessageContentsList) {
            MessageContentsList list = (MessageContentsList)response;
            if (list.size() == 1) {
                Object entity = ((MessageContentsList)list).get(0);
               
                if (entity instanceof Response) {
                    theProvider.validateReturnValue(serviceObject, m, ((Response)entity).getEntity());   
                } else {               
                    theProvider.validateReturnValue(serviceObject, m, entity);
                }
            }
        }
       
        return response;
View Full Code Here


        if (provider == null) {
            Object prop = message.getContextualProperty(ValidationProvider.class.getName());
            if (prop != null) {
                provider = (ValidationProvider)prop;   
            } else {
                provider = new ValidationProvider();
            }
        }
        return provider;
    }
View Full Code Here

                new SingletonResourceProvider(new BookStoreWithValidation()));
            sf.setProvider(new ValidationExceptionMapper());

            sf.setAddress("http://localhost:" + PORT + "/");
            JAXRSValidationInInterceptor in = new JAXRSValidationInInterceptor();
            in.setProvider(new ValidationProvider(new JAXRSParameterNameProvider()));
            sf.setInInterceptors(Arrays.< Interceptor< ? extends Message > >asList(
                in));
            
            sf.setOutInterceptors(Arrays.< Interceptor< ? extends Message > >asList(
                new JAXRSOutExceptionMapperInterceptor(),
View Full Code Here

TOP

Related Classes of org.apache.cxf.validation.ValidationProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.