List map转json

Posted 树上的疯子^

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了List map转json相关的知识,希望对你有一定的参考价值。

  • // List 转 json string

    String jsonStr = JSONObject.toJSONString( list );

    // Map 转 json string

    String jsonStr = JSONObject.toJSONString( map );

    // 将 json string 转化为 JSONObject

    JSONObject obj = JSONObject.parseObject( jsonStr );

以上是关于List map转json的主要内容,如果未能解决你的问题,请参考以下文章