阿里巴巴fastJson进行json数据解析

1.生成JsonObject:将Java bean转换成易于处理和传输的strig的key value形式。

2.解析JsonObject:将收到的字符串转换成JsonObejct这种对象形式,JsonObject是一种json对象,作为json 字符串与JavaBean转换的中间产物。

从http流中获取传输来的json

 BufferedReader reader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));    
        String lines =reader.readLine();//��ȡ������  
        JSONObject inputJson=JSONObject.parseObject(lines); 
        reader.close();  

3.JsonObject常用方法:

1.构造JSonObject:将传输进来的字符串构造成JsonObject.

静态方法JsonObject jobj = JSONObject.parseObject(string); 

2.自己添加Json

原文地址:https://www.cnblogs.com/panxuejun/p/6099181.html