公司协议一直都是用json,难免少不了将json对象转换成java对象,需要一个个去解析,很麻烦。
最近忽然发现google出了好友的库gson(把json,java对象转换)
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.
https://code.google.com/p/google-gson/