public class XMLPropertyListConfiguration extends AbstractHierarchicalFileConfiguration
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:00-0700</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>
Modifier and Type | Class and Description |
---|---|
static class |
XMLPropertyListConfiguration.ArrayNode
Container for array elements.
|
static class |
XMLPropertyListConfiguration.PListNode
Node extension with addXXX methods to parse the typed data passed by Digester.
|
private class |
XMLPropertyListConfiguration.SetNextAndPopRule
Digester rule that sets the object on the stack to the n-1 object
and remove both of them from the stack.
|
AbstractHierarchicalFileConfiguration.FileConfigurationDelegate
HierarchicalConfiguration.BuilderVisitor, HierarchicalConfiguration.Node, HierarchicalConfiguration.NodeVisitor
Modifier and Type | Field and Description |
---|---|
private static int |
INDENT_SIZE
Size of the indentation for the generated file.
|
private static long |
serialVersionUID
The serial version UID.
|
EVENT_ADD_NODES, EVENT_CLEAR_TREE
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKEN
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(java.io.File file)
Creates and loads the property list from the specified file.
|
XMLPropertyListConfiguration(HierarchicalConfiguration c)
Creates a new instance of
XMLPropertyListConfiguration and
copies the content of the specified configuration into this object. |
XMLPropertyListConfiguration(java.lang.String fileName)
Creates and loads the property list from the specified file.
|
XMLPropertyListConfiguration(java.net.URL url)
Creates and loads the property list from the specified URL.
|
Modifier and Type | Method and Description |
---|---|
void |
load(java.io.Reader in)
Load the configuration from the specified reader.
|
private void |
printNode(java.io.PrintWriter out,
int indentLevel,
HierarchicalConfiguration.Node node)
Append a node to the writer, indented according to a specific level.
|
private void |
printValue(java.io.PrintWriter out,
int indentLevel,
java.lang.Object value)
Append a value to the writer, indented according to a specific level.
|
void |
save(java.io.Writer out)
Save the configuration to the specified writer.
|
addPropertyDirect, clearProperty, clearTree, configurationChanged, containsKey, createDelegate, fetchNodeList, getBasePath, getDelegate, getEncoding, getFile, getFileName, getKeys, getProperty, getReloadingStrategy, getURL, isAutoSave, isEmpty, load, load, load, load, load, load, reload, save, save, save, save, save, save, setAutoSave, setBasePath, setDelegate, setEncoding, setFile, setFileName, setProperty, setReloadingStrategy, setURL
addNodes, clearNode, clearNode, clearReferences, clone, configurationAt, configurationsAt, createAddPath, createNode, createSubnodeConfiguration, fetchAddNode, findLastPathNode, findPropertyNodes, getDefaultExpressionEngine, getExpressionEngine, getKeys, getMaxIndex, getRoot, getRootNode, nodeDefined, nodeDefined, removeNode, removeNode, setDefaultExpressionEngine, setExpressionEngine, setRoot, setRootNode, subset
addErrorLogListener, addProperty, clear, clearPropertyDirect, 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, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setThrowExceptionOnMissing
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProperty, clear, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, subset
private static final long serialVersionUID
private static final int INDENT_SIZE
public XMLPropertyListConfiguration()
public XMLPropertyListConfiguration(HierarchicalConfiguration c)
XMLPropertyListConfiguration
and
copies the content of the specified configuration into this object.c
- the configuration to copypublic XMLPropertyListConfiguration(java.lang.String fileName) throws ConfigurationException
fileName
- The name of the plist file to load.ConfigurationException
- Error
while loading the plist filepublic XMLPropertyListConfiguration(java.io.File file) throws ConfigurationException
file
- The plist file to load.ConfigurationException
- Error while loading the plist filepublic XMLPropertyListConfiguration(java.net.URL url) throws ConfigurationException
url
- The location of the plist file to load.ConfigurationException
- Error while loading the plist filepublic void load(java.io.Reader in) throws ConfigurationException
FileConfiguration
in
- the readerConfigurationException
- if an error occurs during the load operationpublic void save(java.io.Writer out) throws ConfigurationException
FileConfiguration
out
- the writerConfigurationException
- if an error occurs during the save operationprivate void printNode(java.io.PrintWriter out, int indentLevel, HierarchicalConfiguration.Node node)
private void printValue(java.io.PrintWriter out, int indentLevel, java.lang.Object value)