Class PropertyListConfiguration
java.lang.Object
org.apache.commons.configuration.event.EventSource
org.apache.commons.configuration.AbstractConfiguration
org.apache.commons.configuration.HierarchicalConfiguration
org.apache.commons.configuration.AbstractHierarchicalFileConfiguration
org.apache.commons.configuration.plist.PropertyListConfiguration
- All Implemented Interfaces:
Serializable, Cloneable, Configuration, ConfigurationErrorListener, ConfigurationListener, FileConfiguration, FileSystemBased, Reloadable
NeXT / OpenStep style configuration. This configuration can read and write
ASCII plist files. It supports the GNUStep extension to specify date objects.
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
}
}
}
- Since:
- 1.2
- Version:
- $Id: PropertyListConfiguration.java 1210637 2011-12-05 21:12:12Z oheger $
- Author:
- Emmanuel Bourg
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractHierarchicalFileConfiguration
AbstractHierarchicalFileConfiguration.FileConfigurationDelegateNested classes/interfaces inherited from class HierarchicalConfiguration
HierarchicalConfiguration.BuilderVisitor, HierarchicalConfiguration.Node, HierarchicalConfiguration.NodeVisitor -
Field Summary
Fields inherited from class HierarchicalConfiguration
EVENT_ADD_NODES, EVENT_CLEAR_TREE, EVENT_SUBNODE_CHANGEDFields inherited from class AbstractConfiguration
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKEN -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty PropertyListConfiguration object which can be used to synthesize a new plist file by adding values and then saving().Creates and loads the property list from the specified file.PropertyListConfiguration(String fileName) Creates and loads the property list from the specified file.Creates and loads the property list from the specified URL.Creates a new instance ofPropertyListConfigurationand copies the content of the specified configuration into this object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String key, Object value) Add a property to the configuration.voidLoad the configuration from the specified reader.voidSave the configuration to the specified writer.voidsetProperty(String key, Object value) Sets the value of the specified property.Methods inherited from class AbstractHierarchicalFileConfiguration
addNodes, 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, subnodeConfigurationChangedMethods inherited from class HierarchicalConfiguration
clear, 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, subsetMethods inherited from class AbstractConfiguration
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, setThrowExceptionOnMissingMethods inherited from class EventSource
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEventsMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Configuration
clear, 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, subset
-
Constructor Details
-
PropertyListConfiguration
public PropertyListConfiguration()Creates an empty PropertyListConfiguration object which can be used to synthesize a new plist file by adding values and then saving(). -
PropertyListConfiguration
Creates a new instance ofPropertyListConfigurationand copies the content of the specified configuration into this object.- Parameters:
c- the configuration to copy- Since:
- 1.4
-
PropertyListConfiguration
Creates and loads the property list from the specified file.- Parameters:
fileName- The name of the plist file to load.- Throws:
ConfigurationException- Error while loading the plist file
-
PropertyListConfiguration
Creates and loads the property list from the specified file.- Parameters:
file- The plist file to load.- Throws:
ConfigurationException- Error while loading the plist file
-
PropertyListConfiguration
Creates and loads the property list from the specified URL.- Parameters:
url- The location of the plist file to load.- Throws:
ConfigurationException- Error while loading the plist file
-
-
Method Details
-
setProperty
Description copied from class:HierarchicalConfigurationSets the value of the specified property.- Specified by:
setPropertyin interfaceConfiguration- Overrides:
setPropertyin classAbstractHierarchicalFileConfiguration- Parameters:
key- the key of the property to setvalue- the new value of this property
-
addProperty
Description copied from interface:ConfigurationAdd a property to the configuration. If it already exists then the value stated here will be added to the configuration entry. For example, if the property:resource.loader = file
is already present in the configuration and you calladdProperty("resource.loader", "classpath")Then you will end up with a List like the following:["file", "classpath"]
- Specified by:
addPropertyin interfaceConfiguration- Overrides:
addPropertyin classAbstractConfiguration- Parameters:
key- The key to add the property to.value- The value to add.
-
load
Description copied from interface:FileConfigurationLoad the configuration from the specified reader.- Parameters:
in- the reader- Throws:
ConfigurationException- if an error occurs during the load operation
-
save
Description copied from interface:FileConfigurationSave the configuration to the specified writer.- Parameters:
out- the writer- Throws:
ConfigurationException- if an error occurs during the save operation
-