public class LoaderSettings extends Object
Settings introduced by BoostedYAML follow builder design pattern, e.g. you may build your own settings using
LoaderSettings.builder() //configure// .build()
Modifier and Type | Class and Description |
---|---|
static class |
LoaderSettings.Builder
Builder for loader settings; wrapper for SnakeYAML Engine's
LoadSettingsBuilder class which is more
detailed, provides more options and possibilities, hides options which should not be configured. |
Modifier and Type | Field and Description |
---|---|
static LoaderSettings |
DEFAULT
Default loader settings.
|
Modifier and Type | Method and Description |
---|---|
org.snakeyaml.engine.v2.api.LoadSettings |
buildEngineSettings(GeneralSettings generalSettings)
Builds the SnakeYAML Engine settings.
|
static LoaderSettings.Builder |
builder()
Returns a new builder.
|
static LoaderSettings.Builder |
builder(LoaderSettings settings)
Returns a new builder with the same configuration as the given settings.
|
static LoaderSettings.Builder |
builder(org.snakeyaml.engine.v2.api.LoadSettingsBuilder builder)
Creates and returns a new builder from the given, already created SnakeYAML Engine settings builder.
|
boolean |
isAutoUpdate()
Returns if to automatically call
YamlDocument.update() after the document has been loaded. |
boolean |
isCreateFileIfAbsent()
Returns if to create a new file and save it if it does not exist automatically.
|
public static final LoaderSettings DEFAULT
public boolean isAutoUpdate()
YamlDocument.update()
after the document has been loaded.public boolean isCreateFileIfAbsent()
public org.snakeyaml.engine.v2.api.LoadSettings buildEngineSettings(GeneralSettings generalSettings)
generalSettings
- settings used to get defaults (list, set, map) frompublic static LoaderSettings.Builder builder()
public static LoaderSettings.Builder builder(org.snakeyaml.engine.v2.api.LoadSettingsBuilder builder)
Note that the given builder is not cloned, so it is in the caller's best interest to never change it's settings from now on.
Please note that LoaderSettings.Builder.setCreateFileIfAbsent(boolean)
and LoaderSettings.Builder.setAutoUpdate(boolean)
still have to be
called (if you want to alter the default), as they are not part of the Engine's settings.
builder
- the underlying builderpublic static LoaderSettings.Builder builder(LoaderSettings settings)
settings
- preset settingsCopyright © 2022. All rights reserved.