public class PropertyListConfiguration extends AbstractHierarchicalFileConfiguration
Example:
{ foo = "bar"; array = ( value1, value2, value3 ); data = <4f3e0145ab>; nested = { key1 = value1; key2 = value; nested = { foo = bar } } }
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 |
---|
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(HierarchicalConfiguration c)
Creates a new instance of
PropertyListConfiguration and
copies the content of the specified configuration into this object. |
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.
|
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.
|
(package private) java.lang.String |
quoteString(java.lang.String s)
Quote the specified string if necessary, that's if the string contains:
a space character (' ', '\t', '\r', '\n')
a quote '"'
special characters in plist files ('(', ')', '{', '}', '=', ';', ',')
Quotes within the string are escaped.
|
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 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 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)
java.lang.String quoteString(java.lang.String s)
Examples: