cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1087865 - in /cocoon/cocoon3/trunk/cocoon-sax/src: main/java/org/apache/cocoon/sax/builder/SAXPipelineBuilder.java test/java/org/apache/cocoon/sax/PipelineTest.java
Date Fri, 01 Apr 2011 19:31:04 GMT
Author: simonetripodi
Date: Fri Apr  1 19:31:04 2011
New Revision: 1087865

URL: http://svn.apache.org/viewvc?rev=1087865&view=rev
Log:
SAXPipelineBuilder implemented as a proper pipeline EDSL

Modified:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/SAXPipelineBuilder.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/SAXPipelineBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/SAXPipelineBuilder.java?rev=1087865&r1=1087864&r2=1087865&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/SAXPipelineBuilder.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/SAXPipelineBuilder.java
Fri Apr  1 19:31:04 2011
@@ -32,29 +32,36 @@ public final class SAXPipelineBuilder {
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineStarterBuilder newAsyncCachePipeline() {
-        return this.newPipeline(new AsyncCachePipeline<SAXPipelineComponent>());
+    public static LinkedSAXPipelineStarterBuilder newAsyncCachePipeline() {
+        return newPipeline(new AsyncCachePipeline<SAXPipelineComponent>());
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineStarterBuilder newCachingPipeline() {
-        return this.newPipeline(new CachingPipeline<SAXPipelineComponent>());
+    public static LinkedSAXPipelineStarterBuilder newCachingPipeline() {
+        return newPipeline(new CachingPipeline<SAXPipelineComponent>());
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineStarterBuilder newNonCachingPipeline() {
-        return this.newPipeline(new NonCachingPipeline<SAXPipelineComponent>());
+    public static LinkedSAXPipelineStarterBuilder newNonCachingPipeline() {
+        return newPipeline(new NonCachingPipeline<SAXPipelineComponent>());
     }
 
     /**
      * {@inheritDoc}
      */
-    private LinkedSAXPipelineStarterBuilder newPipeline(final Pipeline<SAXPipelineComponent>
pipeline) {
+    private static LinkedSAXPipelineStarterBuilder newPipeline(final Pipeline<SAXPipelineComponent>
pipeline) {
         return new LinkedSAXPipelineStarterBuilderImpl(pipeline);
     }
 
+    /**
+     * Hidden constructor, this class can't be instantiated.
+     */
+    private SAXPipelineBuilder() {
+        // do nothing
+    }
+
 }

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=1087865&r1=1087864&r2=1087865&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:31:04 2011
@@ -18,6 +18,8 @@
  */
 package org.apache.cocoon.sax;
 
+import static org.apache.cocoon.sax.builder.SAXPipelineBuilder.newNonCachingPipeline;
+
 import java.io.ByteArrayOutputStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -25,7 +27,6 @@ import java.util.Map;
 import junit.framework.TestCase;
 
 import org.apache.cocoon.pipeline.builder.PipelineBuilder;
-import org.apache.cocoon.sax.builder.SAXPipelineBuilder;
 import org.apache.cocoon.sax.component.XMLGenerator;
 import org.apache.cocoon.sax.component.XMLSerializer;
 import org.apache.cocoon.sax.component.XSLTTransformer;
@@ -40,7 +41,7 @@ public class PipelineTest extends TestCa
     public void testPipelineWithTransformer() throws Exception {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-        new SAXPipelineBuilder().newNonCachingPipeline()
+        newNonCachingPipeline()
             .setStringGenerator("<x></x>")
             .addXSLTTransformer(this.getClass().getResource("/test.xslt"))
             .addSerializer()



Mime
View raw message