Class YamlConfigurationLoader.Builder
- java.lang.Object
-
- org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder<YamlConfigurationLoader.Builder,YamlConfigurationLoader>
-
- org.spongepowered.configurate.yaml.YamlConfigurationLoader.Builder
-
- Enclosing class:
- YamlConfigurationLoader
public static final class YamlConfigurationLoader.Builder extends AbstractConfigurationLoader.Builder<YamlConfigurationLoader.Builder,YamlConfigurationLoader>
Builds aYamlConfigurationLoader
.This builder supports the following options:
- <prefix>.yaml.node-style
- Equivalent to
nodeStyle(NodeStyle)
- Since:
- 4.0.0
-
-
Field Summary
-
Fields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder
DEFAULT_OPTIONS_SOURCE, defaultOptions, headerMode, sink, source
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description YamlConfigurationLoader
build()
Builds the loader.int
indent()
Gets the level of indentation to be used by the resultant loader.YamlConfigurationLoader.Builder
indent(int indent)
Sets the level of indentation the resultant loader should use.@Nullable NodeStyle
nodeStyle()
Gets the node style to be used by the resultant loader.YamlConfigurationLoader.Builder
nodeStyle(@Nullable NodeStyle style)
Sets the node style the built loader should use.protected void
populate(LoaderOptionSource options)
Populate options from the provided source.-
Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder
buildAndLoadString, buildAndSaveString, defaultOptions, defaultOptions, defaultOptions, file, from, headerMode, headerMode, path, sink, sink, source, source, url
-
-
-
-
Method Detail
-
populate
protected void populate(LoaderOptionSource options)
Description copied from class:AbstractConfigurationLoader.Builder
Populate options from the provided source.The source will have already been validated for nullness.
- Overrides:
populate
in classAbstractConfigurationLoader.Builder<YamlConfigurationLoader.Builder,YamlConfigurationLoader>
- Parameters:
options
- the options to read
-
indent
public YamlConfigurationLoader.Builder indent(int indent)
Sets the level of indentation the resultant loader should use.- Parameters:
indent
- the indent level- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
-
indent
public int indent()
Gets the level of indentation to be used by the resultant loader.- Returns:
- the indent level
- Since:
- 4.0.0
-
nodeStyle
public YamlConfigurationLoader.Builder nodeStyle(@Nullable NodeStyle style)
Sets the node style the built loader should use.- Flow
- the compact, json-like representation.
Example:{value: [list, of, elements], another: value}
- Block
- expanded, traditional YAML
Example:value: - list - of - elements another: value
A
null
value will tell the loader to pick a value automatically based on the contents of each non-scalar node.- Parameters:
style
- the node style to use- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
-
nodeStyle
public @Nullable NodeStyle nodeStyle()
Gets the node style to be used by the resultant loader.- Returns:
- the node style
- Since:
- 4.0.0
-
build
public YamlConfigurationLoader build()
Description copied from class:AbstractConfigurationLoader.Builder
Builds the loader.- Specified by:
build
in classAbstractConfigurationLoader.Builder<YamlConfigurationLoader.Builder,YamlConfigurationLoader>
- Returns:
- a new loader
-
-