commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r820541 - in /commons/proper/configuration/branches/configuration2_experimental/src: main/java/org/apache/commons/configuration2/base/ test/java/org/apache/commons/configuration2/base/
Date Thu, 01 Oct 2009 06:02:49 GMT
Author: oheger
Date: Thu Oct  1 06:02:48 2009
New Revision: 820541

URL: http://svn.apache.org/viewvc?rev=820541&view=rev
Log:
Renamed ConfigurationSource to FlatConfigurationSource.

Added:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java   (contents, props changed)
      - copied, changed from r820433, commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSource.java
Removed:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSource.java
Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceEventWrapper.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceUtils.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatLeafNode.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNode.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeHandler.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeSourceAdapter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatRootNode.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalSourceAdapter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/MapConfigurationSource.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceEventWrapper.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceUtils.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestHierarchicalSourceAdapter.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceEventWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceEventWrapper.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceEventWrapper.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceEventWrapper.java Thu Oct  1 06:02:48 2009
@@ -22,27 +22,27 @@
 
 /**
  * <p>
- * A specialized implementation of {@code ConfigurationSource} that allows
+ * A specialized implementation of {@code FlatConfigurationSource} that allows
  * adding support for event notifications to a wrapped {@code
- * ConfigurationSource}.
+ * FlatConfigurationSource}.
  * </p>
  * <p>
- * This class is a wrapper around another {@code ConfigurationSource}. The
- * methods defined by the {@code ConfigurationSource} interface are - to the
+ * This class is a wrapper around another {@code FlatConfigurationSource}. The
+ * methods defined by the {@code FlatConfigurationSource} interface are - to the
  * major part - implemented by delegating to the wrapped source. If a method
  * requires firing an event, the event is fired by this class before and after
  * the wrapped source is invoked. This way support for event notifications can
- * be added to arbitrary {@code ConfigurationSource} implementations
+ * be added to arbitrary {@code FlatConfigurationSource} implementations
  * transparently.
  * </p>
  *
  * @author Commons Configuration team
  * @version $Id$
  */
-public class ConfigurationSourceEventWrapper implements ConfigurationSource
+public class ConfigurationSourceEventWrapper implements FlatConfigurationSource
 {
     /** Stores the wrapped configuration source. */
-    private final ConfigurationSource wrappedSource;
+    private final FlatConfigurationSource wrappedSource;
 
     /** The list with the event listeners that have been registered. */
     private final List<ConfigurationSourceListener> listeners;
@@ -54,7 +54,7 @@
      * @param wrapped the source to be wrapped (must not be <b>null</b>)
      * @throws IllegalArgumentException if the wrapped source is <b>null</b>
      */
-    public ConfigurationSourceEventWrapper(ConfigurationSource wrapped)
+    public ConfigurationSourceEventWrapper(FlatConfigurationSource wrapped)
     {
         if (wrapped == null)
         {
@@ -71,7 +71,7 @@
      *
      * @return the wrapped source
      */
-    public ConfigurationSource getWrappedSource()
+    public FlatConfigurationSource getWrappedSource()
     {
         return wrappedSource;
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceUtils.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceUtils.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSourceUtils.java Thu Oct  1 06:02:48 2009
@@ -25,8 +25,8 @@
  * </p>
  * <p>
  * This class can be used for safely calling methods on a
- * {@link ConfigurationSource} object that are optional. If the
- * {@link ConfigurationSource} implements the method, it is invoked directly.
+ * {@link FlatConfigurationSource} object that are optional. If the
+ * {@link FlatConfigurationSource} implements the method, it is invoked directly.
  * Otherwise, a default implementation is provided that will be called.
  * </p>
  *
@@ -53,9 +53,9 @@
      * @return <b>true</b> if the configuration source is empty, <b>false</b>
      *         otherwise
      * @throws IllegalArgumentException if the source is <b>null</b>
-     * @see ConfigurationSource#isEmpty()
+     * @see FlatConfigurationSource#isEmpty()
      */
-    public static boolean isEmpty(ConfigurationSource source)
+    public static boolean isEmpty(FlatConfigurationSource source)
     {
         checkNullSource(source);
         try
@@ -78,9 +78,9 @@
      * @param source the {@code ConfigurationSource} (must not be <b>null</b>)
      * @return the size of the {@code ConfigurationSource}
      * @throws IllegalArgumentException if the source is <b>null</b>
-     * @see ConfigurationSource#size()
+     * @see FlatConfigurationSource#size()
      */
-    public static int size(ConfigurationSource source)
+    public static int size(FlatConfigurationSource source)
     {
         checkNullSource(source);
 
@@ -109,9 +109,9 @@
      * @param key the key of the property to be tested
      * @return the number of values stored for this property
      * @throws IllegalArgumentException if the source is <b>null</b>
-     * @see ConfigurationSource#valueCount(String)
+     * @see FlatConfigurationSource#valueCount(String)
      */
-    public static int valueCount(ConfigurationSource source, String key)
+    public static int valueCount(FlatConfigurationSource source, String key)
     {
         checkNullSource(source);
 
@@ -144,9 +144,9 @@
      * @return an {@code Iterator} over all keys contained in this {@code
      *         ConfigurationSource} starting with the given prefix
      * @throws IllegalArgumentException if the source is <b>null</b>
-     * @see ConfigurationSource#getKeys(String)
+     * @see FlatConfigurationSource#getKeys(String)
      */
-    public static Iterator<String> getKeys(ConfigurationSource source,
+    public static Iterator<String> getKeys(FlatConfigurationSource source,
             String prefix)
     {
         checkNullSource(source);
@@ -168,7 +168,7 @@
      * @param source the source in question
      * @throws IllegalArgumentException if the source is <b>null</b>
      */
-    private static void checkNullSource(ConfigurationSource source)
+    private static void checkNullSource(FlatConfigurationSource source)
     {
         if (source == null)
         {

Copied: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java (from r820433, commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSource.java)
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java?p2=commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java&p1=commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSource.java&r1=820433&r2=820541&rev=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/ConfigurationSource.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java Thu Oct  1 06:02:48 2009
@@ -20,14 +20,14 @@
 
 /**
  * <p>
- * An interface defining a source for configuration settings.
+ * An interface defining a non-hierarchical source for configuration settings.
  * </p>
  * <p>
  * This interfaces defines a set of fundamental methods for dealing with
- * configuration properties. The (raw) values of properties can be queried or
- * set, new properties can be added, or existing properties can be removed.
- * Further, it is possible to iterate over the property keys stored in this
- * configuration source.
+ * configuration properties in a map-like fashion. The (raw) values of
+ * properties can be queried or set, new properties can be added, or existing
+ * properties can be removed. Further, it is possible to iterate over the
+ * property keys stored in this configuration source.
  * </p>
  * <p>
  * All of the operations provided by this interface are on a very basic level.
@@ -50,7 +50,7 @@
  * that an implementation is free to ignore these methods and throw an {@code
  * UnsupportedOperationException}. The background is that it is possible to
  * implement these methods using a combination of other (non optional) methods
- * provided by {@code ConfigurationSource}. For instance, the {@code size()}
+ * provided by {@code FlatConfigurationSource}. For instance, the {@code size()}
  * method can be implemented by iterating over the keys contained in this
  * configuration source, calling {@code getProperty()} on each, and counting the
  * values returned. If an implementation is able to provide more efficient
@@ -61,7 +61,7 @@
  * @author Commons Configuration team
  * @version $Id$
  */
-public interface ConfigurationSource
+public interface FlatConfigurationSource
 {
     /**
      * Checks if the configuration is empty. This is an optional operation. It

Propchange: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatConfigurationSource.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatLeafNode.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatLeafNode.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatLeafNode.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatLeafNode.java Thu Oct  1 06:02:48 2009
@@ -165,7 +165,7 @@
      * @return the value of the represented property
      */
     @Override
-    public Object getValue(ConfigurationSource config)
+    public Object getValue(FlatConfigurationSource config)
     {
         Object value = config.getProperty(getName());
         if (value instanceof Collection<?>)
@@ -213,7 +213,7 @@
      * @throws ConfigurationRuntimeException if the child cannot be removed
      */
     @Override
-    public void removeChild(ConfigurationSource config, FlatNode child)
+    public void removeChild(FlatConfigurationSource config, FlatNode child)
     {
         throw new ConfigurationRuntimeException(
                 "Cannot remove a child from a leaf node!");
@@ -230,7 +230,7 @@
      * @param value the new value
      */
     @Override
-    public void setValue(ConfigurationSource config, Object value)
+    public void setValue(FlatConfigurationSource config, Object value)
     {
         if (hasValue)
         {

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNode.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNode.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNode.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNode.java Thu Oct  1 06:02:48 2009
@@ -27,7 +27,7 @@
  * configuration source.
  * </p>
  * <p>
- * The {@link ConfigurationSource} interface provides a map-oriented access to
+ * The {@link FlatConfigurationSource} interface provides a map-oriented access to
  * configuration settings rather than organizing data in a hierarchical
  * structure. Nevertheless, the {@link Configuration} interface defines some
  * operations that are hierarchical in nature. This is required for instance to
@@ -79,7 +79,7 @@
      * @param config the owning {@code ConfigurationSource}
      * @return the value of this node
      */
-    public abstract Object getValue(ConfigurationSource config);
+    public abstract Object getValue(FlatConfigurationSource config);
 
     /**
      * Sets the value of this node. An implementation can access the passed in
@@ -89,7 +89,7 @@
      * @param value the new value
      * @throws ConfigurationRuntimeException if the value cannot be set
      */
-    public abstract void setValue(ConfigurationSource config, Object value);
+    public abstract void setValue(FlatConfigurationSource config, Object value);
 
     /**
      * Returns the index of the value represented by this node. This is needed
@@ -162,5 +162,5 @@
      * @param child the child to be removed
      * @throws ConfigurationRuntimeException if the child cannot be removed
      */
-    public abstract void removeChild(ConfigurationSource config, FlatNode child);
+    public abstract void removeChild(FlatConfigurationSource config, FlatNode child);
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeHandler.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeHandler.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeHandler.java Thu Oct  1 06:02:48 2009
@@ -37,8 +37,8 @@
  * </p>
  * <p>
  * Actions caused by this node handler may modify the associated
- * {@link ConfigurationSource} and thus trigger change events. Per default a
- * change of the {@link ConfigurationSource} causes the invalidation of the node
+ * {@link FlatConfigurationSource} and thus trigger change events. Per default a
+ * change of the {@link FlatConfigurationSource} causes the invalidation of the node
  * structure. Because of that the node handler has to keep track of the updates
  * caused by itself to avoid unnecessary invalidation of nodes. (The adapter
  * implementation using this {@code NodeHandler} to simulate a hierarchical
@@ -58,7 +58,7 @@
 class FlatNodeHandler extends AbstractNodeHandler<FlatNode>
 {
     /** Stores the associated ConfigurationSource. */
-    private final ConfigurationSource configurationSource;
+    private final FlatConfigurationSource configurationSource;
 
     /**
      * A flag whether an update of the configuration was caused by an operation
@@ -72,7 +72,7 @@
      *
      * @param config the {@code ConfigurationSource}
      */
-    public FlatNodeHandler(ConfigurationSource config)
+    public FlatNodeHandler(FlatConfigurationSource config)
     {
         configurationSource = config;
     }
@@ -83,7 +83,7 @@
      *
      * @return the associated {@code ConfigurationSource}
      */
-    public ConfigurationSource getConfigurationSource()
+    public FlatConfigurationSource getConfigurationSource()
     {
         return configurationSource;
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeSourceAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeSourceAdapter.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeSourceAdapter.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatNodeSourceAdapter.java Thu Oct  1 06:02:48 2009
@@ -23,7 +23,7 @@
 /**
  * <p>
  * An adapter implementation for converting a &quot;flat&quot;
- * {@link ConfigurationSource} into a hierarchical one based on {@link FlatNode}
+ * {@link FlatConfigurationSource} into a hierarchical one based on {@link FlatNode}
  * node objects.
  * </p>
  * <p>
@@ -51,7 +51,7 @@
         HierarchicalConfigurationSource<FlatNode>, ConfigurationSourceListener
 {
     /** The wrapped configuration source. */
-    private final ConfigurationSource originalSource;
+    private final FlatConfigurationSource originalSource;
 
     /** The node handler for accessing the flat nodes. */
     private final FlatNodeHandler nodeHandler;
@@ -69,7 +69,7 @@
      * @throws IllegalArgumentException if the passed in {@code
      *         ConfigurationSource} is <b>null</b>
      */
-    public FlatNodeSourceAdapter(ConfigurationSource wrappedSource)
+    public FlatNodeSourceAdapter(FlatConfigurationSource wrappedSource)
     {
         if (wrappedSource == null)
         {
@@ -88,7 +88,7 @@
      *
      * @return the original {@code ConfigurationSource}
      */
-    public ConfigurationSource getOriginalSource()
+    public FlatConfigurationSource getOriginalSource()
     {
         return originalSource;
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatRootNode.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatRootNode.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatRootNode.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/FlatRootNode.java Thu Oct  1 06:02:48 2009
@@ -190,7 +190,7 @@
      * @return the value of this node
      */
     @Override
-    public Object getValue(ConfigurationSource config)
+    public Object getValue(FlatConfigurationSource config)
     {
         return null;
     }
@@ -217,7 +217,7 @@
      *         node
      */
     @Override
-    public void removeChild(ConfigurationSource config, FlatNode child)
+    public void removeChild(FlatConfigurationSource config, FlatNode child)
     {
         if (child != null)
         {
@@ -252,7 +252,7 @@
      * @throws ConfigurationRuntimeException if the value cannot be set
      */
     @Override
-    public void setValue(ConfigurationSource config, Object value)
+    public void setValue(FlatConfigurationSource config, Object value)
     {
         throw new ConfigurationRuntimeException(
                 "Cannot set the value of the root node of a flat configuration!");
@@ -284,7 +284,7 @@
      * @param index the value index of this child node
      * @param value the new value
      */
-    void setMultiProperty(ConfigurationSource config, FlatNode child,
+    void setMultiProperty(FlatConfigurationSource config, FlatNode child,
             int index, Object value)
     {
         changeMultiProperty(config, child, index, value, false);
@@ -333,7 +333,7 @@
      * @param value the new value
      * @param remove a flag whether the value at the index is to be removed
      */
-    private static void changeMultiProperty(ConfigurationSource config,
+    private static void changeMultiProperty(FlatConfigurationSource config,
             FlatNode child, int index, Object value, boolean remove)
     {
         Object val = config.getProperty(child.getName());

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java Thu Oct  1 06:02:48 2009
@@ -39,7 +39,7 @@
  * </p>
  * <p>
  * The motivation and purpose for this interface are analogous to
- * {@link ConfigurationSource}, but the organization of the data is different.
+ * {@link FlatConfigurationSource}, but the organization of the data is different.
  * Because many typical sources used for storing configuration settings are
  * hierarchical in nature (e.g. XML documents, the Java Preferences API, or
  * JNDI) it makes sense to have this interface for providing a uniform access to

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalSourceAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalSourceAdapter.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalSourceAdapter.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalSourceAdapter.java Thu Oct  1 06:02:48 2009
@@ -24,14 +24,14 @@
 /**
  * <p>
  * An adapter implementation for converting a &quot;flat&quot;
- * {@link ConfigurationSource} into a hierarchical one.
+ * {@link FlatConfigurationSource} into a hierarchical one.
  * </p>
  * <p>
  * {@link ConfigurationImpl}, the main implementation of the
  * {@link Configuration} interface, requires a hierarchical configuration source
  * for accessing configuration settings. It does not work with sources
- * implementing only the {@link ConfigurationSource} interface out of the box.
- * With this adapter class a {@link ConfigurationSource} object can be treated
+ * implementing only the {@link FlatConfigurationSource} interface out of the box.
+ * With this adapter class a {@link FlatConfigurationSource} object can be treated
  * as a {@link HierarchicalConfigurationSource}.
  * </p>
  * <p>
@@ -44,18 +44,18 @@
  * </p>
  * <p>
  * Changes at the data of the configuration used for the transformation are not
- * written back into the original {@link ConfigurationSource} automatically.
+ * written back into the original {@link FlatConfigurationSource} automatically.
  * This can be done by calling the {@code writeBack()} method. This will clear
  * the original source and then copy all data from this source into it.
  * </p>
  * <p>
  * It is possible to configure this adapter to register as an event listener at
- * the original {@link ConfigurationSource}. Every change event fired by the
- * {@link ConfigurationSource} causes the configuration used internally to be
- * re-constructed with the current data of the {@link ConfigurationSource}. This
+ * the original {@link FlatConfigurationSource}. Every change event fired by the
+ * {@link FlatConfigurationSource} causes the configuration used internally to be
+ * re-constructed with the current data of the {@link FlatConfigurationSource}. This
  * will throw away all changes made at this hierarchical source! So this mode
  * should only be used for providing a read-only hierarchical view for a plain
- * {@link ConfigurationSource}.
+ * {@link FlatConfigurationSource}.
  * </p>
  *
  * @author Commons Configuration team
@@ -68,7 +68,7 @@
     /**
      * Stores the original source that is transformed by this adapter.
      */
-    private final ConfigurationSource originalSource;
+    private final FlatConfigurationSource originalSource;
 
     /** The configuration used internally for the transformation. */
     private Configuration<ConfigurationNode> transformedConfig;
@@ -91,7 +91,7 @@
      * @throws IllegalArgumentException if the {@code ConfigurationSource} is
      *         <b>null</b>
      */
-    public HierarchicalSourceAdapter(ConfigurationSource wrappedSource,
+    public HierarchicalSourceAdapter(FlatConfigurationSource wrappedSource,
             boolean monitorChanges)
     {
         if (wrappedSource == null)
@@ -119,7 +119,7 @@
      * @throws IllegalArgumentException if the {@code ConfigurationSource} is
      *         <b>null</b>
      */
-    public HierarchicalSourceAdapter(ConfigurationSource wrappedSource)
+    public HierarchicalSourceAdapter(FlatConfigurationSource wrappedSource)
     {
         this(wrappedSource, false);
     }
@@ -137,7 +137,7 @@
      * @throws IllegalArgumentException if a required parameter is <b>null</b>
      */
     public static void fillConfiguration(Configuration<?> config,
-            ConfigurationSource source)
+            FlatConfigurationSource source)
     {
         if (config == null)
         {
@@ -157,7 +157,7 @@
      * An utility method for copying the content of the specified {@code
      * Configuration} into the given {@code ConfigurationSource}. This method is
      * the opposite of
-     * {@link #fillConfiguration(Configuration, ConfigurationSource)}: It
+     * {@link #fillConfiguration(Configuration, FlatConfigurationSource)}: It
      * iterates over the keys in the {@code Configuration} and adds their values
      * to the {@code ConfigurationSource}.
      *
@@ -167,7 +167,7 @@
      *        <b>null</b>)
      * @throws IllegalArgumentException if a required parameter is <b>null</b>
      */
-    public static void fillSource(ConfigurationSource source,
+    public static void fillSource(FlatConfigurationSource source,
             Configuration<?> config)
     {
         if (source == null)
@@ -190,7 +190,7 @@
      *
      * @return the original {@code ConfigurationSource}
      */
-    public ConfigurationSource getOriginalSource()
+    public FlatConfigurationSource getOriginalSource()
     {
         return originalSource;
     }
@@ -379,7 +379,7 @@
      * @param source the configuration source
      */
     private static void doFillConfiguration(Configuration<?> config,
-            ConfigurationSource source)
+            FlatConfigurationSource source)
     {
         for (Iterator<String> it = source.getKeys(); it.hasNext();)
         {
@@ -395,7 +395,7 @@
      * @param source the configuration source
      * @param config the configuration
      */
-    private static void doFillSource(ConfigurationSource source,
+    private static void doFillSource(FlatConfigurationSource source,
             Configuration<?> config)
     {
         for (Iterator<String> it = config.getKeys(); it.hasNext();)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/MapConfigurationSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/MapConfigurationSource.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/MapConfigurationSource.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/MapConfigurationSource.java Thu Oct  1 06:02:48 2009
@@ -26,12 +26,12 @@
 
 /**
  * <p>
- * An implementation of the {@code ConfigurationSource} interface that holds its
+ * An implementation of the {@code FlatConfigurationSource} interface that holds its
  * data in a map.
  * </p>
  * <p>
  * Using a map as store for configuration settings is a natural choice as the
- * methods defined by the {@code ConfigurationSource} interface can be easily
+ * methods defined by the {@code FlatConfigurationSource} interface can be easily
  * implemented on top of a map. So most methods more or less directly delegate
  * to the map. At construction time either a map can be provided which will then
  * be used as store or a new one is created.
@@ -43,7 +43,7 @@
  * </p>
  * <p>
  * This class can also be used as a base class for other configuration sources
- * that a map-like structure and keep their whole data in memory. An example
+ * that have a map-like structure and keep their whole data in memory. An example
  * could be a configuration source wrapping a properties file.
  * </p>
  * <p>
@@ -56,7 +56,7 @@
  * @author Commons Configuration team
  * @version $Id$
  */
-public class MapConfigurationSource implements ConfigurationSource,
+public class MapConfigurationSource implements FlatConfigurationSource,
         Serializable
 {
     /**
@@ -108,7 +108,7 @@
      * @throws IllegalArgumentException if the source to be copied is
      *         <b>null</b>
      */
-    public MapConfigurationSource(ConfigurationSource c)
+    public MapConfigurationSource(FlatConfigurationSource c)
     {
         if (c == null)
         {

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceEventWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceEventWrapper.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceEventWrapper.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceEventWrapper.java Thu Oct  1 06:02:48 2009
@@ -40,7 +40,7 @@
     private static final Object VALUE = 42;
 
     /** Stores a mock for the wrapped source. */
-    private ConfigurationSource wrappedSource;
+    private FlatConfigurationSource wrappedSource;
 
     /** A test listener. */
     private ConfigurationSourceListenerImpl listener;
@@ -51,7 +51,7 @@
     @Override
     protected void setUp() throws Exception
     {
-        wrappedSource = EasyMock.createMock(ConfigurationSource.class);
+        wrappedSource = EasyMock.createMock(FlatConfigurationSource.class);
         wrapper = new ConfigurationSourceEventWrapper(wrappedSource);
         listener = new ConfigurationSourceListenerImpl();
         wrapper.addConfigurationSourceListener(listener);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceUtils.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceUtils.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestConfigurationSourceUtils.java Thu Oct  1 06:02:48 2009
@@ -40,8 +40,8 @@
      */
     public void testIsEmptyImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.expect(source.isEmpty()).andReturn(Boolean.FALSE);
         EasyMock.replay(source);
         assertFalse("Wrong result of isEmpty()", ConfigurationSourceUtils
@@ -54,8 +54,8 @@
      */
     public void testIsEmptyNotImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         Iterator<?> it = EasyMock.createMock(Iterator.class);
         EasyMock.expect(source.isEmpty()).andThrow(
                 new UnsupportedOperationException());
@@ -90,8 +90,8 @@
      */
     public void testValueCountImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         final int count = 4;
         EasyMock.expect(source.valueCount(KEY)).andReturn(count);
         EasyMock.replay(source);
@@ -106,8 +106,8 @@
      */
     public void testValueCountNotImplementedNonExisting()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.expect(source.valueCount(KEY)).andThrow(
                 new UnsupportedOperationException());
         EasyMock.expect(source.getProperty(KEY)).andReturn(null);
@@ -123,8 +123,8 @@
      */
     public void testValueCountNotImplementedSingleValue()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.expect(source.valueCount(KEY)).andThrow(
                 new UnsupportedOperationException());
         EasyMock.expect(source.getProperty(KEY)).andReturn(this);
@@ -140,8 +140,8 @@
      */
     public void testValueCountNotImplementedCollection()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.expect(source.valueCount(KEY)).andThrow(
                 new UnsupportedOperationException());
         final int count = 5;
@@ -180,8 +180,8 @@
      */
     public void testSizeImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         final int size = 256;
         EasyMock.expect(source.size()).andReturn(size);
         EasyMock.replay(source);
@@ -195,8 +195,8 @@
      */
     public void testSizeNotImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         final int size = 128;
         EasyMock.expect(source.size()).andThrow(
                 new UnsupportedOperationException());
@@ -238,8 +238,8 @@
      */
     public void testGetKeysImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         @SuppressWarnings("unchecked")
         Iterator<String> it = EasyMock.createMock(Iterator.class);
         EasyMock.expect(source.getKeys(KEY)).andReturn(it);
@@ -255,8 +255,8 @@
      */
     public void testGetKeysNotImplemented()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.expect(source.getKeys(KEY)).andThrow(
                 new UnsupportedOperationException());
         Collection<String> keys = new ArrayList<String>();

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java Thu Oct  1 06:02:48 2009
@@ -44,7 +44,7 @@
     private FlatNodeHandler handler;
 
     /** The configuration source associated with the node handler. */
-    private ConfigurationSource source;
+    private FlatConfigurationSource source;
 
     /** Stores the internal update flag of the node handler. */
     private Boolean internalUpdate;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java Thu Oct  1 06:02:48 2009
@@ -56,10 +56,10 @@
      *
      * @return the mock source
      */
-    private static ConfigurationSource createMockSource()
+    private static FlatConfigurationSource createMockSource()
     {
-        ConfigurationSource src = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource src = EasyMock
+                .createMock(FlatConfigurationSource.class);
         src
                 .addConfigurationSourceListener((ConfigurationSourceListener) EasyMock
                         .anyObject());
@@ -79,7 +79,7 @@
         {
             map.put(KEYS[i], VALUES[i]);
         }
-        ConfigurationSource src = new ConfigurationSourceEventWrapper(
+        FlatConfigurationSource src = new ConfigurationSourceEventWrapper(
                 new MapConfigurationSource(map));
         return new FlatNodeSourceAdapter(src);
     }
@@ -125,7 +125,7 @@
      */
     public void testGetOriginalSource()
     {
-        ConfigurationSource src = createMockSource();
+        FlatConfigurationSource src = createMockSource();
         EasyMock.replay(src);
         FlatNodeSourceAdapter adapter = new FlatNodeSourceAdapter(src);
         assertEquals("Wrong original source", src, adapter.getOriginalSource());
@@ -138,7 +138,7 @@
      */
     public void testAddConfigurationSourceListener()
     {
-        ConfigurationSource src = createMockSource();
+        FlatConfigurationSource src = createMockSource();
         ConfigurationSourceListener l = EasyMock
                 .createMock(ConfigurationSourceListener.class);
         src.addConfigurationSourceListener(l);
@@ -154,7 +154,7 @@
      */
     public void testRemoveConfigurationSourceListener()
     {
-        ConfigurationSource src = createMockSource();
+        FlatConfigurationSource src = createMockSource();
         ConfigurationSourceListener l = EasyMock
                 .createMock(ConfigurationSourceListener.class);
         EasyMock.expect(src.removeConfigurationSourceListener(l)).andReturn(
@@ -175,7 +175,7 @@
      */
     public void testClear()
     {
-        ConfigurationSource src = createMockSource();
+        FlatConfigurationSource src = createMockSource();
         src.clear();
         EasyMock.replay(src);
         FlatNodeSourceAdapter adapter = new FlatNodeSourceAdapter(src);
@@ -189,7 +189,7 @@
      */
     public void testSetRootNode()
     {
-        ConfigurationSource src = createMockSource();
+        FlatConfigurationSource src = createMockSource();
         EasyMock.replay(src);
         FlatNodeSourceAdapter adapter = new FlatNodeSourceAdapter(src);
         try

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestHierarchicalSourceAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestHierarchicalSourceAdapter.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestHierarchicalSourceAdapter.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestHierarchicalSourceAdapter.java Thu Oct  1 06:02:48 2009
@@ -90,7 +90,7 @@
      *
      * @param src the mock for the source
      */
-    private static void prepareTransformPropertyValues(ConfigurationSource src)
+    private static void prepareTransformPropertyValues(FlatConfigurationSource src)
     {
         for (int i = 0; i < KEYS.length; i++)
         {
@@ -106,7 +106,7 @@
      * @param src the mock for the source
      * @param clear a flag whether the clear() call should be expected, too
      */
-    private static void prepareWriteBack(ConfigurationSource src, boolean clear)
+    private static void prepareWriteBack(FlatConfigurationSource src, boolean clear)
     {
         if (clear)
         {
@@ -141,8 +141,8 @@
      */
     public void testInit()
     {
-        ConfigurationSource src = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource src = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.replay(src);
         HierarchicalSourceAdapter adapter = new HierarchicalSourceAdapter(src);
         assertEquals("Wrong wrapped source", src, adapter.getOriginalSource());
@@ -155,11 +155,11 @@
      */
     public void testInitMonitor()
     {
-        ConfigurationSource src = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource src = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.replay(src);
         final MutableObject listener = new MutableObject();
-        ConfigurationSource orgSrc = new ConfigurationSourceEventWrapper(src)
+        FlatConfigurationSource orgSrc = new ConfigurationSourceEventWrapper(src)
         {
             @Override
             public void addConfigurationSourceListener(
@@ -315,8 +315,8 @@
      */
     public void testTransformationMonitor()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         source
                 .addConfigurationSourceListener((ConfigurationSourceListener) EasyMock
                         .anyObject());
@@ -375,8 +375,8 @@
      */
     public void testWriteBackMonitor()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         final MutableObject expectedListener = new MutableObject();
         source
                 .addConfigurationSourceListener((ConfigurationSourceListener) EasyMock
@@ -431,8 +431,8 @@
      */
     public void testFillConfiguration()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.expect(source.getKeys()).andReturn(
                 Arrays.asList(KEYS).iterator());
         prepareTransformPropertyValues(source);
@@ -450,8 +450,8 @@
      */
     public void testFillConfigurationNullConfig()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.replay(source);
         try
         {
@@ -488,8 +488,8 @@
      */
     public void testFillSource()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         prepareWriteBack(source, false);
         EasyMock.replay(source);
         Configuration<ConfigurationNode> config = new ConfigurationImpl<ConfigurationNode>(
@@ -509,8 +509,8 @@
      */
     public void testFillSourceNullConfig()
     {
-        ConfigurationSource source = EasyMock
-                .createMock(ConfigurationSource.class);
+        FlatConfigurationSource source = EasyMock
+                .createMock(FlatConfigurationSource.class);
         EasyMock.replay(source);
         try
         {
@@ -553,7 +553,7 @@
         HierarchicalConfigurationSource<ConfigurationNode> mockSource;
 
         public HierarchicalSourceAdapterTestImpl(
-                ConfigurationSource wrappedSource, boolean monitorChanges)
+                FlatConfigurationSource wrappedSource, boolean monitorChanges)
         {
             super(wrappedSource, monitorChanges);
         }
@@ -564,7 +564,7 @@
          */
         public HierarchicalSourceAdapterTestImpl()
         {
-            super(EasyMock.createMock(ConfigurationSource.class));
+            super(EasyMock.createMock(FlatConfigurationSource.class));
         }
 
         /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java?rev=820541&r1=820540&r2=820541&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java Thu Oct  1 06:02:48 2009
@@ -427,7 +427,7 @@
     {
         try
         {
-            new MapConfigurationSource((ConfigurationSource) null);
+            new MapConfigurationSource((FlatConfigurationSource) null);
             fail("Could create copy of null source!");
         }
         catch (IllegalArgumentException iex)



Mime
View raw message