cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r740566 - in /cocoon/cocoon3/trunk/cocoon-sax/src: main/java/org/apache/cocoon/sax/util/ test/java/org/apache/cocoon/pipeline/component/sax/ test/java/org/apache/cocoon/sax/
Date Wed, 04 Feb 2009 01:30:38 GMT
Author: reinhard
Date: Wed Feb  4 01:30:37 2009
New Revision: 740566

URL: http://svn.apache.org/viewvc?rev=740566&view=rev
Log:
set the type of pipelines

Modified:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.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/util/TransformationUtils.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java?rev=740566&r1=740565&r2=740566&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
Wed Feb  4 01:30:37 2009
@@ -24,14 +24,15 @@
 
 import org.apache.cocoon.pipeline.NonCachingPipeline;
 import org.apache.cocoon.pipeline.Pipeline;
+import org.apache.cocoon.sax.SAXPipelineComponent;
 import org.apache.cocoon.sax.component.StringGenerator;
 import org.apache.cocoon.sax.component.XMLSerializer;
 import org.apache.cocoon.sax.component.XSLTTransformer;
 
 /**
- * This class contains utility methods to transform an XML string by using XSLT. It hides
all the details of the Java
- * TRaX API by using SAX pipeline components that are linked to each other. This means that
the SAX events stream
- * through the pipeline and are serialized at the end.
+ * This class contains utility methods to transform an XML string by using XSLT. It hides
all the
+ * details of the Java TRaX API by using SAX pipeline components that are linked to each
other. This
+ * means that the SAX events stream through the pipeline and are serialized at the end.
  * 
  * NOTE: Exception handling needs to be discussed and will probably change.
  */
@@ -41,8 +42,8 @@
      * Transform an XML string by using XSLT.
      * 
      * @param xmlString The String to be transformed.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @return The transformed result as {@link String}.
      * 
      * @throws Exception
@@ -52,12 +53,13 @@
     }
 
     /**
-     * Transform an XML string by using XSLT. This method also allows passing parameters
to the stylesheets.
+     * Transform an XML string by using XSLT. This method also allows passing parameters
to the
+     * stylesheets.
      * 
      * @param xmlString The String to be transformed.
      * @param xsltParameters Parameters that are available in all XSLT stylesheets.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @return The transformed result as {@link String}.
      * @throws Exception
      */
@@ -71,8 +73,8 @@
      * 
      * @param xmlString The String to be transformed.
      * @param outputProperties XML output properties. See {@link http://www.w3.org/TR/xslt#output}.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @return The transformed result as {@link String}.
      * @throws Exception
      */
@@ -81,14 +83,14 @@
     }
 
     /**
-     * Transform an XML string by using XSLT. This method allows defining the output properties
and also allows passing
-     * parameters to the stylesheets.
+     * Transform an XML string by using XSLT. This method allows defining the output properties
and
+     * also allows passing parameters to the stylesheets.
      * 
      * @param xmlString The String to be transformed.
      * @param xsltParameters Parameters that are available in all XSLT stylesheets.
      * @param outputProperties XML output properties. See {@link http://www.w3.org/TR/xslt#output}.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @return The transformed result as {@link String}.
      * @throws Exception
      */
@@ -104,8 +106,8 @@
      * 
      * @param xmlString The String to be transformed.
      * @param outputStream The result is written into this {@link OutputStream}.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @throws Exception
      */
     public static void transform(String xmlString, OutputStream outputStream, URL... xsltURLs)
throws Exception {
@@ -113,14 +115,14 @@
     }
 
     /**
-     * Transform an XML string by using XSLT and write the result into an {@link OutputStream}.
This method also allows
-     * passing parameters to the stylesheets.
+     * Transform an XML string by using XSLT and write the result into an {@link OutputStream}.
+     * This method also allows passing parameters to the stylesheets.
      * 
      * @param xmlString The String to be transformed.
      * @param outputStream The result is written into this {@link OutputStream}.
      * @param xsltParameters Parameters that are available in all XSLT stylesheets.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @throws Exception
      */
     public static void transform(String xmlString, OutputStream outputStream, Map<String,
Object> xsltParameters,
@@ -129,14 +131,14 @@
     }
 
     /**
-     * Transform an XML string by using XSLT and write the result into an {@link OutputStream}.
This method allows
-     * defining the output properties.
+     * Transform an XML string by using XSLT and write the result into an {@link OutputStream}.
+     * This method allows defining the output properties.
      * 
      * @param xmlString The String to be transformed.
      * @param outputStream The result is written into this {@link OutputStream}.
      * @param outputProperties XML output properties. See {@link http://www.w3.org/TR/xslt#output}.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * @throws Exception
      */
     public static void transform(String xmlString, OutputStream outputStream, Properties
outputProperties,
@@ -151,14 +153,14 @@
      * @param xsltParameters Parameters that are available in all XSLT stylesheets.
      * @param outputProperties XML output properties. See {@link http://www.w3.org/TR/xslt#output}.
      * @param outputStream The result is written into this {@link OutputStream}.
-     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are passed to transform
-     *            the passed XML string.
+     * @param xsltUrls The {@link URL}s of all XSLT stylesheets that are used in the order
they are
+     *            passed to transform the passed XML string.
      * 
      * @throws Exception
      */
     public static void transform(String xmlString, Map<String, Object> xsltParameters,
Properties outputProperties,
             OutputStream outputStream, URL... xsltUrls) throws Exception {
-        Pipeline pipeline = new NonCachingPipeline();
+        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
 
         pipeline.addComponent(new StringGenerator(xmlString));
         for (URL xsltUrl : xsltUrls) {

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java?rev=740566&r1=740565&r2=740566&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
Wed Feb  4 01:30:37 2009
@@ -24,6 +24,7 @@
 
 import org.apache.cocoon.pipeline.NonCachingPipeline;
 import org.apache.cocoon.pipeline.Pipeline;
+import org.apache.cocoon.sax.SAXPipelineComponent;
 import org.apache.cocoon.sax.component.SchemaProcessorTransformer;
 import org.apache.cocoon.sax.component.SchemaValidationException;
 import org.apache.cocoon.sax.component.StringGenerator;
@@ -34,12 +35,12 @@
 public class SchemaProcessorTransformerTest {
 
     /**
-     * A pipeline that performs an identity transformation, using the validation: generator
-&gt; validator -&gt;
-     * serializer
+     * A pipeline that performs an identity transformation, using the validation: generator
-&gt;
+     * validator -&gt; serializer
      */
     @Test
     public void testPipelineWithValidation() throws Exception {
-        Pipeline pipeline = this.createValidatingPipeline("<x></x>");
+        Pipeline<SAXPipelineComponent> pipeline = this.createValidatingPipeline("<x></x>");
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         pipeline.setup(baos);
@@ -53,12 +54,13 @@
     }
 
     /**
-     * A pipeline that performs an identity transformation, using the validation: generator
-&gt; validator -&gt;
-     * serializer. An error is expected performing <code>execute</code> method
due to not valid xml input.
+     * A pipeline that performs an identity transformation, using the validation: generator
-&gt;
+     * validator -&gt; serializer. An error is expected performing <code>execute</code>
method due
+     * to not valid xml input.
      */
     @Test
     public void testPipelineWithWrongValidation() throws Exception {
-        Pipeline pipeline = this.createValidatingPipeline("<y><z/></y>");
+        Pipeline<SAXPipelineComponent> pipeline = this.createValidatingPipeline("<y><z/></y>");
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         pipeline.setup(baos);
@@ -70,8 +72,8 @@
         }
     }
 
-    private Pipeline createValidatingPipeline(String xmlInput) {
-        Pipeline pipeline = new NonCachingPipeline();
+    private Pipeline<SAXPipelineComponent> createValidatingPipeline(String xmlInput)
{
+        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
         pipeline.addComponent(new StringGenerator(xmlInput));
         pipeline.addComponent(new SchemaProcessorTransformer(this.getClass().getResource("/test.xsd")));
         pipeline.addComponent(new XMLSerializer());

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=740566&r1=740565&r2=740566&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
Wed Feb  4 01:30:37 2009
@@ -36,7 +36,7 @@
      * serializer
      */
     public void testPipelineWithTransformer() throws Exception {
-        Pipeline pipeline = new NonCachingPipeline();
+        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
         pipeline.addComponent(new StringGenerator("<x></x>"));
         pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt")));
         pipeline.addComponent(new XMLSerializer());



Mime
View raw message