Code example for JsonParser

Methods: parse

0
        } 
    } 
 
    public static String jsonFormatter(String uglyJSONString){
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        JsonParser jp = new JsonParser();
        JsonElement je = jp.parse(uglyJSONString);
        String prettyJsonString = gson.toJson(je);
        return prettyJsonString;
    } 
 
    public static void LOGD(String msg, boolean withExtraInfo) {
        if (UtilsConfig.UTILS_DEBUG) {
            String method = "";
            if (withExtraInfo) {
                method = UtilsRuntime.getCurrentStackMethodName();
            } 
            DebugLog.d(method, msg);
        } 
    } 
Experience pair programming with AI  Get Codota for Java