Class HoconConfigurationLoader.Builder
java.lang.Object
org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder<HoconConfigurationLoader.Builder,HoconConfigurationLoader>
org.spongepowered.configurate.hocon.HoconConfigurationLoader.Builder
- Enclosing class:
- HoconConfigurationLoader
public static final class HoconConfigurationLoader.Builder
extends AbstractConfigurationLoader.Builder<HoconConfigurationLoader.Builder,HoconConfigurationLoader>
Builds a
HoconConfigurationLoader
.
This builder supports the following options:
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.option.Option<Boolean>
Set whether comments will be emitted.static final net.kyori.option.Option<Integer>
Set the amount of spaces to indent with whenprettyPrinting(boolean)
is on.static final net.kyori.option.Option<Boolean>
Set whether JSON compatible output mode will be used.static final net.kyori.option.Option<Boolean>
Set whether output from this loader will be pretty-printed or not.static final net.kyori.option.OptionSchema
A schema of options available to configure the Hocon loader.Fields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder
defaultOptions, HEADER_MODE, headerMode, sink, source
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
emitComments
(boolean emitComments) Set whether comments should be emitted.emitJsonCompatible
(boolean jsonCompatible) Set whether output generated by this loader should be json-compatible.indent
(int indent) Set the amount of spaces to indent with whenprettyPrinting(boolean)
is on.protected net.kyori.option.OptionSchema
prettyPrinting
(boolean prettyPrinting) Set whether output from this loader will be pretty-printed or not.Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder
buildAndLoadString, buildAndSaveString, defaultOptions, defaultOptions, defaultOptions, editOptions, file, headerMode, headerMode, optionState, optionState, optionStateBuilder, path, sink, sink, source, source, url
-
Field Details
-
SCHEMA
A schema of options available to configure the Hocon loader.- Since:
- 4.2.0
-
PRETTY_PRINTING
Set whether output from this loader will be pretty-printed or not.- Since:
- 4.2.0
- See Also:
-
INDENT
Set the amount of spaces to indent with whenprettyPrinting(boolean)
is on.- Since:
- 4.2.0
- See Also:
-
COMMENTS
Set whether comments will be emitted.- Since:
- 4.2.0
- See Also:
-
JSON_COMPATIBLE
Set whether JSON compatible output mode will be used.- Since:
- 4.2.0
- See Also:
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
optionSchema
-
prettyPrinting
Set whether output from this loader will be pretty-printed or not.- Parameters:
prettyPrinting
- whether to pretty-print- Returns:
- this builder
- Since:
- 4.0.0
-
indent
Set the amount of spaces to indent with whenprettyPrinting(boolean)
is on.Defaults to 4.
- Parameters:
indent
- indent level- Returns:
- this builder
- Since:
- 4.2.0
-
emitComments
Set whether comments should be emitted.Comments will always be loaded from files and stored in memory.
- Parameters:
emitComments
- whether to emit comments- Returns:
- this builder
- Since:
- 4.0.0
-
emitJsonCompatible
Set whether output generated by this loader should be json-compatible.Whatever format input is received in, this will output JSON. To be fully spec-compliant, comment output must also be disabled.
- Parameters:
jsonCompatible
- to emit json-format output- Returns:
- this builder
- Since:
- 4.0.0
-
build
- Specified by:
build
in classAbstractConfigurationLoader.Builder<HoconConfigurationLoader.Builder,
HoconConfigurationLoader>
-