public static class ConfigRegistry.DefaultConfigurationHandler extends java.lang.Object implements IConfigurationHandler
IConfigurationHandler for configs| Constructor 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)
IConfigurationHandlerIConfigurationHandler.setValue(String, String, Object, Object, boolean) but saveToFile is assumed truesetValue in interface IConfigurationHandlerconfigValue - 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)
IConfigurationHandlersetValue in interface IConfigurationHandlerconfigValue - 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)
IConfigurationHandlergetValue in interface IConfigurationHandlerconfigValue - 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)
IConfigurationHandlerloadFile in interface IConfigurationHandlerfileName - 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)
IConfigurationHandlerloadFromString in interface IConfigurationHandlerstring - 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)
IConfigurationHandlergetConfigFile in interface IConfigurationHandlerfileName - The file name for the configconfig - The config objectpublic boolean hasValue(java.lang.String configValue,
java.lang.String category)
IConfigurationHandlerhasValue in interface IConfigurationHandlerconfigValue - The valuecategory - The category the value is inpublic java.lang.String convertToString(java.lang.Object config)
IConfigurationHandlerconvertToString in interface IConfigurationHandler