Interface YamlImplementation
- All Known Implementing Classes:
SimpleYamlImplementation,SnakeYamlImplementation,YamlImplementationCommentable
public interface YamlImplementation
A YAML implementation to load/parse and dump/save a
ConfigurationSection.-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(YamlConfigurationOptions options) Apply the configuration options to this implementation.voiddump(Writer writer, ConfigurationSection section) Dump section values to Yaml.default Stringdump(ConfigurationSection section) Dump section values to a Yaml string.voidload(Reader reader, ConfigurationSection section) Load Yaml to a configuration section.default voidload(String contents, ConfigurationSection section) Load Yaml to a configuration section.default voidload(SupplierIO.Reader readerSupplier, ConfigurationSection section) Load Yaml to a configuration section.
-
Method Details
-
load
void load(Reader reader, ConfigurationSection section) throws IOException, InvalidConfigurationException Load Yaml to a configuration section.- Parameters:
reader- a reader of Yaml contents to loadsection- the configuration to fill with the contents- Throws:
IOException- if cannot read contents.InvalidConfigurationException- if contents is not a valid Yaml configuration
-
load
default void load(SupplierIO.Reader readerSupplier, ConfigurationSection section) throws IOException, InvalidConfigurationException Load Yaml to a configuration section.- Parameters:
readerSupplier- a function providing a reader of Yaml contents to loadsection- the configuration to fill with the contents- Throws:
IOException- if cannot read contents.InvalidConfigurationException- if contents is not a valid Yaml configuration
-
load
default void load(String contents, ConfigurationSection section) throws IOException, InvalidConfigurationException Load Yaml to a configuration section.- Parameters:
contents- a Yaml string with contents to loadsection- the configuration to fill with the contents- Throws:
IOException- if cannot read contents.InvalidConfigurationException- if contents is not a valid Yaml string
-
dump
Dump section values to Yaml.- Parameters:
writer- writer to dump valuessection- section with values to dump- Throws:
IOException
-
dump
Dump section values to a Yaml string.- Parameters:
section- section with values to dump- Returns:
- the values as a valid Yaml string
- Throws:
IOException
-
configure
Apply the configuration options to this implementation.- Parameters:
options- yaml options
-