mdsh.com/wiki


RecentChanges

TextFormattingRules
AllWikiTopics
OrphanedWikiTopics
ToDoWikiTopics
WikiLockList
RSS
Export2HTML

WikiSearch

SetUsername

StartingPoints
Home
JSON

Libraries for using JSON in Java

JSON-simple


http://code.google.com/p/json-simple/
Quite simple to turn a JSON string into an object graph of JSONObject, JSONArray, and Java primitive types.
Using JXPath http://commons.apache.org/jxpath/ you can get at the values held in the ojject graph that JSON-simple returns.

JSON.org


http://www.json.org/java/index.html
You get a bunch of source code classes in the default package which you have to turn into something useful.
But useful it is.
Also quite simple to turn a JSON string into an object graph of JSONObject, JSONArray, and Java primitive types. But you can also convert JSON <==> XML, and other conversions.

google-gson


http://code.google.com/p/google-gson/
More complex, and yet more elegant.
You need to know the schema of your data because, unlike the two examples above, you tell the deserialisor what object type to deserialise the JSON into.
This is similar to unmarshaling XML into objects.

JSON is mentioned on: StartingPoints


VeryQuickWiki Version 2.8.1 | Admin

All contents copyright mdsh.com (C) 2011-2023.