Home » Core Java » json » Page 2

json

Jackson Tree Model example

In this example we are going to see how to use Jackson Tree Model. This model is very similar in many ways with the DOM representation. We are going to see how to create the tree model and update the JSON object with new values.                   Here is the file we are ...

Read More »

Convert Java Map To / From JSON using Jackson example

With this example we are going to see how to convert a java.util.Map Object to /from JSON representation using the Jackson parser. Converting Map to / from JSON comes naturally because they have a pretty similar representation and usage. Take a look at the precious Jackson tutorial where we showed how to convert a user defined Java Object to / ...

Read More »

Convert Java Object To / From JSON using Jackson example

In this example we are going to see how to conver a Java Object to JSON representation using Jackson. Jackson in a high performance JSON parser and processor java project. 1. Jackson Library The complete Jackson library consists of 6 jar files that are used for many diffident operation. In this example we are going to need just one, mapper-asl.jar. ...

Read More »

JSON parsing with Gson

This is an example of JSON parsing on Android with Gson. Google Gson is a Java library that can be used to convert Java Objects into their JSON representation. In order to parse JSON with Gson, follow these steps: Create a class that extends Activity (here called JsonParsingActivity) Create an instance of the Gson class Use the DefaultHttpClient to retrieve ...

Read More »