锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲综合国产精品第一页,亚洲精品宾馆在线精品酒店,亚洲 另类 无码 在线http://www.tkk7.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.tkk7.com/paulwong/archive/2020/10/28/435709.htmlpaulwongpaulwongWed, 28 Oct 2020 09:17:00 GMThttp://www.tkk7.com/paulwong/archive/2020/10/28/435709.htmlhttp://www.tkk7.com/paulwong/comments/435709.htmlhttp://www.tkk7.com/paulwong/archive/2020/10/28/435709.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435709.htmlhttp://www.tkk7.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.tkk7.com/paulwong/archive/2020/03/08/435236.htmlpaulwongpaulwongSun, 08 Mar 2020 07:55:00 GMThttp://www.tkk7.com/paulwong/archive/2020/03/08/435236.htmlhttp://www.tkk7.com/paulwong/comments/435236.htmlhttp://www.tkk7.com/paulwong/archive/2020/03/08/435236.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435236.htmlhttp://www.tkk7.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.tkk7.com/paulwong/archive/2019/05/03/433743.htmlpaulwongpaulwongFri, 03 May 2019 07:22:00 GMThttp://www.tkk7.com/paulwong/archive/2019/05/03/433743.htmlhttp://www.tkk7.com/paulwong/comments/433743.htmlhttp://www.tkk7.com/paulwong/archive/2019/05/03/433743.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/433743.htmlhttp://www.tkk7.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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 四虎永久在线观看免费网站网址| 久久亚洲精品无码网站| 亚洲国产精品一区二区第四页| 日本v片免费一区二区三区| 亚洲视频在线免费播放| 午夜免费福利小电影| 免费精品国产自产拍在线观看图片 | 99视频在线免费观看| 一级毛片免费观看不卡的| 国产A在亚洲线播放| 无码人妻一区二区三区免费n鬼沢 无码人妻一区二区三区免费看 | 麻豆视频免费播放| 亚洲欧洲日韩综合| 91在线品视觉盛宴免费| 国产亚洲免费的视频看| 免费毛片在线看不用播放器| 久久久高清免费视频| 亚洲人成未满十八禁网站| 在线看片免费人成视频福利| 亚洲福利视频一区| 免费大片黄在线观看| 18禁无遮挡无码国产免费网站| 国产一区二区免费在线| 亚洲欧洲日产韩国在线| 色窝窝免费一区二区三区| 国产亚洲精品91| 毛片在线看免费版| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 国产一卡2卡3卡4卡2021免费观看 国产一卡2卡3卡4卡无卡免费视频 | 91久久精品国产免费直播| 亚洲中文字幕在线无码一区二区| 中文在线观看国语高清免费| 五月婷婷亚洲综合| 亚洲jizzjizz在线播放久| 久久w5ww成w人免费| 亚洲AV无码久久精品成人 | 亚洲福利精品一区二区三区| a级精品九九九大片免费看| 亚洲无成人网77777| 国产乱色精品成人免费视频| 久久久精品免费国产四虎|