Package com.microstrategy.utils
Class JsonPrettyPrinter
- java.lang.Object
-
- com.microstrategy.utils.JsonPrettyPrinter
-
public class JsonPrettyPrinter extends java.lang.Object
This class can "pretty-print" JSON text for diagnostic purposes.- Since:
- MicroStrategy Web 9.0.0
-
-
Constructor Summary
Constructors Constructor Description JsonPrettyPrinter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
prettyPrintJSON(java.io.File f, int indentLevel)
Pretty Print the JSON in the supplied file using the specified indentation level.static java.lang.String
prettyPrintJSON(java.lang.String jsonText, int indentLevel)
Pretty Print the JSON in the supplied string using the specified indentation level.
-
-
-
Method Detail
-
prettyPrintJSON
public static java.lang.String prettyPrintJSON(java.io.File f, int indentLevel)
Pretty Print the JSON in the supplied file using the specified indentation level.- Parameters:
f
- TheFile
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:
java.lang.IllegalArgumentException
- If the supplied file does not exist or cannot be read.
-
prettyPrintJSON
public static java.lang.String prettyPrintJSON(java.lang.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.
-
-