org.apache.commons.configuration.plist
Class PropertyListConfiguration

java.lang.Object
  extended byorg.apache.commons.configuration.event.EventSource
      extended byorg.apache.commons.configuration.AbstractConfiguration
          extended byorg.apache.commons.configuration.HierarchicalConfiguration
              extended byorg.apache.commons.configuration.AbstractHierarchicalFileConfiguration
                  extended byorg.apache.commons.configuration.plist.PropertyListConfiguration
All Implemented Interfaces:
Cloneable, Configuration, ConfigurationListener, FileConfiguration, Serializable

public class PropertyListConfiguration
extends AbstractHierarchicalFileConfiguration

NeXT / OpenStep style configuration. (http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Concepts/OldStylePListsConcept.html)

Example:

 {
     foo = "bar";

     array = ( value1, value2, value3 );

     data = <4f3e0145ab>;

     nested =
     {
         key1 = value1;
         key2 = value;
         nested =
         {
             foo = bar
         }
     }
 }
 

Since:
1.2
Version:
$Revision: 439648 $, $Date: 2006-09-02 22:42:10 +0200 (Sa, 02 Sep 2006) $
Author:
Emmanuel Bourg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.apache.commons.configuration.AbstractHierarchicalFileConfiguration
AbstractHierarchicalFileConfiguration.FileConfigurationDelegate
 
Nested classes inherited from class org.apache.commons.configuration.HierarchicalConfiguration
HierarchicalConfiguration.BuilderVisitor, HierarchicalConfiguration.Node, HierarchicalConfiguration.NodeVisitor
 
Field Summary
 
Fields inherited from class org.apache.commons.configuration.HierarchicalConfiguration
EVENT_ADD_NODES, EVENT_CLEAR_TREE
 
Fields inherited from class org.apache.commons.configuration.AbstractConfiguration
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_SET_PROPERTY, START_TOKEN
 
Constructor Summary
PropertyListConfiguration()
          Creates an empty PropertyListConfiguration object which can be used to synthesize a new plist file by adding values and then saving().
PropertyListConfiguration(File file)
          Creates and loads the property list from the specified file.
PropertyListConfiguration(String fileName)
          Creates and loads the property list from the specified file.
PropertyListConfiguration(URL url)
          Creates and loads the property list from the specified URL.
 
Method Summary
 void load(Reader in)
          Load the configuration from the specified reader.
(package private)  String quoteString(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(Writer out)
          Save the configuration to the specified writer.
 
Methods inherited from class org.apache.commons.configuration.AbstractHierarchicalFileConfiguration
addPropertyDirect, clearProperty, clearTree, configurationChanged, containsKey, createDelegate, 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
 
Methods inherited from class org.apache.commons.configuration.HierarchicalConfiguration
addNodes, clearNode, clearNode, clone, configurationAt, configurationsAt, createAddPath, createNode, createSubnodeConfiguration, fetchAddNode, fetchNodeList, findLastPathNode, findPropertyNodes, getDefaultExpressionEngine, getExpressionEngine, getKeys, getMaxIndex, getRoot, getRootNode, nodeDefined, nodeDefined, removeNode, removeNode, setDefaultExpressionEngine, setExpressionEngine, setRoot, setRootNode, subset
 
Methods inherited from class org.apache.commons.configuration.AbstractConfiguration
addProperty, clear, clearPropertyDirect, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getList, getList, getListDelimiter, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, interpolate, interpolate, interpolateHelper, isDelimiterParsingDisabled, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setThrowExceptionOnMissing
 
Methods inherited from class org.apache.commons.configuration.event.EventSource
addConfigurationListener, clearConfigurationListeners, createEvent, fireEvent, getConfigurationListeners, isDetailEvents, removeConfigurationListener, setDetailEvents
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.configuration.Configuration
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
 

Constructor Detail

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

public PropertyListConfiguration(String fileName)
                          throws ConfigurationException
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

public PropertyListConfiguration(File file)
                          throws ConfigurationException
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

public PropertyListConfiguration(URL url)
                          throws ConfigurationException
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 Detail

load

public void load(Reader in)
          throws ConfigurationException
Description copied from interface: FileConfiguration
Load the configuration from the specified reader.

Parameters:
in - the reader
Throws:
ConfigurationException - if an error occurs during the load operation

save

public void save(Writer out)
          throws ConfigurationException
Description copied from interface: FileConfiguration
Save the configuration to the specified writer.

Parameters:
out - the writer
Throws:
ConfigurationException - if an error occurs during the save operation

quoteString

String quoteString(String s)
Quote the specified string if necessary, that's if the string contains: Quotes within the string are escaped.

Examples:



Copyright © 2001-2006 The Apache Software Foundation. All Rights Reserved.