JQuery Datatable 请求数据解析#yyds干货盘点#

【JQuery Datatable 请求数据解析#yyds干货盘点#】弓背霞明剑照霜,秋风走马出咸阳。这篇文章主要讲述JQuery Datatable 请求数据解析#yyds干货盘点#相关的知识,希望能为你提供帮助。
请求数据

["name": "sEcho", "value": 1 ,"name": "iColumns", "value": 6 ,"name": "sColumns", "value": ",,,,," ,"name": "iDisplayStart", "value": 0 ,"name": "iDisplayLength", "value": 10 ,"name": "mDataProp_0", "value": "id" ,"name": "sSearch_0", "value": "" ,"name": "bRegex_0", "value": false ,"name": "bSearchable_0", "value": true ,"name": "bSortable_0", "value": false ,"name": "mDataProp_1", "value": "id" ,"name": "sSearch_1", "value": "" ,"name": "bRegex_1", "value": false ,"name": "bSearchable_1", "value": true ,"name": "bSortable_1", "value": true ,"name": "mDataProp_2", "value": "name" ,"name": "sSearch_2", "value": "" ,"name": "bRegex_2", "value": false ,"name": "bSearchable_2", "value": true ,"name": "bSortable_2", "value": true ,"name": "mDataProp_3", "value": "info" ,"name": "sSearch_3", "value": "" ,"name": "bRegex_3", "value": false ,"name": "bSearchable_3", "value": true ,"name": "bSortable_3", "value": true ,"name": "mDataProp_4", "value": "status" ,"name": "sSearch_4", "value": "" ,"name": "bRegex_4", "value": false ,"name": "bSearchable_4", "value": true ,"name": "bSortable_4", "value": false ,"name": "mDataProp_5", "value": null ,"name": "sSearch_5", "value": "" ,"name": "bRegex_5", "value": false ,"name": "bSearchable_5", "value": true ,"name": "bSortable_5", "value": false ,"name": "sSearch", "value": "" ,"name": "bRegex", "value": false ,"name": "iSortCol_0", "value": 1 ,"name": "sSortDir_0", "value": "desc" ,"name": "iSortingCols", "value": 1]

封装代码
public static Map< String, Object> init(String data) Map< String, Object> map = new HashMap< > (); try JsonFactory jsonFactory = new JsonFactory(); JsonParser jsonParser = jsonFactory.createParser(data); String key = ""; String valuehttps://www.songbingjia.com/android/= ""; boolean flag = false; while (true) JsonToken jsonToken = jsonParser.nextToken(); if (jsonToken == JsonToken.END_ARRAY) break; String currentName = jsonParser.getCurrentName(); if (currentName != null & & currentName.equals("name")) jsonParser.nextToken(); key = jsonParser.getText(); flag = false; if (currentName != null & & currentName.equals("value")) jsonParser.nextToken(); value = https://www.songbingjia.com/android/jsonParser.getText(); flag =false; //去掉值为null、“”的字结果 if(value!=null & & value.length()> 1) flag = true; if (flag) map.put(key, value); catch (Exception e) e.printStackTrace(); return map;


    推荐阅读