Class ConfigProcessor<B extends AbstractConfigurationLoader.Builder<B,L>,L extends AbstractConfigurationLoader<?>>
java.lang.Object
ca.stellardrift.build.configurate.ConfigProcessor<B,L>
- Type Parameters:
B- builder typeL- loader type
- All Implemented Interfaces:
ConfigSource,ConfigTarget
public final class ConfigProcessor<B extends AbstractConfigurationLoader.Builder<B,L>,L extends AbstractConfigurationLoader<?>>
extends Object
implements ConfigSource, ConfigTarget
An operator that can both read and write configurations.
-
Method Summary
Modifier and TypeMethodDescriptionconfigured(org.gradle.api.Action<B> builderModifier) Create a derived configuration format that applies additional configuration to this format's builder.Get extensions known to be supported by this configuration format.Read a node from the provided reader.read(Reader reader, UnaryOperator<ConfigurationOptions> optionsModifier) Read a node from the provided reader.voidwrite(Writer destination, ConfigurationNode node) Write the contents ofnodeto thedestinationwriter.
-
Method Details
-
read
Description copied from interface:ConfigSourceRead a node from the provided reader.- Specified by:
readin interfaceConfigSource- Parameters:
reader- the reader to use- Returns:
- a loaded node
- Throws:
ConfigurateException- if any error occurs while loading
-
read
public ConfigurationNode read(Reader reader, UnaryOperator<ConfigurationOptions> optionsModifier) throws ConfigurateException Description copied from interface:ConfigSourceRead a node from the provided reader.- Specified by:
readin interfaceConfigSource- Parameters:
reader- the reader to useoptionsModifier- an operator to tweak the options used in this source- Returns:
- a loaded node
- Throws:
ConfigurateException- if any error occurs while loading
-
write
Description copied from interface:ConfigTargetWrite the contents ofnodeto thedestinationwriter.- Specified by:
writein interfaceConfigTarget- Parameters:
destination- target to write tonode- source node- Throws:
ConfigurateException- if any part of the node could not be written
-
configured
Create a derived configuration format that applies additional configuration to this format's builder.- Parameters:
builderModifier- The builder modifier- Returns:
- a derived format
-
extensions
Get extensions known to be supported by this configuration format.- Returns:
- supported extensions
-