public class XMLConfigurationBackend extends Object implements ConfigurationBackend
| Constructor and Description |
|---|
XMLConfigurationBackend(File configurationFile)
Creates a new backend backed by the given file.
|
XMLConfigurationBackend(File configurationFile,
boolean create)
Creates a new backend backed by the given file.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getValue(String attribute)
Returns the value of the given attribute from the backend.
|
void |
putValue(String attribute,
String value)
Sets the value of the given attribute within the backend.
|
void |
save()
Saves the configuration.
|
public XMLConfigurationBackend(File configurationFile) throws ConfigurationException
configurationFile - The XML file to read the configuration fromConfigurationException - if the XML can not be read or parsedpublic XMLConfigurationBackend(File configurationFile, boolean create) throws ConfigurationException
configurationFile - The XML file to read the configuration fromcreate - true to create a new configuration when loading the
configuration from the given file fails, false to
throw a ConfigurationExceptionConfigurationException - if the XML can not be read or parsedpublic String getValue(String attribute) throws ConfigurationException
getValue in interface ConfigurationBackendattribute - The name of the attributeConfigurationException - if the attribute could not be foundConfigurationBackend.getValue(java.lang.String)public void putValue(String attribute, String value) throws ConfigurationException
putValue in interface ConfigurationBackendattribute - The name of the attribute to setvalue - The string representation of the valueConfigurationException - if the value could not be setConfigurationBackend.putValue(java.lang.String,
java.lang.String)public void save()
throws ConfigurationException
save in interface ConfigurationBackendConfigurationException - if the configuration could not be savedCopyright © 2026. All rights reserved.