You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/15 17:27:27 UTC
svn commit: r1103429 -
/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
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. */