fastjson(alibaba)用法

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.41</version>
</dependency>
alibaba的fastjson用法:

String jsonString = JSON.toJSONString(map,SerializerFeature.WriteMapNullValue,SerializerFeature.WriteNullStringAsEmpty);(Map转JSONObject

JSONObject jm = JSON.parseObject(jsonString );(Map转JSONObject

jm .put("name", "John");

JSONArray json = new JSONArray();

json.add(jm );



猜你喜欢

转载自blog.csdn.net/qq_26597927/article/details/80182506
今日推荐