mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 10:38:19 +08:00
[3.1.0] fix(api): configuration reload problem
BREAKING CHANGES: Now we override "onReload()" method to define ConfigurationProvider how to reload the configs. Fix the problem that when the configuration file is read, the "reload()" method not working.
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyconfiguration-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
|
||||
@@ -26,10 +26,15 @@ public abstract class ConfigurationProvider<W extends ConfigurationWrapper> {
|
||||
|
||||
public abstract @NotNull W getConfiguration();
|
||||
|
||||
public abstract void reload() throws Exception;
|
||||
public void reload() throws Exception {
|
||||
onReload(); // 调用重写的Reload方法
|
||||
this.updateTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public abstract void save() throws Exception;
|
||||
|
||||
protected abstract void onReload() throws Exception;
|
||||
|
||||
public abstract void setHeaderComment(@Nullable String path, @Nullable List<String> comments);
|
||||
|
||||
public abstract void setInlineComment(@NotNull String path, @Nullable String comment);
|
||||
|
||||
Reference in New Issue
Block a user