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 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.
-
Method Details
-
load
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 savetarget- the target to save to- Throws:
ConfigException- if saving fails
-
createNode
Creates an empty mutable root node for this loader.- Returns:
- a new empty node
-
extensions
Gets the file extensions this loader handles.- Returns:
- array of extensions (e.g., "yml", "yaml")
-