Class YamlConfigLoader

java.lang.Object
tech.guilhermekaua.spigotboot.config.loader.YamlConfigLoader
All Implemented Interfaces:
ConfigLoader

public class YamlConfigLoader extends Object implements ConfigLoader
YAML configuration loader using SnakeYAML (bundled by the server platform — both Bukkit/Paper and BungeeCord ship SnakeYAML 2.x).
  • Constructor Details

    • YamlConfigLoader

      public YamlConfigLoader()
  • Method Details

    • load

      @NotNull public @NotNull ConfigNode load(@NotNull @NotNull ConfigSource source) throws ConfigException
      Description copied from interface: ConfigLoader
      Loads configuration from the given source.
      Specified by:
      load in interface ConfigLoader
      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: ConfigLoader
      Saves configuration to the given target.
      Specified by:
      save in interface ConfigLoader
      Parameters:
      node - the root node to save
      target - the target to save to
      Throws:
      ConfigException - if saving fails
    • createNode

      @NotNull public @NotNull MutableConfigNode createNode()
      Description copied from interface: ConfigLoader
      Creates an empty mutable root node for this loader.
      Specified by:
      createNode in interface ConfigLoader
      Returns:
      a new empty node
    • extensions

      @NotNull public @NotNull String[] extensions()
      Description copied from interface: ConfigLoader
      Gets the file extensions this loader handles.
      Specified by:
      extensions in interface ConfigLoader
      Returns:
      array of extensions (e.g., "yml", "yaml")