Class AbstractConfigurationLoader.Builder<T extends AbstractConfigurationLoader.Builder<T,L>,L extends AbstractConfigurationLoader<?>>  
java.lang.Object
org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder<T,L> 
- Type Parameters:
- T- the builder's own type (for chaining using generic types)
- Direct Known Subclasses:
- GsonConfigurationLoader.Builder,- HoconConfigurationLoader.Builder,- JacksonConfigurationLoader.Builder,- XmlConfigurationLoader.Builder,- YamlConfigurationLoader.Builder
- Enclosing class:
- AbstractConfigurationLoader<N extends ScopedConfigurationNode<N>>
public abstract static class AbstractConfigurationLoader.Builder<T extends AbstractConfigurationLoader.Builder<T,L>,L extends AbstractConfigurationLoader<?>>  
extends Object
An abstract builder implementation for 
AbstractConfigurationLoaders.- Since:
- 4.0.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ConfigurationOptionsstatic final net.kyori.option.Option<HeaderMode>How to read and emit headers discovered on documents processed by the created loader.protected HeaderModeDeprecated.protected static final net.kyori.option.OptionSchemaprotected @Nullable Callable<BufferedWriter>protected @Nullable Callable<BufferedReader>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract Lbuild()Builds the loader.buildAndLoadString(String input) Configure to read from a string, build, and load in one step.buildAndSaveString(ConfigurationNode output) Configure to write to a string, build, and save in one step.Gets the default configuration options to be used by the resultant loader.defaultOptions(UnaryOperator<ConfigurationOptions> defaultOptions) Sets the default configuration options to be used by the resultant loader by providing a function which takes the current default options and applies any desired changes.defaultOptions(ConfigurationOptions defaultOptions) Sets the default configuration options to be used by the resultant loader.editOptions(Consumer<net.kyori.option.OptionState.Builder> builderConsumer) Modify the state of loader options set on this loader.Sets the sink and source of the resultant loader to the given file.Gets the header mode to be used by the resultant loader.headerMode(HeaderMode mode) Sets the header mode of the resultant loader.protected net.kyori.option.OptionSchemaGet the schema of available options that can be set on this loader.net.kyori.option.OptionStateCompute a snapshot of the currently set options for created loaders.optionState(net.kyori.option.OptionState state) Set the option state for this loader to the provided state.protected net.kyori.option.OptionState.BuilderBegin building an option state, initialized from the current environment.Sets the sink and source of the resultant loader to the given path.@Nullable Callable<BufferedWriter>sink()Gets the sink to be used by the resultant loader.sink(@Nullable Callable<BufferedWriter> sink) Sets the sink of the resultant loader.@Nullable Callable<BufferedReader>source()Gets the source to be used by the resultant loader.source(@Nullable Callable<BufferedReader> source) Sets the source of the resultant loader.Sets the source of the resultant loader to the given URL.
- 
Field Details- 
SCHEMA
- 
HEADER_MODEHow to read and emit headers discovered on documents processed by the created loader.- Since:
- 4.2.0
 
- 
headerModeDeprecated.
- 
source
- 
sink
- 
defaultOptions
 
- 
- 
Constructor Details- 
Builderprotected Builder()Create a new builder.- Since:
- 4.0.0
 
 
- 
- 
Method Details- 
optionStateBuilderBegin building an option state, initialized from the current environment.- Returns:
- the pre-initialized option state builder
- Since:
- 4.2.0
 
- 
optionStateCompute a snapshot of the currently set options for created loaders.- Returns:
- the option state
- Since:
- 4.2.0
 
- 
optionStateSet the option state for this loader to the provided state.The provided state must be within the loader's schema.- Parameters:
- state- the state
- Returns:
- this builder
- Since:
- 4.2.0
 
- 
editOptionsModify the state of loader options set on this loader.- Parameters:
- builderConsumer- a consumer that receives the modifier to perform changes
- Returns:
- this builder
- Since:
- 4.2.0
 
- 
optionSchemaGet the schema of available options that can be set on this loader.This schema should inherit from UNSAFE_SCHEMA.- Returns:
- the option schema
- Since:
- 4.2.0
 
- 
fileSets the sink and source of the resultant loader to the given file.The sourceis defined usingFiles.newBufferedReader(Path)with UTF-8 encoding.The sinkis defined usingAtomicFileswith UTF-8 encoding.- Parameters:
- file- the configuration file
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
pathSets the sink and source of the resultant loader to the given path.The sourceis defined usingFiles.newBufferedReader(Path)with UTF-8 encoding.The sinkis defined usingAtomicFileswith UTF-8 encoding.- Parameters:
- path- the path of the configuration file
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
urlSets the source of the resultant loader to the given URL.- Parameters:
- url- the URL of the source
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
sourceSets the source of the resultant loader.The "source" is used by the loader to load the configuration. - Parameters:
- source- the source
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
sourceGets the source to be used by the resultant loader.- Returns:
- the source
- Since:
- 4.0.0
 
- 
sinkSets the sink of the resultant loader.The "sink" is used by the loader to save the configuration. - Parameters:
- sink- the sink
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
sinkGets the sink to be used by the resultant loader.- Returns:
- the sink
- Since:
- 4.0.0
 
- 
headerModeSets the header mode of the resultant loader.- Parameters:
- mode- the header mode
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
headerModeGets the header mode to be used by the resultant loader.- Returns:
- the header mode
- Since:
- 4.0.0
 
- 
defaultOptionsSets the default configuration options to be used by the resultant loader.- Parameters:
- defaultOptions- the options
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
defaultOptionsSets the default configuration options to be used by the resultant loader by providing a function which takes the current default options and applies any desired changes.- Parameters:
- defaultOptions- to transform the existing default options
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
defaultOptionsGets the default configuration options to be used by the resultant loader.- Returns:
- the options
- Since:
- 4.0.0
 
- 
buildBuilds the loader.- Returns:
- a new loader
- Since:
- 4.0.0
 
- 
buildAndLoadStringConfigure to read from a string, build, and load in one step.- Parameters:
- input- the input to load
- Returns:
- a deserialized node
- Throws:
- ConfigurateException
- Since:
- 4.1.0
 
- 
buildAndSaveStringConfigure to write to a string, build, and save in one step.- Parameters:
- output- the node to write
- Returns:
- the output string
- Throws:
- ConfigurateException
- Since:
- 4.1.0
 
 
-