Class YamlConfigLoader
java.lang.Object
tech.guilhermekaua.spigotboot.config.loader.YamlConfigLoader
- All Implemented Interfaces:
ConfigLoader
YAML configuration loader using SnakeYAML (bundled by the server platform — both Bukkit/Paper and BungeeCord ship SnakeYAML 2.x).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull MutableConfigNodeCreates an empty mutable root node for this loader.@NotNull String[]Gets the file extensions this loader handles.@NotNull ConfigNodeload(@NotNull ConfigSource source) Loads configuration from the given source.voidsave(@NotNull ConfigNode node, @NotNull ConfigSource target) Saves configuration to the given target.
-
Constructor Details
-
YamlConfigLoader
public YamlConfigLoader()
-
-
Method Details
-
load
@NotNull public @NotNull ConfigNode load(@NotNull @NotNull ConfigSource source) throws ConfigException Description copied from interface:ConfigLoaderLoads configuration from the given source.- Specified by:
loadin interfaceConfigLoader- Parameters:
source- the source to load from- Returns:
- the root configuration node
- Throws:
ConfigException- if loading fails
-
save
public void save(@NotNull @NotNull ConfigNode node, @NotNull @NotNull ConfigSource target) throws ConfigException Description copied from interface:ConfigLoaderSaves configuration to the given target.- Specified by:
savein interfaceConfigLoader- Parameters:
node- the root node to savetarget- the target to save to- Throws:
ConfigException- if saving fails
-
createNode
Description copied from interface:ConfigLoaderCreates an empty mutable root node for this loader.- Specified by:
createNodein interfaceConfigLoader- Returns:
- a new empty node
-
extensions
Description copied from interface:ConfigLoaderGets the file extensions this loader handles.- Specified by:
extensionsin interfaceConfigLoader- Returns:
- array of extensions (e.g., "yml", "yaml")
-