Package dev.xdpxi.xdlib.api.v4
Class Config.ConfigLoader
java.lang.Object
dev.xdpxi.xdlib.api.v4.Config.ConfigLoader
- Enclosing class:
Config
Handles loading and saving configuration files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidloadConfig(Class<? extends Config.Configuration> configClass) Loads the configuration from the file specified in theConfig.Setupannotation.static voidsaveConfig(Class<? extends Config.Configuration> configClass, String configFilePath) Saves the current configuration to a file.
-
Constructor Details
-
ConfigLoader
public ConfigLoader()
-
-
Method Details
-
loadConfig
Loads the configuration from the file specified in theConfig.Setupannotation.- Parameters:
configClass- The configuration class.- Throws:
Exception- If an error occurs during loading.
-
saveConfig
public static void saveConfig(Class<? extends Config.Configuration> configClass, String configFilePath) throws IOException, IllegalAccessException Saves the current configuration to a file.- Parameters:
configClass- The configuration class.configFilePath- The file path to save the configuration to.- Throws:
IOException- If an error occurs during saving.IllegalAccessException- If a field cannot be accessed.
-