You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2008/04/17 08:26:57 UTC

svn commit: r648969 - /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java

Author: oheger
Date: Wed Apr 16 23:26:54 2008
New Revision: 648969

URL: http://svn.apache.org/viewvc?rev=648969&view=rev
Log:
Distinguish between value and structure nodes when invoking the node handler for creating new nodes

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java?rev=648969&r1=648968&r2=648969&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java Wed Apr 16 23:26:54 2008
@@ -711,6 +711,21 @@
     }
 
     /**
+     * Creates a new node object with the specified name and value. This base
+     * implementation delegates to the <code>NodeHandler</code> for creating a
+     * new node.
+     * 
+     * @param parent the parent of the new node
+     * @param name the name of the new node
+     * @param value the value of the new node
+     * @return the new node
+     */
+    protected T createNode(T parent, String name, Object value)
+    {
+        return getNodeHandler().addChild(parent, name, value);
+    }
+    
+    /**
      * Helper method for processing a <code>NodeAddData</code> object obtained from the
      * expression engine. This method will create all new nodes and set the value
      * of the last node, which represents the newly added property.
@@ -757,8 +772,7 @@
         }
         else
         {
-            T child = createNode(parent, name);
-            getNodeHandler().setValue(child, value);
+            T child = createNode(parent, name, value);
             return child;
         }
     }