Package com.sun.jersey.api.json

Examples of com.sun.jersey.api.json.JSONJAXBContext.createUnmarshaller()


        System.out.println("\nMarshalled JSON:");
        System.out.println(writer.toString());

        // Unmarshal
        final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        final JAXBElement<ComplexXmlEventBean> unmarshal = unmarshaller.unmarshal(
                Stax2JsonFactory.createReader(new StringReader(writer.toString()), configuration, null,
                        ComplexXmlEventBean.class, jaxbContext, false),
                ComplexXmlEventBean.class);
View Full Code Here


    public void testExtensibility() throws Exception {
        String baseXml = JSONTestHelper.getResourceAsString("com/sun/jersey/json/impl/rim/", "LightningDataset.xml");
        JSONJAXBContext jsonContext = new JSONJAXBContext(JSONConfiguration.natural().build(), "com.sun.jersey.json.impl.rim");

        Unmarshaller jaxbUnmarshaller = jsonContext.createUnmarshaller();
        Object fromXml = jaxbUnmarshaller.unmarshal(new StringReader(baseXml));

        StringWriter sw = new StringWriter();

        jsonContext.createJSONMarshaller().marshallToJSON(fromXml, sw);
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.