Class Json5GenericConfiguration<T extends AbstractJsonConfiguration>
java.lang.Object
com.dianxin.tori.base.configuration.json.Json5GenericConfiguration<T>
- Type Parameters:
T- The concrete configuration type, which must extendAbstractJsonConfiguration
A generic configuration manager that supports reading, saving,
and hot-reloading JSON5 configuration files at runtime.
-
Constructor Summary
ConstructorsConstructorDescriptionJson5GenericConfiguration(String defaultResource, String filePath, Class<T> clazz) Initializes the JSON5 configuration manager. -
Method Summary
Modifier and TypeMethodDescriptionvoidReloads the configuration instance directly from the JSON5 file.voidSaves the current configuration instance state back to the JSON5 file.
-
Constructor Details
-
Json5GenericConfiguration
public Json5GenericConfiguration(String defaultResource, String filePath, Class<T> clazz) throws IOException Initializes the JSON5 configuration manager. If the target configuration file does not exist, it will be copied from the specified default resource.- Parameters:
defaultResource- The fallback resource path inside the JAR (e.g., "config.json5")filePath- The target file path on the server filesystemclazz- TheClass<T>token of the concrete configuration- Throws:
IOException- If an I/O error occurs during reading or writing
-
-
Method Details
-
reloadConfig
public void reloadConfig()Reloads the configuration instance directly from the JSON5 file. -
saveConfig
public void saveConfig()Saves the current configuration instance state back to the JSON5 file. -
getConfigFile
-
getBotConfig
-