[4 total ]
XStream is a simple library to serialize objects to XML and back again. Features: Ease of use, no mappings, performance, clean XML, no modifications to classes, integration with XML libraries, full object graph support, customizable conversion strategies.
JSON-lib is a java library for transforming beans, maps, collections, java arrays and XML to JSON and back again to beans and DynaBeans. It is based on the work by Douglas Crockford in http://www.json.org/java. Includes support for Groovy and JRuby as well.
Gson is a Java library that can be used to convert Java Objects into its JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you
... [More]
do not have source-code of.
There are a few open-source projects that can convert Java objects to JSON. However, most of them require that you place Java annotations in your classes something that you can not do if you do not have access to the source-code. Most also do not fully support the use of Java Generics. Gson considers both of these as very important design goals.
Gson Goals Provide simple toJson() and fromJson() methods to convert Java objects to JSON and vice-versa Allow pre-existing unmodifiable objects to be converted to and from JSON Extensive support of Java Generics Allow custom representations for objects Support arbitrarily complex objects (with deep inheritance hierarchies and extensive use of generic types)
Get Gson You can download the Gson bundle from the download link on the right If you use Maven2, you can get Gson from Gson maven repository. Use groupId: com.google.code.gson, and artifactId: gson. Here are detailed instructions on how to specify Gson dependency in pom.xml. We are working to make Gson available in the Maven2 central repository as well.
Gson Documentation Gson API: JavaDocs for the current Gson release Gson user guide: This guide contains examples on how to use Gson in your code. Gson Roadmap: Details on upcoming releases. Gson design document: This document discusses issues we faced while designing Gson. It also include a comparison of Gson with other Java libraries that can be used for Json conversion
Please use the google-gson Google Group to discuss Gson, or to post questions. [Less]
JSON-JRuby is a port of Florian Frank's native json library to JRuby.