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 java.lang.Object implements ConfigSource, ConfigTarget
An operator that can both read and write configurations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigProcessor<B,L>configured(org.gradle.api.Action<B> builderModifier)Create a derived configuration format that applies additional configuration to this format's builder.java.util.Set<java.lang.String>extensions()Get extensions known to be supported by this configuration format.ConfigurationNoderead(java.io.Reader reader)Read a node from the provided reader.ConfigurationNoderead(java.io.Reader reader, java.util.function.UnaryOperator<ConfigurationOptions> optionsModifier)Read a node from the provided reader.voidwrite(java.io.Writer destination, ConfigurationNode node)Write the contents ofnodeto thedestinationwriter.
-
-
-
Method Detail
-
read
public ConfigurationNode read(java.io.Reader reader) throws ConfigurateException
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(java.io.Reader reader, java.util.function.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
public void write(java.io.Writer destination, ConfigurationNode node) throws ConfigurateExceptionDescription 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
public ConfigProcessor<B,L> configured(org.gradle.api.Action<B> builderModifier)
Create a derived configuration format that applies additional configuration to this format's builder.- Parameters:
builderModifier- The builder modifier- Returns:
- a derived format
-
extensions
public java.util.Set<java.lang.String> extensions()
Get extensions known to be supported by this configuration format.- Returns:
- supported extensions
-
-