Package org.restlet.service

Examples of org.restlet.service.ConverterService.toObject()


    public void testRepresentationToObject() throws IOException, JAXBException {
        ConverterService cs = new ConverterService();
        JaxbRepresentation<Sample> sampleRep = new JaxbRepresentation<Sample>(
                MediaType.APPLICATION_XML, new Sample());
        Object rep = cs.toObject(sampleRep, Sample.class, null);
        assertTrue(rep instanceof Sample);
    }
}
View Full Code Here


    public void testRepresentationToObject() throws IOException {
        ConverterService cs = new ConverterService();
        ClientResource cr = new ClientResource(
                "clap://class/org/restlet/test/ext/atom/entry.xml");
        Representation representation = cr.get();
        Object object = cs.toObject(representation);
        assertTrue(object instanceof Feed);
    }
}
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.