cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1449717 - in /cocoon/cocoon3/trunk: cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/ cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/
Date Mon, 25 Feb 2013 14:18:15 GMT
Author: ilgrosso
Date: Mon Feb 25 14:18:15 2013
New Revision: 1449717

URL: http://svn.apache.org/r1449717
Log:
[COCOON3-67] #resolve + extending LinkedSAXPipelineComponentBuilder for COCOON3-71 and COCOON3-72

Modified:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/LinkedPipelineSetupBuilder.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/PipelineBuilder.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilder.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilderImpl.java

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/LinkedPipelineSetupBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/LinkedPipelineSetupBuilder.java?rev=1449717&r1=1449716&r2=1449717&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/LinkedPipelineSetupBuilder.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/builder/LinkedPipelineSetupBuilder.java
Mon Feb 25 14:18:15 2013
@@ -17,10 +17,13 @@
 package org.apache.cocoon.pipeline.builder;
 
 import java.io.OutputStream;
+import java.util.Map;
 import org.apache.cocoon.pipeline.Pipeline;
 import org.apache.cocoon.pipeline.component.PipelineComponent;
 
 public interface LinkedPipelineSetupBuilder<PC extends PipelineComponent> {
 
     Pipeline<PC> setup(OutputStream outputStream);
+
+    Pipeline<PC> setup(OutputStream outputStream, Map<String, Object> parameters);
 }

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=1449717&r1=1449716&r2=1449717&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
Mon Feb 25 14:18:15 2013
@@ -98,6 +98,7 @@ public final class PipelineBuilder {
                         return new LinkedPipelineConfigurationBuilder<PC>() {
 
                             @SuppressWarnings("unchecked")
+                            @Override
                             public LinkedPipelineSetupBuilder<PC> withEmptyConfiguration()
{
                                 return this.setConfiguration(Collections.EMPTY_MAP);
                             }
@@ -122,6 +123,18 @@ public final class PipelineBuilder {
                                         pipeline.setup(outputStream);
                                         return pipeline;
                                     }
+
+                                    @Override
+                                    public Pipeline<PC> setup(final OutputStream outputStream,
+                                            final Map<String, Object> parameters) {
+
+                                        if (outputStream == null) {
+                                            throw new IllegalArgumentException(
+                                                    "Parameter 'outputStream' must be not
null");
+                                        }
+                                        pipeline.setup(outputStream, parameters);
+                                        return pipeline;
+                                    }
                                 };
                             }
                         };

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilder.java?rev=1449717&r1=1449716&r2=1449717&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilder.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilder.java
Mon Feb 25 14:18:15 2013
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.util.Map;
+import javax.xml.transform.Source;
 
 import org.apache.cocoon.pipeline.builder.LinkedPipelineConfigurationBuilder;
 import org.apache.cocoon.sax.SAXPipelineComponent;
@@ -44,22 +45,30 @@ public interface LinkedSAXPipelineCompon
 
     LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append) throws
IOException;
 
-    LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append, String
datePattern) throws IOException;
+    LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append, String
datePattern) throws
+            IOException;
 
-    LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append, SimpleDateFormat
dateFormat) throws IOException;
+    LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append, SimpleDateFormat
dateFormat)
+            throws IOException;
 
-    LinkedSAXPipelineComponentBuilder addSchemaProcessorTransformer(URL source);
+    LinkedSAXPipelineComponentBuilder addSchemaProcessorTransformer(URL url);
+
+    LinkedSAXPipelineComponentBuilder addSchemaProcessorTransformer(Source source, long lastModified);
 
     LinkedSAXPipelineComponentBuilder addXIncludeTransformer();
 
     LinkedSAXPipelineComponentBuilder addXIncludeTransformer(URL baseUrl);
 
-    LinkedSAXPipelineComponentBuilder addXSLTTransformer(URL source);
+    LinkedSAXPipelineComponentBuilder addXSLTTransformer(URL url);
+
+    LinkedSAXPipelineComponentBuilder addXSLTTransformer(URL url, Map<String, Object>
attributes);
 
-    LinkedSAXPipelineComponentBuilder addXSLTTransformer(URL source, Map<String, Object>
attributes);
+    LinkedSAXPipelineComponentBuilder addXSLTTransformer(Source source, long lastModified);
+
+    LinkedSAXPipelineComponentBuilder addXSLTTransformer(Source source, long lastModified,
+            Map<String, Object> attributes);
 
     <SPC extends SAXPipelineComponent> LinkedSAXPipelineComponentBuilder addComponent(SPC
pipelineComponent);
 
     LinkedPipelineConfigurationBuilder<SAXPipelineComponent> addSerializer();
-
 }

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilderImpl.java?rev=1449717&r1=1449716&r2=1449717&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilderImpl.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/builder/LinkedSAXPipelineComponentBuilderImpl.java
Mon Feb 25 14:18:15 2013
@@ -23,6 +23,7 @@ import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Map;
+import javax.xml.transform.Source;
 
 import org.apache.cocoon.pipeline.Pipeline;
 import org.apache.cocoon.pipeline.builder.LinkedPipelineConfigurationBuilder;
@@ -39,7 +40,6 @@ import org.apache.cocoon.sax.component.X
 
 /**
  *
- *
  * @version $Id$
  */
 public final class LinkedSAXPipelineComponentBuilderImpl implements LinkedSAXPipelineComponentBuilder
{
@@ -53,6 +53,7 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
+    @Override
     public LinkedSAXPipelineComponentBuilder addCleaningTransformer() {
         return this.addComponent(new CleaningTransformer());
     }
@@ -60,6 +61,7 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
+    @Override
     public LinkedSAXPipelineComponentBuilder addIncludeTransformer() {
         return this.addComponent(new IncludeTransformer());
     }
@@ -67,6 +69,7 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
+    @Override
     public LinkedSAXPipelineComponentBuilder addLogAsXMLTransformer() {
         return this.addComponent(new LogAsXMLTransformer());
     }
@@ -74,7 +77,8 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addLogAsXMLTransformer(File logFile) {
+    @Override
+    public LinkedSAXPipelineComponentBuilder addLogAsXMLTransformer(final File logFile) {
         if (logFile == null) {
             throw new IllegalArgumentException("Parameter 'logFile' must be not null");
         }
@@ -84,21 +88,28 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile) throws IOException
{
+    @Override
+    public LinkedSAXPipelineComponentBuilder addLogTransformer(final File logFile) throws
IOException {
         return this.addLogTransformer(logFile, false);
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append)
throws IOException {
+    @Override
+    public LinkedSAXPipelineComponentBuilder addLogTransformer(final File logFile, final
boolean append)
+            throws IOException {
+
         return this.addLogTransformer(logFile, append, "yyyy-MM-dd'T'hh:mm:ss");
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append,
String datePattern) throws IOException {
+    @Override
+    public LinkedSAXPipelineComponentBuilder addLogTransformer(final File logFile, final
boolean append,
+            final String datePattern) throws IOException {
+
         if (datePattern == null) {
             throw new IllegalArgumentException("Parameter 'datePattern' must be not null");
         }
@@ -108,7 +119,10 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addLogTransformer(File logFile, boolean append,
SimpleDateFormat dateFormat) throws IOException {
+    @Override
+    public LinkedSAXPipelineComponentBuilder addLogTransformer(final File logFile, final
boolean append,
+            final SimpleDateFormat dateFormat) throws IOException {
+
         if (logFile == null) {
             throw new IllegalArgumentException("Parameter 'logFile' must be not null");
         }
@@ -121,16 +135,25 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addSchemaProcessorTransformer(URL source) {
-        if (source == null) {
-            throw new IllegalArgumentException("Parameter 'source' must be not null");
-        }
-        return this.addComponent(new SchemaProcessorTransformer(source));
+    @Override
+    public LinkedSAXPipelineComponentBuilder addSchemaProcessorTransformer(final URL url)
{
+        return this.addComponent(new SchemaProcessorTransformer(url));
     }
 
     /**
      * {@inheritDoc}
      */
+    @Override
+    public LinkedSAXPipelineComponentBuilder addSchemaProcessorTransformer(final Source source,
+            final long lastModified) {
+
+        return this.addComponent(new SchemaProcessorTransformer(source, lastModified));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public LinkedSAXPipelineComponentBuilder addXIncludeTransformer() {
         return this.addXIncludeTransformer(null);
     }
@@ -138,7 +161,8 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addXIncludeTransformer(URL baseUrl) {
+    @Override
+    public LinkedSAXPipelineComponentBuilder addXIncludeTransformer(final URL baseUrl) {
         // baseUrl can be null, but only if documents don't have relative paths inside
         return this.addComponent(new XIncludeTransformer(baseUrl));
     }
@@ -146,24 +170,46 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addXSLTTransformer(URL source) {
-        return this.addXSLTTransformer(source, null);
+    @Override
+    public LinkedSAXPipelineComponentBuilder addXSLTTransformer(final URL url) {
+        return this.addXSLTTransformer(url, null);
     }
 
     /**
      * {@inheritDoc}
      */
-    public LinkedSAXPipelineComponentBuilder addXSLTTransformer(URL source, Map<String,
Object> attributes) {
-        if (source == null) {
-            throw new IllegalArgumentException("Parameter 'source' must be not null");
-        }
-        return this.addComponent(new XSLTTransformer(source, attributes));
+    @Override
+    public LinkedSAXPipelineComponentBuilder addXSLTTransformer(final URL url,
+            final Map<String, Object> attributes) {
+
+        return this.addComponent(new XSLTTransformer(url, attributes));
     }
 
     /**
      * {@inheritDoc}
      */
-    public <SPC extends SAXPipelineComponent> LinkedSAXPipelineComponentBuilder addComponent(SPC
pipelineComponent) {
+    @Override
+    public LinkedSAXPipelineComponentBuilder addXSLTTransformer(final Source source, final
long lastModified) {
+        return this.addXSLTTransformer(source, lastModified, null);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public LinkedSAXPipelineComponentBuilder addXSLTTransformer(final Source source, final
long lastModified,
+            final Map<String, Object> attributes) {
+
+        return this.addComponent(new XSLTTransformer(source, lastModified, attributes));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public <SPC extends SAXPipelineComponent> LinkedSAXPipelineComponentBuilder addComponent(
+            final SPC pipelineComponent) {
+
         if (pipelineComponent == null) {
             throw new IllegalArgumentException("Parameter 'pipelineComponent' must not be
null");
         }
@@ -174,17 +220,20 @@ public final class LinkedSAXPipelineComp
     /**
      * {@inheritDoc}
      */
+    @Override
     public LinkedPipelineConfigurationBuilder<SAXPipelineComponent> addSerializer()
{
         this.pipeline.addComponent(new XMLSerializer());
 
         return new LinkedPipelineConfigurationBuilder<SAXPipelineComponent>() {
 
-            @SuppressWarnings("unchecked")
+            @Override
             public LinkedPipelineSetupBuilder<SAXPipelineComponent> withEmptyConfiguration()
{
-                return this.setConfiguration(Collections.EMPTY_MAP);
+                return this.setConfiguration(Collections.<String, Object>emptyMap());
             }
 
-            public LinkedPipelineSetupBuilder<SAXPipelineComponent> setConfiguration(final
Map<String, ? extends Object> parameters) {
+            @Override
+            public LinkedPipelineSetupBuilder<SAXPipelineComponent> setConfiguration(
+                    final Map<String, ? extends Object> parameters) {
                 if (parameters == null) {
                     throw new IllegalArgumentException("Parameter 'parameters' must be not
null");
                 }
@@ -192,6 +241,7 @@ public final class LinkedSAXPipelineComp
 
                 return new LinkedPipelineSetupBuilder<SAXPipelineComponent>() {
 
+                    @Override
                     public Pipeline<SAXPipelineComponent> setup(final OutputStream
outputStream) {
                         if (outputStream == null) {
                             throw new IllegalArgumentException("Parameter 'outputStream'
must be not null");
@@ -200,10 +250,18 @@ public final class LinkedSAXPipelineComp
                         return pipeline;
                     }
 
+                    @Override
+                    public Pipeline<SAXPipelineComponent> setup(final OutputStream
outputStream,
+                            final Map<String, Object> parameters) {
+
+                        if (outputStream == null) {
+                            throw new IllegalArgumentException("Parameter 'outputStream'
must be not null");
+                        }
+                        pipeline.setup(outputStream, parameters);
+                        return pipeline;
+                    }
                 };
             }
-
         };
     }
-
 }



Mime
View raw message