解析工具Goson

    /**
     * 解析申请分配座位席别
     * @param json
     * @return
     */
    public static TrainOrderResponse getTrainOrder(String json){
        TrainOrderResponse response=new TrainOrderResponse();
        Gson gson=new Gson();
        try {
            JSONObject jsonObject = new JSONObject(json);
            response = gson.fromJson(jsonObject.getString("Res"),TrainOrderResponse.class);
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
            System.out.println(e);
        }
        return response;
    }
原文地址:https://www.cnblogs.com/androidxufeng/p/3644769.html