Achieving data binding with object model

This post explains how to achieve mapping of json data represented by an object model to particular java object. Here object model is tree like data structure which reads and stores the entire json content in memory. The difference between this post and other posts in Binding section is that latter posts explains marshalling and… Continue reading Achieving data binding with object model

Creating and Writing JSON object model to a file

This post explains how to create and save json object model to a file. In the example we build the below json object model representing person information. { “ssn” : “111111111”, “name” : { “firstName” : “Ronald”, “lastName” : “Childs” }, “phoneNumbers” : [ “1112223333”, “4445556666” ] } The main code is as shown below… Continue reading Creating and Writing JSON object model to a file

Reading json data in non-streaming way (object model)

We can read a json file and create an object model of it, using the ObjectMapper’s readTree api. ObjectMapper class is responsible for parsing the json file and create appropriate java objects. It uses Jackson’s parsing feature internally for reading the json file. They are many overloaded method of readTree available in ObjectMapper. In this… Continue reading Reading json data in non-streaming way (object model)