您的位置:首页 > 编程语言 > Java开发

Java Google Json (Gson) Serializing Inner classes

2015-06-15 17:17 204 查看


Serializing inner classes

Gson can serialize inner classes and static nested classes. The detailed example below demonstrates the following things.

Serializing class containing static nested class
Serializing class containing non static nested class (Inner class)
De-serializing json to a class containing static and non static inner class
Serializing static nested class (without the enclosing type)
Serializing non static nested class (without the enclosing type)
De-serializing json to a static nested class (without the enclosing type)
De-serializing json to a non static nested class (without the enclosing type)

The Example

?
The AlbumsWithInnerClass

?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: