import com.alibaba.fastjson.JSONObject; /**
* Created by SYJ on 2017/9/13.
*/
public class MainTest {
public static void main(String[] args) {
String json = "{\"code\":0,\"message\":\"没有查询到数据\",\"data\":null,\"taskId\":\"0-bb03193f-ed1f-4d32-8351-6538d329b26e\",\"time\":\"2017-09-2210:11:30\"}";
JSONObject obj = JSONObject.parseObject(json);
Integer code = obj.getInteger("code");
String message = obj.getString("message");
String taskId = obj.getString("taskId"); System.out.println("code:" + code + ", message:" + message + ", taskId:" + taskId);
}
}