Package org.baeldung.jackson.serialization

Examples of org.baeldung.jackson.serialization.ItemSerializer


        final Item myItem = new Item(1, "theItem", new User(2, "theUser"));

        final ObjectMapper mapper = new ObjectMapper();

        final SimpleModule simpleModule = new SimpleModule();
        simpleModule.addSerializer(Item.class, new ItemSerializer());
        mapper.registerModule(simpleModule);

        final String serialized = mapper.writeValueAsString(myItem);
        System.out.println(serialized);
    }
View Full Code Here

TOP

Related Classes of org.baeldung.jackson.serialization.ItemSerializer

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.