Package com.fasterxml.jackson.dataformat.xml

Examples of com.fasterxml.jackson.dataformat.xml.XmlMapper.writeValueAsString()


    public void testAttributeAndElement() throws IOException
    {
        XmlMapper mapper = new XmlMapper();
        mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()));
        String xml = mapper.writeValueAsString(new Problem("x", "Stuff"));
        assertEquals("<problem id=\"x\"><description>Stuff</description></problem>", xml);
    }
}
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.