public class XMLPropertyListConfiguration extends BaseHierarchicalConfiguration implements FileBasedConfiguration, FileLocatorAware
Example:
<?xml version="1.0"?> <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> <plist version="1.0"> <dict> <key>string</key> <string>value1</string> <key>integer</key> <integer>12345</integer> <key>real</key> <real>-123.45E-1</real> <key>boolean</key> <true/> <key>date</key> <date>2005-01-01T12:00:00Z</date> <key>data</key> <data>RHJhY28gRG9ybWllbnMgTnVucXVhbSBUaXRpbGxhbmR1cw==</data> <key>array</key> <array> <string>value1</string> <string>value2</string> <string>value3</string> </array> <key>dictionnary</key> <dict> <key>key1</key> <string>value1</string> <key>key2</key> <string>value2</string> <key>key3</key> <string>value3</string> </dict> <key>nested</key> <dict> <key>node1</key> <dict> <key>node2</key> <dict> <key>node3</key> <string>value</string> </dict> </dict> </dict> </dict> </plist>
BaseHierarchicalConfiguration.BuilderVisitor
Constructor and Description |
---|
XMLPropertyListConfiguration()
Creates an empty XMLPropertyListConfiguration object which can be
used to synthesize a new plist file by adding values and
then saving().
|
XMLPropertyListConfiguration(HierarchicalConfiguration<ImmutableNode> configuration)
Creates a new instance of
XMLPropertyListConfiguration and
copies the content of the specified configuration into this object. |
Modifier and Type | Method and Description |
---|---|
protected void |
addPropertyInternal(String key,
Object value)
Adds the property with the specified key.
|
void |
initFileLocator(FileLocator locator)
Stores the current file locator.
|
void |
read(Reader in)
Reads the content of this object from the given reader.
|
protected void |
setPropertyInternal(String key,
Object value)
Sets the value of the specified property.
|
void |
write(Writer out)
Writes the content of this object to the given writer.
|
childConfigurationsAt, childConfigurationsAt, cloneNodeModel, configurationAt, configurationAt, configurationsAt, configurationsAt, createSubConfigurationForTrackedNode, getNodeModel, getSubConfigurationNodeSelector, getSubConfigurationParentModel, immutableChildConfigurationsAt, immutableConfigurationAt, immutableConfigurationAt, immutableConfigurationsAt, initSubConfigurationForThisParent, interpolatedConfiguration, subnodeConfigurationChanged, subset
addNodes, addNodesInternal, addPropertyDirect, clearInternal, clearPropertyDirect, clearTree, clearTreeInternal, clone, containsKeyInternal, fetchNodeList, getExpressionEngine, getKeysInternal, getKeysInternal, getMaxIndex, getMaxIndexInternal, getModel, getPropertyInternal, getRootElementName, getRootElementNameInternal, isEmptyInternal, nodeDefined, nodeKey, resolveAddKey, resolveKey, resolveNodeKey, resolveUpdateKey, setExpressionEngine, sizeInternal, toString
addErrorLogListener, addProperty, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, containsKey, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getList, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setSynchronizer, setThrowExceptionOnMissing, size, unlock
addEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEvents
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addProperty, clear, clearProperty, getInterpolator, installInterpolator, setInterpolator, setProperty, subset
containsKey, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getKeys, getList, getList, getList, getList, getLong, getLong, getLong, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, immutableSubset, isEmpty, size
getSynchronizer, lock, setSynchronizer, unlock
public XMLPropertyListConfiguration()
public XMLPropertyListConfiguration(HierarchicalConfiguration<ImmutableNode> configuration)
XMLPropertyListConfiguration
and
copies the content of the specified configuration into this object.configuration
- the configuration to copyprotected void setPropertyInternal(String key, Object value)
AbstractHierarchicalConfiguration
setPropertyInternal
in class AbstractHierarchicalConfiguration<ImmutableNode>
key
- the key of the property to setvalue
- the new value of this propertyprotected void addPropertyInternal(String key, Object value)
AbstractHierarchicalConfiguration
ExpressionEngine
, so the passed in key
must match the requirements of this implementation.addPropertyInternal
in class AbstractHierarchicalConfiguration<ImmutableNode>
key
- the key of the new propertyvalue
- the value of the new propertypublic void initFileLocator(FileLocator locator)
initFileLocator
in interface FileLocatorAware
locator
- the current FileLocator
public void read(Reader in) throws ConfigurationException
FileBased
FileHandler
for reading data.read
in interface FileBased
in
- the readerConfigurationException
- if a non-I/O related problem occurs, e.g.
the data read does not have the expected formatpublic void write(Writer out) throws ConfigurationException
FileBased
FileHandler
for writing data.write
in interface FileBased
out
- the writerConfigurationException
- if a non-I/O related problem occurs, e.g.
the data read does not have the expected formatCopyright © 2001–2020 The Apache Software Foundation. All rights reserved.