Package org.apache.cxf.jaxrs.provider

Examples of org.apache.cxf.jaxrs.provider.JSONProvider


        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here


        JAXBElementProvider jaxb = new JAXBElementProvider();
        Map<String, Object> jaxbProperties = new HashMap<String, Object> ();
        jaxbProperties.put(Marshaller.JAXB_FRAGMENT, true);
        jaxb.setMarshallerProperties(jaxbProperties);

        JSONProvider json = new JSONProvider();
        json.setSerializeAsArray(true);

        if (providersProperty != null && !providersProperty.trim().isEmpty()) {
            String[] providers = providersProperty.split(",|;| ");
            List<Object> providerList = new ArrayList<Object>();
            for (String provider : providers) {
View Full Code Here

        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here

        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here

        assertEquals("application/json",
                r.getMetadata().getFirst("Content-Type").toString());
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        new JSONProvider().writeTo(
                (Document)r.getEntity(), Document.class, Document.class,
                  new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE,
                  new MetadataMap<String, Object>(), os);
        String s = os.toString();
        String expected1 =
View Full Code Here

        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here

        JAXBElementProvider jaxb = new JAXBElementProvider();
        Map<String, Object> jaxbProperties = new HashMap<String, Object> ();
        jaxbProperties.put(Marshaller.JAXB_FRAGMENT, true);
        jaxb.setMarshallerProperties(jaxbProperties);

        JSONProvider json = new JSONProvider();
        json.setSerializeAsArray(true);

        return Arrays.asList(jaxb, json);
    }
View Full Code Here

        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here

        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here

        return (Book)u.unmarshal(is);
    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.provider.JSONProvider

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.