What is google-gson?(什么是google-gson(简称gson))中英翻译
Gson项目主页:http://code.google.com/p/google-gson/
Gson is a Java library that can be used to convert Java Objects into their 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 do not have source-code of.
Gson是一个可以将java对象转换成对应JSON体现的java库,他还可以将一个JSON字符串转换成等价的java对象,GSON可以处理任意的包括之前存在的没有源代码的java对象。
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.
有一些开源的项目可以将java对象转换成对应的JSON ,然而 ,大多数项目要求在你的类里书写注解 ,如果不能访问到类的源代码有一些事情你可能做不到 , 大多数的项目还不完全的支持java泛型的应用 , GSON将以上问题作为非常重要的设计目标。
Gson Goals
· Provide simple toJson() and fromJson() methods to convert Java objects to JSON and vice-versa(提供简单的toJSON()方法用来转换java对象到json ,反之用fromJSON())
· Allow pre-existing unmodifiable objects to be converted to and from JSON(允许之前存在的不可修改的对象和JSON的相互转换)
· Extensive support of Java Generics(强大的java泛型支持)
· Allow custom representations for objects(允许对象的自定义体现)
· Support arbitrarily complex objects (with deep inheritance hierarchies and extensive use of generic types)(支持任意复杂的对象)(拥有深度的继承层次以及广泛的泛型应用)
Gson Documentation
· Gson API: Javadocs for the current Gson release(当前的Gson版本的java文档)
· Gson user guide: This guide contains examples on how to use Gson in your code.(GSON手册包括在代码中如何Gson的例子)
· 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(这个文档讨论我们所面对的设计Gson的问题,他还包含一个Gson和其他java库在Json转换应用的对比)
Please use the google-gson Google Group to discuss Gson, or to post questions.(请用谷歌goole-gson开发小组讨论Gson ,或者提出问题。)
(持续更新请关注……)