Package org.bson.json
Class StrictCharacterStreamJsonWriterSettings
java.lang.Object
org.bson.json.StrictCharacterStreamJsonWriterSettings
Settings to control the behavior of a
JSONWriter
instance.- Since:
- 3.5
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder for StrictCharacterStreamJsonWriterSettings -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder for StrictCharacterStreamJsonWriterSettings, which are immutable.The indent characters to use if indent mode is enabled.int
The maximum length of the JSON string.The new line character(s) to use if indent mode is enabled.boolean
isIndent()
The indentation mode.
-
Method Details
-
builder
Create a builder for StrictCharacterStreamJsonWriterSettings, which are immutable.- Returns:
- a Builder instance
-
isIndent
public boolean isIndent()The indentation mode. If true, output will be indented. Otherwise, it will all be on the same line. The default value isfalse
.- Returns:
- whether output should be indented.
-
getNewLineCharacters
The new line character(s) to use if indent mode is enabled. The default value isSystem.getProperty("line.separator")
.- Returns:
- the new line character(s) to use.
-
getIndentCharacters
The indent characters to use if indent mode is enabled. The default value is two spaces.- Returns:
- the indent character(s) to use.
-
getMaxLength
public int getMaxLength()The maximum length of the JSON string. The string will be truncated at this length.- Returns:
- the maximum length of the JSON string
- Since:
- 3.7
-