Configuration, ConfigurationErrorListener, ConfigurationListener, FileConfiguration, FileSystemBased, Reloadablepublic class PropertyListConfiguration extends AbstractHierarchicalFileConfiguration
References:
Example:
{
foo = "bar";
array = ( value1, value2, value3 );
data = <4f3e0145ab>;
date = <*D2007-05-05 20:05:00 +0100>;
nested =
{
key1 = value1;
key2 = value;
nested =
{
foo = bar
}
}
}
AbstractHierarchicalFileConfiguration.FileConfigurationDelegateHierarchicalConfiguration.BuilderVisitor, HierarchicalConfiguration.Node, HierarchicalConfiguration.NodeVisitorEND_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKENEVENT_ADD_NODES, EVENT_CLEAR_TREE, EVENT_SUBNODE_CHANGED| Constructor | Description |
|---|---|
PropertyListConfiguration() |
Creates an empty PropertyListConfiguration object which can be
used to synthesize a new plist file by adding values and
then saving().
|
PropertyListConfiguration(java.io.File file) |
Creates and loads the property list from the specified file.
|
PropertyListConfiguration(java.lang.String fileName) |
Creates and loads the property list from the specified file.
|
PropertyListConfiguration(java.net.URL url) |
Creates and loads the property list from the specified URL.
|
PropertyListConfiguration(HierarchicalConfiguration c) |
Creates a new instance of
PropertyListConfiguration and
copies the content of the specified configuration into this object. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addProperty(java.lang.String key,
java.lang.Object value) |
Add a property to the configuration.
|
void |
load(java.io.Reader in) |
Load the configuration from the specified reader.
|
void |
save(java.io.Writer out) |
Save the configuration to the specified writer.
|
void |
setProperty(java.lang.String key,
java.lang.Object value) |
Sets the value of the specified property.
|
addErrorLogListener, append, clearPropertyDirect, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolateHelper, isDelimiterParsingDisabled, isScalarValue, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setThrowExceptionOnMissingaddNodes, addPropertyDirect, clearProperty, clearTree, configurationChanged, configurationError, containsKey, createDelegate, fetchNodeList, getBasePath, getDelegate, getEncoding, getFile, getFileName, getFileSystem, getKeys, getKeys, getProperty, getReloadingStrategy, getReloadLock, getURL, isAutoSave, isEmpty, load, load, load, load, load, load, refresh, reload, resetFileSystem, save, save, save, save, save, save, setAutoSave, setBasePath, setDelegate, setEncoding, setFile, setFileName, setFileSystem, setReloadingStrategy, setURL, subnodeConfigurationChangedclear, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getList, getList, getLong, getLong, getLong, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, subsetaddConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEventsclear, clearNode, clearNode, clearReferences, clone, configurationAt, configurationAt, configurationsAt, createAddPath, createNode, createSubnodeConfiguration, createSubnodeConfiguration, fetchAddNode, findLastPathNode, findPropertyNodes, getDefaultExpressionEngine, getExpressionEngine, getMaxIndex, getRoot, getRootNode, interpolatedConfiguration, nodeDefined, nodeDefined, removeNode, removeNode, setDefaultExpressionEngine, setExpressionEngine, setRoot, setRootNode, subsetpublic PropertyListConfiguration()
public PropertyListConfiguration(HierarchicalConfiguration c)
PropertyListConfiguration and
copies the content of the specified configuration into this object.c - the configuration to copypublic PropertyListConfiguration(java.lang.String fileName) throws ConfigurationException
fileName - The name of the plist file to load.ConfigurationException - Error while loading the plist filepublic PropertyListConfiguration(java.io.File file) throws ConfigurationException
file - The plist file to load.ConfigurationException - Error while loading the plist filepublic PropertyListConfiguration(java.net.URL url) throws ConfigurationException
url - The location of the plist file to load.ConfigurationException - Error while loading the plist filepublic void setProperty(java.lang.String key, java.lang.Object value)
HierarchicalConfigurationsetProperty in interface ConfigurationsetProperty in class AbstractHierarchicalFileConfigurationkey - the key of the property to setvalue - the new value of this propertypublic void addProperty(java.lang.String key, java.lang.Object value)
Configurationresource.loader = fileis already present in the configuration and you call
addProperty("resource.loader", "classpath")
Then you will end up with a List like the following:
["file", "classpath"]
addProperty in interface ConfigurationaddProperty in class AbstractConfigurationkey - The key to add the property to.value - The value to add.public void load(java.io.Reader in) throws ConfigurationException
FileConfigurationin - the readerConfigurationException - if an error occurs during the load operationpublic void save(java.io.Writer out) throws ConfigurationException
FileConfigurationout - the writerConfigurationException - if an error occurs during the save operation