public class

JsonPrettyPrinter

extends Object
java.lang.Object
   ↳ com.microstrategy.utils.JsonPrettyPrinter

Class Overview

This class can "pretty-print" JSON text for diagnostic purposes.

Summary

Public Constructors
JsonPrettyPrinter()
Public Methods
static String prettyPrintJSON(File f, int indentLevel)
Pretty Print the JSON in the supplied file using the specified indentation level.
static String prettyPrintJSON(String jsonText, int indentLevel)
Pretty Print the JSON in the supplied string using the specified indentation level.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public JsonPrettyPrinter ()

Public Methods

public static String prettyPrintJSON (File f, int indentLevel)

Pretty Print the JSON in the supplied file using the specified indentation level.

Parameters
f The File object that contains the file to pretty print.
indentLevel The number of spaces at each indentation level.
Returns
  • A pretty printed version of the text in the file.
Throws
IllegalArgumentException If the supplied file does not exist or cannot be read.

public static String prettyPrintJSON (String jsonText, int indentLevel)

Pretty Print the JSON in the supplied string using the specified indentation level.

Parameters
jsonText The JSON text to pretty print.
indentLevel The number of spaces at each indentation level.
Returns
  • A pretty printed version of the text in the supplied string.