commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1066218 - in /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules: BaseRules.java ExtendedBaseRules.java RegexRules.java
Date Tue, 01 Feb 2011 21:25:49 GMT
Author: simonetripodi
Date: Tue Feb  1 21:25:49 2011
New Revision: 1066218

URL: http://svn.apache.org/viewvc?rev=1066218&view=rev
Log:
rules implementation must inherit from abstract implementation

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/BaseRules.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/ExtendedBaseRules.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/RegexRules.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/BaseRules.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/BaseRules.java?rev=1066218&r1=1066217&r2=1066218&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/BaseRules.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/BaseRules.java
Tue Feb  1 21:25:49 2011
@@ -23,7 +23,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.digester3.Rule;
-import org.apache.commons.digester3.spi.Rules;
 
 /**
  * <p>Default implementation of the {@code Rules} interface that supports
@@ -45,7 +44,7 @@ import org.apache.commons.digester3.spi.
  * (and when multiple wildcard patterns match, only the longest, ie most 
  * explicit, pattern is considered a match).</p>
  */
-public class BaseRules implements Rules {
+public class BaseRules extends AbstractRulesImpl {
 
     /**
      * The set of registered Rule instances, keyed by the matching pattern.
@@ -61,12 +60,9 @@ public class BaseRules implements Rules 
     private List<Rule> rules = new ArrayList<Rule>();
 
     /**
-     * Register a new Rule instance matching the specified pattern.
-     *
-     * @param pattern Nesting pattern to be matched for this Rule
-     * @param rule Rule instance to be registered
+     * {@inheritDoc}
      */
-    public void add(String pattern, Rule rule) {
+    public void registerRule(String pattern, Rule rule) {
         // to help users who accidently add '/' to the end of their patterns
         int patternLength = pattern.length();
         if (patternLength > 1 && pattern.endsWith("/")) {

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/ExtendedBaseRules.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/ExtendedBaseRules.java?rev=1066218&r1=1066217&r2=1066218&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/ExtendedBaseRules.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/ExtendedBaseRules.java
Tue Feb  1 21:25:49 2011
@@ -186,7 +186,7 @@ public class ExtendedBaseRules extends B
      * @param rule Rule instance to be registered
      */
     @Override
-    public void add(String pattern, Rule rule) {
+    public void registerRule(String pattern, Rule rule) {
         super.add(pattern, rule);
         this.counter++;
         this.order.put(rule, this.counter);

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/RegexRules.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/RegexRules.java?rev=1066218&r1=1066217&r2=1066218&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/RegexRules.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rules/RegexRules.java
Tue Feb  1 21:25:49 2011
@@ -21,7 +21,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.digester3.Rule;
-import org.apache.commons.digester3.spi.Rules;
 
 /**
  * <p>Rules implementation that uses regular expression matching for paths.</p>
@@ -31,7 +30,7 @@ import org.apache.commons.digester3.spi.
  * All patterns are tested to see if they match the path using the regex matcher.
  * All those that do are return in the order which the rules were added.</p>
  */
-public class RegexRules implements Rules {
+public class RegexRules extends AbstractRulesImpl {
 
     /** All registered <code>Rule</code>'s  */
     private final List<RegisteredRule> registeredRules = new ArrayList<RegisteredRule>();
@@ -55,7 +54,7 @@ public class RegexRules implements Rules
     /**
      * {@inheritDoc}
      */
-    public void add(String pattern, Rule rule) {
+    public void registerRule(String pattern, Rule rule) {
         this.registeredRules.add(new RegisteredRule(pattern, rule));
     }
 



Mime
View raw message