JsonTools是一个不错的JSON序列化和反序列化功能包,在这里可以下载到它:http://jsontools.berlios.de/ 。
它有以下功能:
- Parser : Parse JSON text files and convert these to a Java model.
- Renderer : Render a Java representation into text.
- Serializer : Serialize plain POJO clusters to a JSON representation. The goal is to provide a serializing mechanism which can cope with all kinds of Java datastructures (recursion, references, primitive types, ...) .
- Mapper : Map POJO to JSON, this time the JSON text should be as clean as possible. This tool is the best choice when data has to be communicated between Java and other programming languages who can parse JSON.
- Validator : Validate the contents of a JSON file using a JSON schema.
如何使用呢?请参考下面我写的示例代码: