public class JsonWriterSettings extends BsonWriterSettings
JSONWriter
instance.JsonWriter
Modifier and Type | Field and Description |
---|---|
private boolean |
indent |
private java.lang.String |
indentCharacters |
private java.lang.String |
newLineCharacters |
private JsonMode |
outputMode |
Modifier | Constructor and Description |
---|---|
|
JsonWriterSettings()
Creates a new instance with default values for all properties.
|
|
JsonWriterSettings(boolean indent)
Creates a new instance with indent mode enabled, and the default value for all other properties.
|
|
JsonWriterSettings(JsonMode outputMode)
Creates a new instance with the given output mode and default values for all other properties.
|
|
JsonWriterSettings(JsonMode outputMode,
boolean indent)
Creates a new instance with the given output mode, indent mode enabled, and the default value for all other properties.
|
private |
JsonWriterSettings(JsonMode outputMode,
boolean indent,
java.lang.String indentCharacters,
java.lang.String newLineCharacters) |
|
JsonWriterSettings(JsonMode outputMode,
java.lang.String indentCharacters)
Creates a new instance with the given values for all properties, indent mode enabled and the default value of
newLineCharacters . |
|
JsonWriterSettings(JsonMode outputMode,
java.lang.String indentCharacters,
java.lang.String newLineCharacters)
Creates a new instance with the given values for all properties and indent mode enabled.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getIndentCharacters()
The indent characters to use if indent mode is enabled.
|
java.lang.String |
getNewLineCharacters()
The new line character(s) to use if indent mode is enabled.
|
JsonMode |
getOutputMode()
The output mode to use.
|
boolean |
isIndent()
The indentation mode.
|
getMaxSerializationDepth
private final boolean indent
private final java.lang.String newLineCharacters
private final java.lang.String indentCharacters
private final JsonMode outputMode
public JsonWriterSettings()
public JsonWriterSettings(JsonMode outputMode)
outputMode
- the output modepublic JsonWriterSettings(boolean indent)
indent
- whether indent mode is enabledpublic JsonWriterSettings(JsonMode outputMode, boolean indent)
outputMode
- the output modeindent
- whether indent mode is enabledpublic JsonWriterSettings(JsonMode outputMode, java.lang.String indentCharacters)
newLineCharacters
.outputMode
- the output modeindentCharacters
- the indent characterspublic JsonWriterSettings(JsonMode outputMode, java.lang.String indentCharacters, java.lang.String newLineCharacters)
outputMode
- the output modeindentCharacters
- the indent charactersnewLineCharacters
- the new line character(s) to useprivate JsonWriterSettings(JsonMode outputMode, boolean indent, java.lang.String indentCharacters, java.lang.String newLineCharacters)
public boolean isIndent()
false
.public java.lang.String getNewLineCharacters()
System.getProperty("line.separator")
.public java.lang.String getIndentCharacters()
public JsonMode getOutputMode()