commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1103429 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
Date Sun, 15 May 2011 15:27:27 GMT
Author: simonetripodi
Date: Sun May 15 15:27:27 2011
New Revision: 1103429

URL: http://svn.apache.org/viewvc?rev=1103429&view=rev
Log:
added a constructor that allows configuring already set aliases

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java?rev=1103429&r1=1103428&r2=1103429&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
Sun May 15 15:27:27 2011
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.LinkedList;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Map;
 import java.beans.PropertyDescriptor;
 
 import org.apache.commons.beanutils.BeanUtils;
@@ -191,6 +192,20 @@ public class SetNestedPropertiesRule
         }
     }
 
+    /**
+     * Constructor which allows element->property mapping to be overridden.
+     *
+     * @param elementNames names of elements->properties to map
+     * @since 3.0
+     */
+    public SetNestedPropertiesRule( Map<String, String> elementNames )
+    {
+        if ( elementNames != null && !elementNames.isEmpty() )
+        {
+            this.elementNames.putAll( elementNames );
+        }
+    }
+
     // --------------------------------------------------------- Public Methods
 
     /** Invoked when rule is added to digester. */



Mime
View raw message