Interface ConfigLoader

All Known Implementing Classes:
YamlConfigLoader

public interface ConfigLoader
Loads and saves configuration from/to sources.

Implementations handle specific file formats (YAML, JSON, etc.).

  • Method Details

    • load

      @NotNull @NotNull ConfigNode load(@NotNull @NotNull ConfigSource source) throws ConfigException
      Loads configuration from the given source.
      Parameters:
      source - the source to load from
      Returns:
      the root configuration node
      Throws:
      ConfigException - if loading fails
    • save

      void save(@NotNull @NotNull ConfigNode node, @NotNull @NotNull ConfigSource target) throws ConfigException
      Saves configuration to the given target.
      Parameters:
      node - the root node to save
      target - the target to save to
      Throws:
      ConfigException - if saving fails
    • createNode

      @NotNull @NotNull MutableConfigNode createNode()
      Creates an empty mutable root node for this loader.
      Returns:
      a new empty node
    • extensions

      @NotNull @NotNull String[] extensions()
      Gets the file extensions this loader handles.
      Returns:
      array of extensions (e.g., "yml", "yaml")