Package org.apache.cxf.databinding

Examples of org.apache.cxf.databinding.DataBinding.initialize()


            ((PropertiesAwareDataBinding)db).initialize(props);
        } else {
            if (s instanceof JAXRSServiceImpl) {
                ((JAXRSServiceImpl)s).setCreateServiceModel(true);
            }
            db.initialize(s);
        }
        factory.setUserProviders(Collections.singletonList(new DataBindingProvider(db)));
    }
   
    /**
 
View Full Code Here


            ((PropertiesAwareDataBinding)db).initialize(props);
        } else {
            if (s instanceof JAXRSServiceImpl) {
                ((JAXRSServiceImpl)s).setCreateServiceModel(true);
            }
            db.initialize(s);
        }
        factory.setUserProviders(Collections.singletonList(new DataBindingProvider(db)));
    }
   
    public void setModelBeans(UserResource... resources) {
View Full Code Here

            ((PropertiesAwareDataBinding)db).initialize(props);
        } else {
            if (s instanceof JAXRSServiceImpl) {
                ((JAXRSServiceImpl)s).setCreateServiceModel(true);
            }
            db.initialize(s);
        }
        factory.setUserProviders(Collections.singletonList(new DataBindingProvider<Object>(db)));
    }
   
    /**
 
View Full Code Here

    }
   
    public void testJAXBWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        p.writeTo(b, Book.class, Book.class,
View Full Code Here

    @Test
    public void testJAXBRead() throws Exception {
        String data = "{\"Book\":{\"id\":127,\"name\":\"CXF\",\"state\":\"\"}}";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Book book = (Book)p.readFrom((Class)Book.class, Book.class,
                                      new Annotation[0], MediaType.APPLICATION_JSON_TYPE,
View Full Code Here

   
    @Test
    public void testJAXBWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        Book b = new Book("CXF", 127L);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        p.writeTo(b, Book.class, Book.class,
            new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(), bos);
View Full Code Here

    @Test
    public void testJAXBRead() throws Exception {
        String data = "<Book><id>127</id><name>CXF</name><state></state></Book>";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Book book = (Book)p.readFrom((Class)Book.class, Book.class,
                                      new Annotation[0], MediaType.APPLICATION_XML_TYPE,
                                      new MetadataMap<String, String>(), is);
View Full Code Here

            ((PropertiesAwareDataBinding)db).initialize(props);
        } else {
            if (s instanceof JAXRSServiceImpl) {
                ((JAXRSServiceImpl)s).setCreateServiceModel(true);
            }
            db.initialize(s);
        }
        factory.setUserProviders(Collections.singletonList(new DataBindingProvider(db)));
    }
   
    public void setModelBeans(UserResource... resources) {
View Full Code Here

            ((PropertiesAwareDataBinding)db).initialize(props);
        } else {
            if (s instanceof JAXRSServiceImpl) {
                ((JAXRSServiceImpl)s).setCreateServiceModel(true);
            }
            db.initialize(s);
        }
        factory.setUserProviders(Collections.singletonList(new DataBindingProvider(db)));
    }
   
    public void setModelBeans(UserResource... resources) {
View Full Code Here

    }
   
    public void testJAXBWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider<Book> p = new DataBindingJSONProvider<Book>();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        p.writeTo(b, Book.class, Book.class,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.