Class AnnotatedConfig
java.lang.Object
me.hsgamer.hscore.config.DecorativeConfig
me.hsgamer.hscore.config.annotated.AnnotatedConfig
- All Implemented Interfaces:
Config
The annotated
Config, where any fields can be assigned to the config with the annotation ConfigPath.
If the field is a final non-static, don't set default value directly, use constructor instead.
public class ExampleConfig extends AnnotatedConfig {
@ConfigPath("test1.path")
private final String test1 = "test1"; // If the field is final, Don't do this
@ConfigPath("test2.path")
private final String test2; // Do this instead
public ExampleConfig(Config config) {
super(config);
test2 = "test2"; // Set default value via the constructor
}
}
-
Field Summary
Fields inherited from class me.hsgamer.hscore.config.DecorativeConfig
config -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class me.hsgamer.hscore.config.DecorativeConfig
clear, contains, get, get, getComment, getComment, getInstance, getInstance, getKeys, getName, getNormalized, getNormalized, getNormalizedValues, getOriginal, getOriginalConfig, getValues, isInstance, isNormalizable, normalize, normalizeObject, remove, save, setComment, setComment, setIfAbsent, setIfAbsent
-
Constructor Details
-
AnnotatedConfig
Create an annotated config- Parameters:
config- the original config
-
-
Method Details
-
setup
public void setup()Description copied from interface:ConfigSet up the configuration- Specified by:
setupin interfaceConfig- Overrides:
setupin classDecorativeConfig
-
set
Description copied from interface:ConfigSet the value to the path- Specified by:
setin interfaceConfig- Overrides:
setin classDecorativeConfig- Parameters:
value- the valuepath- the path
-
reload
public void reload()Description copied from interface:ConfigReload the configuration- Specified by:
reloadin interfaceConfig- Overrides:
reloadin classDecorativeConfig
-