public class JSONStrFormatter extends Object
Modifier and Type | Field and Description |
---|---|
static JSONStrFormatter |
INSTANCE
默认实例
|
Constructor and Description |
---|
JSONStrFormatter(int indentFactor,
CharSequence newLineChars)
构造
|
Modifier and Type | Method and Description |
---|---|
String |
format(String json)
返回格式化JSON字符串。
|
JSONStrFormatter |
setIndentFactor(int indentFactor)
设置缩进因子,即每个缩进空格数
|
JSONStrFormatter |
setNewLineChars(CharSequence newLineChars)
设置换行符
|
public static final JSONStrFormatter INSTANCE
public JSONStrFormatter(int indentFactor, CharSequence newLineChars)
indentFactor
- 缩进因子,即每个缩进空格数newLineChars
- 换行符public JSONStrFormatter setIndentFactor(int indentFactor)
indentFactor
- 缩进因子,即每个缩进空格数public JSONStrFormatter setNewLineChars(CharSequence newLineChars)
newLineChars
- 换行符Copyright © 2025. All rights reserved.