ITeye博客

4中json解析工具

dannyhz · 2019-01-17 17:51 · json · 企业架构 · Markdown

Gson fastJson https://www.cnblogs.com/kunpengit/p/4001680.html

Gson将对象转成Json对象的方法

Gson gson=new Gson();
String json=gson.toJson(Student.class);
1 2 这种情况,如果Student属性中的某个值包含有=,会变为\u003d的情况

只需将Gson的初始化修改为

Gson gson = new GsonBuilder().disableHtmlEscaping().create();

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。