Author: simonetripodi
Date: Tue Feb 1 12:40:12 2011
New Revision: 1066032
URL: http://svn.apache.org/viewvc?rev=1066032&view=rev
Log:
added the method to create and store Digester Rule to proper Rules
implementation
Modified:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.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=1066032&r1=1066031&r2=1066032&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 1 12:40:12 2011
@@ -38,6 +38,7 @@ import org.apache.commons.digester3.rule
import org.apache.commons.digester3.rulesbinder.SetPropertiesBuilder;
import org.apache.commons.digester3.rulesbinder.SetPropertyBuilder;
import org.apache.commons.digester3.spi.RuleProvider;
+import org.apache.commons.digester3.spi.Rules;
/**
* The Digester EDSL implementation.
@@ -513,6 +514,18 @@ final class RulesBinderImpl implements R
}
/**
+ * Invokes the bound providers, then create the rule and associate it to
the related pattern,
+ * storing them in the proper {@link Rules} implementation data structure.
+ *
+ * @param rules The {@link Rules} implementation to store the produced
{@link Rule}s
+ */
+ public void populateRules(Rules rules) {
+ for (RegisteredProvider registeredProvider : this.providers) {
+ rules.add(registeredProvider.getPattern(),
registeredProvider.getProvider().get());
+ }
+ }
+
+ /**
* Used to associate rule providers with paths in the rules binder.
*/
private static class RegisteredProvider {