commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1068533 - in /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3: RulesBinderImpl.java rulesbinder/SetPropertiesBuilder.java
Date Tue, 08 Feb 2011 19:16:49 GMT
Author: simonetripodi
Date: Tue Feb  8 19:16:49 2011
New Revision: 1068533

URL: http://svn.apache.org/viewvc?rev=1068533&view=rev
Log:
added method to ignore an attribute when SetPropertiesRule

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/SetPropertiesBuilder.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java?rev=1068533&r1=1068532&r2=1068533&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Tue Feb  8 19:16:49 2011
@@ -242,9 +242,19 @@ final class RulesBinderImpl implements R
                         return this;
                     }
 
+                    public SetPropertiesBuilder ignoreAttribute(String attributeName) {
+                        if (attributeName == null) {
+                            addError("{forPattern(\"%s\").setProperties().ignoreAttribute(String)}
empty 'attributeName' not allowed",
+                                    keyPattern);
+                        } else {
+                            this.aliases.put(attributeName, null);
+                        }
+                        return this;
+                    }
+
                     public SetPropertiesBuilder addAlias(String attributeName, /* @Nullable
*/String propertyName) {
                         if (attributeName == null) {
-                            addError("{forPattern(\"%s\").setProperties().addAlias(String,String)}
empty 'methodName' not allowed",
+                            addError("{forPattern(\"%s\").setProperties().addAlias(String,String)}
empty 'attributeName' not allowed",
                                     keyPattern);
                         } else {
                             this.aliases.put(attributeName, propertyName);

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/SetPropertiesBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/SetPropertiesBuilder.java?rev=1068533&r1=1068532&r2=1068533&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/SetPropertiesBuilder.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/SetPropertiesBuilder.java
Tue Feb  8 19:16:49 2011
@@ -25,6 +25,14 @@ import org.apache.commons.digester3.SetP
 public interface SetPropertiesBuilder extends BackToLinkedRuleBuilder<SetPropertiesRule>
{
 
     /**
+     * Add an attribute name to the ignore list.
+     *
+     * @param attributeName The attribute to match has to be ignored
+     * @return this builder instance
+     */
+    SetPropertiesBuilder ignoreAttribute(String attributeName);
+
+    /**
      * Add an additional attribute name to property name mapping.
      *
      * @param attributeName The attribute to match



Mime
View raw message