public final class DumpSettingsBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
DumpSettings |
build()
Create immutable DumpSettings
|
DumpSettingsBuilder |
setAnchorGenerator(AnchorGenerator anchorGenerator)
Define anchor name generator (by default 'id' + number)
|
DumpSettingsBuilder |
setBestLineBreak(String bestLineBreak)
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.
|
DumpSettingsBuilder |
setCanonical(boolean canonical)
Enforce canonical representation
|
DumpSettingsBuilder |
setCustomProperty(SettingKey key,
Object value) |
DumpSettingsBuilder |
setDefaultFlowStyle(FlowStyle defaultFlowStyle)
Define flow style
|
DumpSettingsBuilder |
setDefaultScalarStyle(ScalarStyle defaultScalarStyle)
Define default scalar style
|
DumpSettingsBuilder |
setDumpComments(boolean dumpComments)
Set to true to add comments from Nodes to
|
DumpSettingsBuilder |
setExplicitEnd(boolean explicitEnd)
Add '...' in the end of the document
|
DumpSettingsBuilder |
setExplicitRootTag(Optional<Tag> explicitRootTag)
Define root
Tag or let the tag to be detected automatically |
DumpSettingsBuilder |
setExplicitStart(boolean explicitStart)
Add '---' in the beginning of the document
|
DumpSettingsBuilder |
setIndent(int indent)
Define the amount of the spaces for the indent in the block flow style.
|
DumpSettingsBuilder |
setIndentWithIndicator(boolean indentWithIndicator)
Set to true to add the indent for sequences to the general indent
|
DumpSettingsBuilder |
setIndicatorIndent(int indicatorIndent)
It adds the specified indent for sequence indicator in the block flow.
|
DumpSettingsBuilder |
setMaxSimpleKeyLength(int maxSimpleKeyLength)
Define max key length to use simple key (without '?') More info https://yaml.org/spec/1.2/spec.html#id2798057
|
DumpSettingsBuilder |
setMultiLineFlow(boolean multiLineFlow)
Use pretty flow style when every value in the flow context gets a separate line.
|
DumpSettingsBuilder |
setNonPrintableStyle(NonPrintableStyle nonPrintableStyle)
When String object contains non-printable characters, they are escaped with \\u or \\x
notation.
|
DumpSettingsBuilder |
setScalarResolver(ScalarResolver scalarResolver)
Define
ScalarResolver or use JSON resolver by default. |
DumpSettingsBuilder |
setSplitLines(boolean splitLines)
Define whether to split long lines
|
DumpSettingsBuilder |
setTagDirective(Map<String,String> tagDirective)
Add TAG directive (http://yaml.org/spec/1.2/spec.html#id2782090)
|
DumpSettingsBuilder |
setUseUnicodeEncoding(boolean useUnicodeEncoding)
Specify whether to emit non-ASCII printable Unicode characters (emit Unicode char or escape
sequence starting with '\\u') The default value is true.
|
DumpSettingsBuilder |
setWidth(int width)
Set max width for literal scalars.
|
DumpSettingsBuilder |
setYamlDirective(Optional<SpecVersion> yamlDirective)
Add YAML directive (http://yaml.org/spec/1.2/spec.html#id2782090)
|
public DumpSettingsBuilder setDefaultFlowStyle(FlowStyle defaultFlowStyle)
defaultFlowStyle - - specify the stylepublic DumpSettingsBuilder setDefaultScalarStyle(ScalarStyle defaultScalarStyle)
defaultScalarStyle - - specify the scalar stylepublic DumpSettingsBuilder setExplicitStart(boolean explicitStart)
explicitStart - - true if the document start must be explicitly indicatedpublic DumpSettingsBuilder setAnchorGenerator(AnchorGenerator anchorGenerator)
anchorGenerator - - specified function to create anchor namespublic DumpSettingsBuilder setScalarResolver(ScalarResolver scalarResolver)
ScalarResolver or use JSON resolver by default. Do we need this method ?scalarResolver - - specify the scalar resolverpublic DumpSettingsBuilder setExplicitRootTag(Optional<Tag> explicitRootTag)
Tag or let the tag to be detected automaticallyexplicitRootTag - - specify the root tagpublic DumpSettingsBuilder setExplicitEnd(boolean explicitEnd)
explicitEnd - - true if the document end must be explicitly indicatedpublic DumpSettingsBuilder setYamlDirective(Optional<SpecVersion> yamlDirective)
yamlDirective - - the version to be used in the directivepublic DumpSettingsBuilder setTagDirective(Map<String,String> tagDirective)
tagDirective - - the data to create TAG directivepublic DumpSettingsBuilder setCanonical(boolean canonical)
canonical - - specify if the canonical representation must be usedpublic DumpSettingsBuilder setMultiLineFlow(boolean multiLineFlow)
multiLineFlow - - set false to output all values in a single line.public DumpSettingsBuilder setUseUnicodeEncoding(boolean useUnicodeEncoding)
useUnicodeEncoding - - true to use Unicode for "Я", false to use "Ч" for the same
char (if useUnicodeEncoding is false then all non-ASCII characters
are escaped)public DumpSettingsBuilder setIndent(int indent)
indent - - the number of spaces. Must be within the range org.snakeyaml.engine.v2.emitter.Emitter.MIN_INDENT
and org.snakeyaml.engine.v2.emitter.Emitter.MAX_INDENTpublic DumpSettingsBuilder setIndicatorIndent(int indicatorIndent)
indicatorIndent - - must be non-negative and less than org.snakeyaml.engine.v2.emitter.Emitter.MAX_INDENT
- 1public DumpSettingsBuilder setWidth(int width)
width - - the widthpublic DumpSettingsBuilder setBestLineBreak(String bestLineBreak)
bestLineBreak - - "\r\n" or "\n"public DumpSettingsBuilder setSplitLines(boolean splitLines)
splitLines - - true to split long linespublic DumpSettingsBuilder setMaxSimpleKeyLength(int maxSimpleKeyLength)
maxSimpleKeyLength - - the limit after which the key gets explicit key indicator '?'public DumpSettingsBuilder setNonPrintableStyle(NonPrintableStyle nonPrintableStyle)
nonPrintableStyle - - set this to BINARY to force non-printable String to represented as
binary (byte array)public DumpSettingsBuilder setCustomProperty(SettingKey key, Object value)
public DumpSettingsBuilder setIndentWithIndicator(boolean indentWithIndicator)
indentWithIndicator - - true when indent for sequences is added to generalpublic DumpSettingsBuilder setDumpComments(boolean dumpComments)
dumpComments - - true when comments should be dumped (serialised)public DumpSettings build()
Copyright © 2018–2022. All rights reserved.