public static class ConfigRegistry.DefaultConfigurationHandler extends java.lang.Object implements IConfigurationHandler
IConfigurationHandler
for configsConstructor and Description |
---|
ConfigRegistry.DefaultConfigurationHandler() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
convertToString(java.lang.Object config)
Converts the config into a string
|
java.io.File |
getConfigFile(java.lang.String fileName,
java.lang.Object config)
Called to get the config file
|
java.lang.Object |
getValue(java.lang.String configValue,
java.lang.String category,
java.lang.Object config)
Called when a value is requested
|
boolean |
hasValue(java.lang.String configValue,
java.lang.String category)
Returns whether the config contains the specified value
|
void |
loadFile(java.lang.String fileName,
java.lang.Object config,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.reflect.Field>> hint)
Called to load/create a config file
|
void |
loadFromString(java.lang.String string,
java.lang.Object config,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.reflect.Field>> hint)
Called to load/create a config from a string
|
void |
setValue(java.lang.String configValue,
java.lang.String category,
java.lang.Object value,
java.lang.Object config)
Called when a value is set/changed for a config, same as
IConfigurationHandler.setValue(String, String, Object, Object, boolean) but saveToFile is assumed true |
void |
setValue(java.lang.String configValue,
java.lang.String category,
java.lang.Object value,
java.lang.Object config,
boolean saveToFile)
Called when a value is set/changed for a config
|
public ConfigRegistry.DefaultConfigurationHandler()
public void setValue(java.lang.String configValue, java.lang.String category, java.lang.Object value, java.lang.Object config)
IConfigurationHandler
IConfigurationHandler.setValue(String, String, Object, Object, boolean)
but saveToFile is assumed truesetValue
in interface IConfigurationHandler
configValue
- The value being modifiedcategory
- The category the value is invalue
- The new valueconfig
- The config objectpublic void setValue(java.lang.String configValue, java.lang.String category, java.lang.Object value, java.lang.Object config, boolean saveToFile)
IConfigurationHandler
setValue
in interface IConfigurationHandler
configValue
- The value being modifiedcategory
- The category the value is invalue
- The new valueconfig
- The config objectsaveToFile
- Whether to save the new value to the filepublic java.lang.Object getValue(java.lang.String configValue, java.lang.String category, java.lang.Object config)
IConfigurationHandler
getValue
in interface IConfigurationHandler
configValue
- The value being modifiedcategory
- The category the value is inconfig
- The config objectpublic void loadFile(java.lang.String fileName, java.lang.Object config, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.reflect.Field>> hint)
IConfigurationHandler
loadFile
in interface IConfigurationHandler
fileName
- The file name for the configconfig
- The config objecthint
- A map full of field data (feel free to ignore this);
Outer map has the key = the category
Inner map has the key = the field name and the value = the actual fieldpublic void loadFromString(java.lang.String string, java.lang.Object config, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.reflect.Field>> hint)
IConfigurationHandler
loadFromString
in interface IConfigurationHandler
string
- The string containing all the dataconfig
- The config objecthint
- A map full of field data (feel free to ignore this);
Outer map has the key = the category
Inner map has the key = the field name and the value = the actual fieldpublic java.io.File getConfigFile(java.lang.String fileName, java.lang.Object config)
IConfigurationHandler
getConfigFile
in interface IConfigurationHandler
fileName
- The file name for the configconfig
- The config objectpublic boolean hasValue(java.lang.String configValue, java.lang.String category)
IConfigurationHandler
hasValue
in interface IConfigurationHandler
configValue
- The valuecategory
- The category the value is inpublic java.lang.String convertToString(java.lang.Object config)
IConfigurationHandler
convertToString
in interface IConfigurationHandler