cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1087869 - in /cocoon/cocoon3/trunk: cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/ cocoon-sax/src/test/java/org/apache/cocoon/sax/
Date Fri, 01 Apr 2011 19:53:26 GMT
Author: simonetripodi
Date: Fri Apr  1 19:53:25 2011
New Revision: 1087869

URL: http://svn.apache.org/viewvc?rev=1087869&view=rev
Log:
simplified the basic Pipeline EDSL

Removed:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/LinkedPipelineBuilder.java
Modified:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/PipelineBuilder.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/PipelineBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/PipelineBuilder.java?rev=1087869&r1=1087868&r2=1087869&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/PipelineBuilder.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/PipelineBuilder.java
Fri Apr  1 19:53:25 2011
@@ -34,30 +34,37 @@ import org.apache.cocoon.pipeline.compon
  * @param <PC> the {@link PipelineComponent} type.
  * @version $Id$
  */
-public final class PipelineBuilder<PC extends PipelineComponent> implements LinkedPipelineBuilder<PC>
{
+public final class PipelineBuilder {
+
+    /**
+     * Hidden constructor, this class can't be instantiated.
+     */
+    private PipelineBuilder() {
+        // do nothing
+    }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedPipelineStarterBuilder<PC> newAsyncCachePipeline() {
-        return this.newPipeline(new AsyncCachePipeline<PC>());
+    public static <PC extends PipelineComponent> LinkedPipelineStarterBuilder<PC>
newAsyncCachePipeline() {
+        return newPipeline(new AsyncCachePipeline<PC>());
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedPipelineStarterBuilder<PC> newCachingPipeline() {
-        return this.newPipeline(new CachingPipeline<PC>());
+    public static <PC extends PipelineComponent> LinkedPipelineStarterBuilder<PC>
newCachingPipeline() {
+        return newPipeline(new CachingPipeline<PC>());
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedPipelineStarterBuilder<PC> newNonCachingPipeline() {
-        return this.newPipeline(new NonCachingPipeline<PC>());
+    public static <PC extends PipelineComponent> LinkedPipelineStarterBuilder<PC>
newNonCachingPipeline() {
+        return newPipeline(new NonCachingPipeline<PC>());
     }
 
-    private LinkedPipelineStarterBuilder<PC> newPipeline(final Pipeline<PC> pipeline)
{
+    private static <PC extends PipelineComponent> LinkedPipelineStarterBuilder<PC>
newPipeline(final Pipeline<PC> pipeline) {
         return new LinkedPipelineStarterBuilder<PC>() {
 
             public LinkedPipelineComponentBuilder<PC> setStarter(final PC starter)
{

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java?rev=1087869&r1=1087868&r2=1087869&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
Fri Apr  1 19:53:25 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.cocoon.sax;
 
+import static org.apache.cocoon.pipeline.builder.PipelineBuilder.newCachingPipeline;
 import static org.apache.cocoon.sax.builder.SAXPipelineBuilder.newNonCachingPipeline;
 
 import java.io.ByteArrayOutputStream;
@@ -26,7 +27,6 @@ import java.util.Map;
 
 import junit.framework.TestCase;
 
-import org.apache.cocoon.pipeline.builder.PipelineBuilder;
 import org.apache.cocoon.sax.component.XMLGenerator;
 import org.apache.cocoon.sax.component.XMLSerializer;
 import org.apache.cocoon.sax.component.XSLTTransformer;
@@ -66,8 +66,7 @@ public class PipelineTest extends TestCa
         attributes.put("translet-name", "CompiledXslt");
         attributes.put("package-name", "org.apache.cocoon.sax");
 
-        new PipelineBuilder<SAXPipelineComponent>()
-            .newCachingPipeline()
+        newCachingPipeline()
             .setStarter(new XMLGenerator("<x></x>"))
             .addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt"),
attributes))
             .setFinisher(new XMLSerializer())



Mime
View raw message