Package org.bson.json
Class JsonWriterSettings
- java.lang.Object
- 
- org.bson.BsonWriterSettings
- 
- org.bson.json.JsonWriterSettings
 
 
- 
 public class JsonWriterSettings extends BsonWriterSettings Settings to control the behavior of aJSONWriterinstance.- Since:
- 3.0
- See Also:
- JsonWriter
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classJsonWriterSettings.BuilderA builder for JsonWriterSettings
 - 
Constructor SummaryConstructors Constructor Description JsonWriterSettings()Deprecated.Preferbuilder(), but note that the default output mode is different for that methodJsonWriterSettings(boolean indent)Deprecated.Use theJsonWriterSettings.BuilderinsteadJsonWriterSettings(JsonMode outputMode)Deprecated.Use theJsonWriterSettings.BuilderinsteadJsonWriterSettings(JsonMode outputMode, boolean indent)Deprecated.Use theJsonWriterSettings.BuilderinsteadJsonWriterSettings(JsonMode outputMode, String indentCharacters)Deprecated.Use theJsonWriterSettings.BuilderinsteadJsonWriterSettings(JsonMode outputMode, String indentCharacters, String newLineCharacters)Deprecated.Use theJsonWriterSettings.Builderinstead
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonWriterSettings.Builderbuilder()Create a builder for JsonWriterSettings, which are immutable.Converter<BsonBinary>getBinaryConverter()A converter from BSON Binary values to JSON.Converter<Boolean>getBooleanConverter()A converter from BSON Boolean values to JSON.Converter<Long>getDateTimeConverter()A converter from BSON DateTime values to JSON.Converter<Decimal128>getDecimal128Converter()A converter from BSON Decimal128 values to JSON.Converter<Double>getDoubleConverter()A converter from BSON Double values to JSON.StringgetIndentCharacters()The indent characters to use if indent mode is enabled.Converter<Integer>getInt32Converter()A converter from BSON Int32 values to JSON.Converter<Long>getInt64Converter()A converter from BSON Int64 values to JSON.Converter<String>getJavaScriptConverter()A converter from BSON JavaScript values to JSON.Converter<BsonMaxKey>getMaxKeyConverter()A converter from BSON MaxKey values to JSON.intgetMaxLength()The maximum length of the JSON string.Converter<BsonMinKey>getMinKeyConverter()A converter from BSON MinKey values to JSON.StringgetNewLineCharacters()The new line character(s) to use if indent mode is enabled.Converter<BsonNull>getNullConverter()A converter from BSON Null values to JSON.Converter<ObjectId>getObjectIdConverter()A converter from BSON ObjectId values to JSON.JsonModegetOutputMode()The output mode to use.Converter<BsonRegularExpression>getRegularExpressionConverter()A converter from BSON RegularExpression values to JSON.Converter<String>getStringConverter()A converter from BSON String values to JSON.Converter<String>getSymbolConverter()A converter from BSON Symbol values to JSON.Converter<BsonTimestamp>getTimestampConverter()A converter from BSON Timestamp values to JSON.Converter<BsonUndefined>getUndefinedConverter()A converter from BSON Undefined values to JSON.booleanisIndent()The indentation mode.- 
Methods inherited from class org.bson.BsonWriterSettingsgetMaxSerializationDepth
 
- 
 
- 
- 
- 
Constructor Detail- 
JsonWriterSettings@Deprecated public JsonWriterSettings() Deprecated.Preferbuilder(), but note that the default output mode is different for that methodCreates a new instance with default values for all properties.Defaults to JsonMode.STRICT
 - 
JsonWriterSettings@Deprecated public JsonWriterSettings(JsonMode outputMode) Deprecated.Use theJsonWriterSettings.BuilderinsteadCreates a new instance with the given output mode and default values for all other properties.- Parameters:
- outputMode- the output mode
 
 - 
JsonWriterSettings@Deprecated public JsonWriterSettings(boolean indent) Deprecated.Use theJsonWriterSettings.BuilderinsteadCreates a new instance with indent mode enabled, and the default value for all other properties.- Parameters:
- indent- whether indent mode is enabled
 
 - 
JsonWriterSettings@Deprecated public JsonWriterSettings(JsonMode outputMode, boolean indent) Deprecated.Use theJsonWriterSettings.BuilderinsteadCreates a new instance with the given output mode, indent mode enabled, and the default value for all other properties.- Parameters:
- outputMode- the output mode
- indent- whether indent mode is enabled
 
 - 
JsonWriterSettings@Deprecated public JsonWriterSettings(JsonMode outputMode, String indentCharacters) Deprecated.Use theJsonWriterSettings.BuilderinsteadCreates a new instance with the given values for all properties, indent mode enabled and the default value ofnewLineCharacters.- Parameters:
- outputMode- the output mode
- indentCharacters- the indent characters
 
 - 
JsonWriterSettings@Deprecated public JsonWriterSettings(JsonMode outputMode, String indentCharacters, String newLineCharacters) Deprecated.Use theJsonWriterSettings.BuilderinsteadCreates a new instance with the given values for all properties and indent mode enabled.- Parameters:
- outputMode- the output mode
- indentCharacters- the indent characters
- newLineCharacters- the new line character(s) to use
 
 
- 
 - 
Method Detail- 
builderpublic static JsonWriterSettings.Builder builder() Create a builder for JsonWriterSettings, which are immutable.Defaults to JsonMode.RELAXED- Returns:
- a Builder instance
- Since:
- 3.5
 
 - 
isIndentpublic 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.
 
 - 
getNewLineCharacterspublic String 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.
 
 - 
getIndentCharacterspublic String getIndentCharacters() The indent characters to use if indent mode is enabled. The default value is two spaces.- Returns:
- the indent character(s) to use.
 
 - 
getOutputModepublic JsonMode getOutputMode() The output mode to use. The default value is JSONMode.STRICT}.- Returns:
- the output mode.
 
 - 
getMaxLengthpublic 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
 
 - 
getNullConverterpublic Converter<BsonNull> getNullConverter() A converter from BSON Null values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getStringConverterpublic Converter<String> getStringConverter() A converter from BSON String values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getBinaryConverterpublic Converter<BsonBinary> getBinaryConverter() A converter from BSON Binary values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getBooleanConverterpublic Converter<Boolean> getBooleanConverter() A converter from BSON Boolean values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getDateTimeConverterpublic Converter<Long> getDateTimeConverter() A converter from BSON DateTime values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getDoubleConverterpublic Converter<Double> getDoubleConverter() A converter from BSON Double values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getInt32Converterpublic Converter<Integer> getInt32Converter() A converter from BSON Int32 values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getInt64Converterpublic Converter<Long> getInt64Converter() A converter from BSON Int64 values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getDecimal128Converterpublic Converter<Decimal128> getDecimal128Converter() A converter from BSON Decimal128 values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getObjectIdConverterpublic Converter<ObjectId> getObjectIdConverter() A converter from BSON ObjectId values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getRegularExpressionConverterpublic Converter<BsonRegularExpression> getRegularExpressionConverter() A converter from BSON RegularExpression values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getTimestampConverterpublic Converter<BsonTimestamp> getTimestampConverter() A converter from BSON Timestamp values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getSymbolConverterpublic Converter<String> getSymbolConverter() A converter from BSON Symbol values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getMinKeyConverterpublic Converter<BsonMinKey> getMinKeyConverter() A converter from BSON MinKey values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getMaxKeyConverterpublic Converter<BsonMaxKey> getMaxKeyConverter() A converter from BSON MaxKey values to JSON.- Returns:
- this
- Since:
- 3.5
 
 - 
getUndefinedConverterpublic Converter<BsonUndefined> getUndefinedConverter() A converter from BSON Undefined values to JSON.- Returns:
- this
- Since:
- 3.5
 
 
- 
 
-