锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕在线观看一区,粉嫩av在线播放,国产精品久久久久久久久久久久久久http://www.aygfsteel.com/paulwong/category/55336.htmlzh-cnFri, 30 Oct 2020 05:17:18 GMTFri, 30 Oct 2020 05:17:18 GMT60Pretty print JSON using org.json library in Javahttp://www.aygfsteel.com/paulwong/archive/2020/10/28/435709.htmlpaulwongpaulwongWed, 28 Oct 2020 09:17:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/10/28/435709.htmlhttp://www.aygfsteel.com/paulwong/comments/435709.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/10/28/435709.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435709.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435709.htmlSyntax
public java.lang.String toString(int indentFactor) throws JSONException

Example

import org.json.*;
public class JSONPrettyPrintTest {
   
public static void main(String args[]) throws JSONException {
      String json 
= "{" +
                    
"Name : Jai," +
                    
"Age : 25, " +
                    
"Salary: 25000.00 " +
                    
"}";
      JSONObject jsonObj 
= new JSONObject(json);
      System.out.println(
"Pretty Print of JSON:");
      System.out.println(jsonObj.toString(
4)); // pretty print json
   }
}

Output

Pretty Print of JSON:
{
   "Salary": 25000,
   "Age": 25,
   "Name": "Jai"
}


paulwong 2020-10-28 17:17 鍙戣〃璇勮
]]>
5 ways to customize Spring MVC JSON/XML outputhttp://www.aygfsteel.com/paulwong/archive/2020/03/08/435236.htmlpaulwongpaulwongSun, 08 Mar 2020 07:55:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/03/08/435236.htmlhttp://www.aygfsteel.com/paulwong/comments/435236.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/03/08/435236.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435236.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435236.htmlhttps://mostafa-asg.github.io/post/customize-json-xml-spring-mvc-output/



paulwong 2020-03-08 15:55 鍙戣〃璇勮
]]>
浠ユ祦鐨勬柟寮忚В閲婂法澶SON鏂囦歡http://www.aygfsteel.com/paulwong/archive/2019/05/03/433743.htmlpaulwongpaulwongFri, 03 May 2019 07:22:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/05/03/433743.htmlhttp://www.aygfsteel.com/paulwong/comments/433743.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/05/03/433743.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/433743.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/433743.htmlhttps://www.ngdata.com/parsing-a-large-json-file-efficiently-and-easily/


https://sites.google.com/site/gson/streaming

http://www.acuriousanimal.com/2015/10/23/reading-json-file-in-stream-mode-with-gson.html

    public static void main(String [] args) throws IOException {
        String filePath = "C:big-data.json";
        FileInputStream in = new FileInputStream(new File(filePath));
        JsonReader reader = new JsonReader(new InputStreamReader(in, "UTF-8"));
        Gson gson = new GsonBuilder().create();
//        reader.beginObject();
//        reader.nextName();
        reader.beginObject();//璺寵繃"{"
        while (reader.hasNext()) {
            // Read data into object model
            JsonToken jsonToken = reader.peek();
            if(jsonToken.equals(JsonToken.NAME)) {
                String name = reader.nextName();
                if(name.equalsIgnoreCase("SUMMARY")) {
//                    reader.beginObject();
                    Summary summary = gson.fromJson(reader, Summary.class);
                    logger.info(summary.toString());
                    break;
//                    reader.endObject();//璺寵繃"}"
                }
            } /*else if(jsonToken.equals(JsonToken.BEGIN_OBJECT)) {
                reader.beginObject();
            } else if(jsonToken.equals(JsonToken.STRING)) {
                logger.info(reader.nextString());
            } else if(jsonToken.equals(JsonToken.NUMBER)) {
                logger.info(reader.nextInt() + "");
            } else if(jsonToken.equals(JsonToken.END_OBJECT)) {
                reader.endObject();
            } 
*/
//            Summary summary = gson.fromJson(reader, Summary.class);
//            break;
        }
        reader.close();
    }


paulwong 2019-05-03 15:22 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 宁河县| 永泰县| 木里| 雷州市| 卓尼县| 兴安县| 延寿县| 清涧县| 汤阴县| 汉阴县| 涿州市| 郑州市| 康平县| 淳安县| 洛宁县| 县级市| 昆明市| 新津县| 湖北省| 东阳市| 新巴尔虎左旗| 佛坪县| 时尚| 凤庆县| 宁乡县| 巴彦淖尔市| 永嘉县| 融水| 高要市| 临猗县| 兴仁县| 邛崃市| 新民市| 乡城县| 武川县| 吉安市| 隆安县| 沙河市| 将乐县| 焦作市| 马龙县|