JSON and json online resolution
Bytes
I. JSON format:
JSON (JavaScript Object Notation) is a simple data format, which is lighter than xml. JSON is a JavaScript native format, which means that no special API or toolkit is required to process JSON data in JavaScript.
JSON rules are simple: the object is an unordered "'name/value' pair" set. The rules are as follows:
1) The ing set (object) is represented by braces. {Name 1: value 1, name 2: Value 2}
2) The set (array) of the parallel data is represented by square brackets. [{Name 1: value, name 2: Value 2}, {name 1: value, name 2: Value 2}]
Ii. parse JSON:
JSON is only a text string. It is stored in the responseText attribute.
To read JSON data stored in the responseText attribute, you must follow the JavaScript eval statement.
3. JSON_LIB
// Convert javaBean to json format:
JSONObject jsonObject = JSONObject. fromObject (javabean );
// Convert the javaBean ---> json format in the list set
JSONArray jsonArray = JSONArray. fromObject (list );
JSON string Filtering
JsonConfig jsonConfig = new JsonConfig ();
JsonConfig. setExcludes (new String [] {"pname "});
JSONArray jsonArray = JSONArray. fromObject (list, jsonConfig );