Package com.fasterxml.jackson.dataformat.xml

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


        xmlMapper.configure(MapperFeature.AUTO_DETECT_FIELDS, false );
        xmlMapper.configure(MapperFeature.AUTO_DETECT_GETTERS, false );
        xmlMapper.configure(MapperFeature.AUTO_DETECT_IS_GETTERS, false );
        xmlMapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false );

        String xml = xmlMapper.writerWithView(RestrictedView.class).writeValueAsString(foo);
       
        // views not used for deserialization
        Foo result = xmlMapper.readValue(xml, Foo.class);
        assertEquals("test", result.restrictedFooProperty);
        assertNotNull(result.bars);
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.