commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1042264 - in /commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations: DigesterLoaderBuilder.java FromAnnotationRuleProviderFactory.java
Date Sat, 04 Dec 2010 23:50:32 GMT
Author: simonetripodi
Date: Sat Dec  4 23:50:31 2010
New Revision: 1042264

URL: http://svn.apache.org/viewvc?rev=1042264&view=rev
Log:
exposed DigesterLoader DSL interface only

Modified:
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/DigesterLoaderBuilder.java
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/FromAnnotationRuleProviderFactory.java

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/DigesterLoaderBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/DigesterLoaderBuilder.java?rev=1042264&r1=1042263&r2=1042264&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/DigesterLoaderBuilder.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/DigesterLoaderBuilder.java
Sat Dec  4 23:50:31 2010
@@ -18,7 +18,9 @@
 package org.apache.commons.digester.annotations;
 
 import org.apache.commons.digester.annotations.internal.DefaultAnnotationRuleProviderFactory;
+import org.apache.commons.digester.annotations.internal.DefaultDigesterLoaderHandlerFactory;
 import org.apache.commons.digester.annotations.spi.AnnotationRuleProviderFactory;
+import org.apache.commons.digester.annotations.spi.DigesterLoaderHandlerFactory;
 
 /**
  * {@link DigesterLoader} builder implementation.
@@ -60,11 +62,24 @@ public final class DigesterLoaderBuilder
      * @return the next chained builder.
      */
     public FromAnnotationRuleProviderFactory
-            useAnnotationRuleProviderFactory(AnnotationRuleProviderFactory annotationRuleProviderFactory)
{
+            useAnnotationRuleProviderFactory(final AnnotationRuleProviderFactory annotationRuleProviderFactory)
{
         if (annotationRuleProviderFactory == null) {
             throw new IllegalArgumentException("Parameter 'annotationRuleProviderFactory'
must be not null");
         }
-        return new FromAnnotationRuleProviderFactory(annotationRuleProviderFactory);
+        return new FromAnnotationRuleProviderFactory() {
+
+            public DigesterLoader useDefaultDigesterLoaderHandlerFactory() {
+                return this.useDigesterLoaderHandlerFactory(new DefaultDigesterLoaderHandlerFactory());
+            }
+
+            public DigesterLoader useDigesterLoaderHandlerFactory(
+                    final DigesterLoaderHandlerFactory digesterLoaderHandlerFactory) {
+                if (digesterLoaderHandlerFactory == null) {
+                    throw new IllegalArgumentException("Parameter 'digesterLoaderHandlerFactory'
must be not null");
+                }
+                return new DigesterLoader(annotationRuleProviderFactory, digesterLoaderHandlerFactory);
+            }
+        };
     }
 
 }

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/FromAnnotationRuleProviderFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/FromAnnotationRuleProviderFactory.java?rev=1042264&r1=1042263&r2=1042264&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/FromAnnotationRuleProviderFactory.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/annotations/FromAnnotationRuleProviderFactory.java
Sat Dec  4 23:50:31 2010
@@ -17,8 +17,6 @@
  */
 package org.apache.commons.digester.annotations;
 
-import org.apache.commons.digester.annotations.internal.DefaultDigesterLoaderHandlerFactory;
-import org.apache.commons.digester.annotations.spi.AnnotationRuleProviderFactory;
 import org.apache.commons.digester.annotations.spi.DigesterLoaderHandlerFactory;
 
 /**
@@ -26,25 +24,7 @@ import org.apache.commons.digester.annot
  *
  * @since 2.1
  */
-public final class FromAnnotationRuleProviderFactory {
-
-    /**
-     * The {@link AnnotationRuleProviderFactory} selected in the previous
-     * chained builder.
-     */
-    private final AnnotationRuleProviderFactory annotationRuleProviderFactory;
-
-    /**
-     * {@link DigesterLoader} builder implementation.
-     *
-     * @param annotationRuleProviderFactory the
-     *        {@link AnnotationRuleProviderFactory} selected in the previous
-     *        chained builder.
-     */
-    protected FromAnnotationRuleProviderFactory(
-            AnnotationRuleProviderFactory annotationRuleProviderFactory) {
-        this.annotationRuleProviderFactory = annotationRuleProviderFactory;
-    }
+public interface FromAnnotationRuleProviderFactory {
 
     /**
      * Builds a new {@link DigesterLoader} using the default
@@ -52,9 +32,7 @@ public final class FromAnnotationRulePro
      *
      * @return the {@link DigesterLoader}.
      */
-    public DigesterLoader useDefaultDigesterLoaderHandlerFactory() {
-        return this.useDigesterLoaderHandlerFactory(new DefaultDigesterLoaderHandlerFactory());
-    }
+    DigesterLoader useDefaultDigesterLoaderHandlerFactory();
 
     /**
      * Builds a new {@link DigesterLoader} using the user defined
@@ -63,11 +41,6 @@ public final class FromAnnotationRulePro
      * @param digesterLoaderHandlerFactory
      * @return the {@link DigesterLoader}.
      */
-    public DigesterLoader useDigesterLoaderHandlerFactory(DigesterLoaderHandlerFactory digesterLoaderHandlerFactory)
{
-        if (digesterLoaderHandlerFactory == null) {
-            throw new IllegalArgumentException("Parameter 'digesterLoaderHandlerFactory'
must be not null");
-        }
-        return new DigesterLoader(this.annotationRuleProviderFactory, digesterLoaderHandlerFactory);
-    }
+    DigesterLoader useDigesterLoaderHandlerFactory(DigesterLoaderHandlerFactory digesterLoaderHandlerFactory);
 
 }



Mime
View raw message