• 【作品】PrettyJson1.00版


    【功能】

    将json整形+美化,内部按字母序排列。

    【下载地址】

    https://files.cnblogs.com/files/heyang78/JsonPretty_pkg_220314.zip?t=1647227418

    【使用方法】

    1.安装JDK8或以上版本。
    2.在控制台窗口输入java -jar JsonPretty-1.00.jar运行程序

    【创作意图】

    上周三收到一个json解析并转化为Xls的任务,当时json没有美化,内容较多,使我用肉眼找节点时费了一番功夫。

    而且当时是内网环境,无法使用网络上便利的Json美化工具。后来想到之前做过JsonAnalyzer2 1.01版,如果用Spring CLI外壳给它封装一下,传到内网就解决部分问题了。

    【使用展示】

    C:\TEMP>java -jar JsonPretty-1.00.jar
              / /                            //   ) )
             / /  ___      ___       __     //___/ /  __      ___    __  ___ __  ___
            / / ((   ) ) //   ) ) //   ) ) / ____ / //  ) ) //___) )  / /     / /   //   / /
           / /   \ \    //   / / //   / / //       //      //        / /     / /   ((___/ /
     ((___/ / //   ) ) ((___/ / //   / / //       //      ((____    / /     / /        / /
    
     Author:heyang (horn19782016@163.com) 2022-3-12
    2022-03-14 11:04:54.974  INFO 4672 --- [           main] com.inlet.MyApplication                  : Starting MyApplication using Java 17.0.2 on DESKTOP-OOO5MRB with PID 4672 (C:\TEMP\JsonPretty-1.00.jar started by ufo in C:\TEMP)
    2022-03-14 11:04:54.981  INFO 4672 --- [           main] com.inlet.MyApplication                  : No active profile set, falling back to 1 default profile: "default"
    2022-03-14 11:04:55.817  INFO 4672 --- [           main] com.inlet.MyApplication                  : Started MyApplication in 1.506 seconds (JVM running for 3.013)
    Please input filename or url:5.json
    Original text:{
    "name":"testJob1",
    "date":"22.3.14",
    "from":{
    "conn":{
    "url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl",
    "driver":"oracle.jdbc.driver.OracleDriver",
    "name":"luna",
    "pswd":"1234"
    },
    "table":"emp1",
    "columns":["id","name","age","remark"],
    "maskColumns":[{"name":"reverse"},{"remark":"caesar"}],
    },
    "to":{
    "conn":{
    "url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl",
    "driver":"oracle.jdbc.driver.OracleDriver",
    "name":"luna",
    "pswd":"1234"
    },
    "table":"emp2",
    "columns":["id","name","age","remark"]
    }
    }
    
    Formatted Text:
    {
        "date":"22.3.14",
        "from":{
            "columns":[
                "id",
                "name",
                "age",
                "remark"
            ],
            "conn":{
                "driver":"oracle.jdbc.driver.OracleDriver",
                "name":"luna",
                "pswd":"1234",
                "url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl"
            },
            "maskColumns":[
                {
                    "name":"reverse"
                },
                {
                    "remark":"caesar"
                }
            ],
            "table":"emp1"
        },
        "name":"testJob1",
        "to":{
            "columns":[
                "id",
                "name",
                "age",
                "remark"
            ],
            "conn":{
                "driver":"oracle.jdbc.driver.OracleDriver",
                "name":"luna",
                "pswd":"1234",
                "url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl"
            },
            "table":"emp2"
        }
    }
    Input filename to save result,input Q/q to exit.0314.json
    File:0314.json saved!
    Thank you,bye!
    C:\TEMP>

    END

  • 相关阅读:
    git/github轻松上传本地项目
    ubuntu下python+flask+mysql完整开发环境配置
    木马另类删除文件的方法
    OpenCV资源
    实现bmp文件到png文件转换
    通过进程ID获得该进程主窗口的句柄
    有趣的Lua表
    让程序在win7下运行时弹出"以管理员身份运行"
    LuaStudio源码分析2资源文件
    LuaCURL
  • 原文地址:https://www.cnblogs.com/heyang78/p/15998621.html
Copyright © 2020-2023  润新知