DumpSettings

class DumpSettings(val isExplicitStart: Boolean = false, val isExplicitEnd: Boolean = false, val explicitRootTag: Tag? = null, val anchorGenerator: AnchorGenerator = NumberAnchorGenerator(), val yamlDirective: SpecVersion? = null, val tagDirective: Map<String, String> = emptyMap(), val defaultFlowStyle: FlowStyle = FlowStyle.AUTO, val defaultScalarStyle: ScalarStyle = ScalarStyle.PLAIN, val nonPrintableStyle: NonPrintableStyle = NonPrintableStyle.ESCAPE, val schema: Schema = DEFAULT_SCHEMA, val isCanonical: Boolean = false, val isMultiLineFlow: Boolean = false, val isUseUnicodeEncoding: Boolean = true, val indent: Int = 2, val indicatorIndent: Int = 0, val width: Int = 80, val bestLineBreak: String = "", val isSplitLines: Boolean = true, val maxSimpleKeyLength: Int = 128, val customProperties: Map<SettingKey, Any> = emptyMap(), val indentWithIndicator: Boolean = false, val dumpComments: Boolean = false, val isDereferenceAliases: Boolean = false)(source)

Immutable configuration for serialization.

Constructors

Link copied to clipboard
constructor(isExplicitStart: Boolean = false, isExplicitEnd: Boolean = false, explicitRootTag: Tag? = null, anchorGenerator: AnchorGenerator = NumberAnchorGenerator(), yamlDirective: SpecVersion? = null, tagDirective: Map<String, String> = emptyMap(), defaultFlowStyle: FlowStyle = FlowStyle.AUTO, defaultScalarStyle: ScalarStyle = ScalarStyle.PLAIN, nonPrintableStyle: NonPrintableStyle = NonPrintableStyle.ESCAPE, schema: Schema = DEFAULT_SCHEMA, isCanonical: Boolean = false, isMultiLineFlow: Boolean = false, isUseUnicodeEncoding: Boolean = true, indent: Int = 2, indicatorIndent: Int = 0, width: Int = 80, bestLineBreak: String = "", isSplitLines: Boolean = true, maxSimpleKeyLength: Int = 128, customProperties: Map<SettingKey, Any> = emptyMap(), indentWithIndicator: Boolean = false, dumpComments: Boolean = false, isDereferenceAliases: Boolean = false)

Properties

Link copied to clipboard

Define anchor name generator (by default 'id' + number)

Link copied to clipboard

If the YAML is created for another platform (for instance, on Windows to be consumed under Linux) than this setting is used to define the line ending. The platform line end is used by default.

Link copied to clipboard

Custom property is the way to give some runtime parameters to be used during dumping

Link copied to clipboard

Define flow style

Link copied to clipboard

Define default scalar style

Link copied to clipboard
val dumpComments: Boolean = false

Set to true to add comments from Nodes to the output.

Link copied to clipboard
val explicitRootTag: Tag? = null

Define root Tag or let the tag be detected automatically.

Link copied to clipboard
val indent: Int = 2

Define the amount of spaces for the indent in the block flow style. Default is 2.

Link copied to clipboard

Set to true to add the indent for sequences to the general indent

Link copied to clipboard

Adds the specified indent for sequence indicator in the block flow. Default is 0.

Link copied to clipboard
val isCanonical: Boolean = false

Enforce canonical representation

Link copied to clipboard

Disable usage of anchors and aliases while serialising an instance. Recursive objects will not work when they are disabled. (Forces Serializer to skip emitting anchors names, emit Node content instead of Alias, fail with SerializationException if serialized structure is recursive.)

Link copied to clipboard
val isExplicitEnd: Boolean = false

Add '...' at the end of the document.

Link copied to clipboard

Add '---' at the beginning of the document.

Link copied to clipboard

Use pretty flow style when every value in the flow context gets a separate line.

Link copied to clipboard
val isSplitLines: Boolean = true

Define whether to split long lines

Link copied to clipboard

Specify whether to emit non-ASCII printable Unicode characters (emit Unicode char or escape sequence starting with '\\u'). The default value is true. When set to false, printable non-ASCII characters (Cyrillic, Chinese, etc.) will be not printed but escaped (to support ASCII terminals).

Link copied to clipboard

Define max key length to use simple key (without ?). More info

Link copied to clipboard

When a String object contains non-printable characters, they are escaped with \\u or \\x notation. Sometimes it is better to transform this data to binary (with the !!binary tag). String objects with printable data are not affected by this setting. Set this to BINARY to force non-printable String to represented as binary (byte array).

Link copied to clipboard

Provide either recommended or custom schema instead of default it.krzeminski.snakeyaml.engine.kmp.schema.DEFAULT_SCHEMA. These 3 are available it.krzeminski.snakeyaml.engine.kmp.schema.FailsafeSchema, it.krzeminski.snakeyaml.engine.kmp.schema.JsonSchema, it.krzeminski.snakeyaml.engine.kmp.schema.CoreSchema.

Link copied to clipboard
Link copied to clipboard
val width: Int = 80

Set max width for literal scalars. When the scalar representation takes more then the preferred with the scalar will be split into a few lines. The default is 80.

Link copied to clipboard

Add YAML directive