public final class LoadSettingsBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
LoadSettings |
build()
Build immutable LoadSettings
|
LoadSettingsBuilder |
setAllowDuplicateKeys(boolean allowDuplicateKeys)
YAML 1.2 does require unique keys.
|
LoadSettingsBuilder |
setAllowRecursiveKeys(boolean allowRecursiveKeys)
Allow only non-recursive keys for maps and sets.
|
LoadSettingsBuilder |
setBufferSize(Integer bufferSize)
Buffer size for incoming data stream.
|
LoadSettingsBuilder |
setCustomProperty(SettingKey key,
Object value) |
LoadSettingsBuilder |
setDefaultList(Function<Integer,List> defaultList)
Provide default List implementation.
|
LoadSettingsBuilder |
setDefaultMap(Function<Integer,Map> defaultMap)
Provide default Map implementation.
|
LoadSettingsBuilder |
setDefaultSet(Function<Integer,Set> defaultSet)
Provide default Set implementation.
|
LoadSettingsBuilder |
setLabel(String label)
Label for the input data.
|
LoadSettingsBuilder |
setScalarResolver(ScalarResolver scalarResolver)
Provide resolver to detect a tag by the value of a scalar
|
LoadSettingsBuilder |
setTagConstructors(Map<Tag,ConstructNode> tagConstructors)
Provide constructors for the specified tags.
|
LoadSettingsBuilder |
setUseMarks(boolean useMarks)
Marks are only used for error messages.
|
LoadSettingsBuilder |
setVersionFunction(Function<SpecVersion,SpecVersion> versionFunction)
Manage YAML directive value which defines the version of the YAML specification.
|
public LoadSettingsBuilder setLabel(String label)
label - - meaningful label to indicate the input sourcepublic LoadSettingsBuilder setTagConstructors(Map<Tag,ConstructNode> tagConstructors)
tagConstructors - - the map from a Tag to its constructorpublic LoadSettingsBuilder setScalarResolver(ScalarResolver scalarResolver)
scalarResolver - - specified ScalarResolverpublic LoadSettingsBuilder setDefaultList(Function<Integer,List> defaultList)
ArrayList is used if nothing provided.defaultList - - specified List implementation (as a function from init size)public LoadSettingsBuilder setDefaultSet(Function<Integer,Set> defaultSet)
LinkedHashSet is used if nothing provided.defaultSet - - specified Set implementation (as a function from init size)public LoadSettingsBuilder setDefaultMap(Function<Integer,Map> defaultMap)
LinkedHashMap is used if nothing provided.defaultMap - - specified Map implementation (as a function from init size)public LoadSettingsBuilder setBufferSize(Integer bufferSize)
bufferSize - - buffer size (in bytes) for input datapublic LoadSettingsBuilder setAllowDuplicateKeys(boolean allowDuplicateKeys)
allowDuplicateKeys - - if true than the non-unique keys in a mapping are allowed (last key wins). False by default.public LoadSettingsBuilder setAllowRecursiveKeys(boolean allowRecursiveKeys)
allowRecursiveKeys - - true to allow recursive structures as keyspublic LoadSettingsBuilder setUseMarks(boolean useMarks)
useMarks - - use false to save resources but use less informative error messages (no line and context)public LoadSettingsBuilder setVersionFunction(Function<SpecVersion,SpecVersion> versionFunction)
versionFunction - - define the way to manage the YAML version. By default, 1.* versions are accepted
and treated as YAML 1.2. Other versions fail to parse (YamlVersionException is thown)public LoadSettingsBuilder setCustomProperty(SettingKey key, Object value)
public LoadSettings build()
Copyright © 2018–2019. All rights reserved.