cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r676522 - /cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
Date Mon, 14 Jul 2008 09:19:22 GMT
Author: reinhard
Date: Mon Jul 14 02:19:22 2008
New Revision: 676522

URL: http://svn.apache.org/viewvc?rev=676522&view=rev
Log:
A generator that uses a simple String

Added:
    cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
  (with props)

Added: cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java?rev=676522&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
(added)
+++ cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
Mon Jul 14 02:19:22 2008
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import java.io.ByteArrayInputStream;
+
+import org.apache.cocoon.corona.pipeline.util.StringRepresentation;
+import org.apache.cocoon.corona.pipeline.util.XMLUtils;
+
+public class StringGenerator extends AbstractXMLProducer implements Starter {
+
+    private String xmlString;
+
+    public StringGenerator(String xmlString) {
+        super();
+        if (xmlString == null) {
+            throw new IllegalArgumentException("An XML string has to be passed.");
+        }
+
+        this.xmlString = xmlString;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Starter#execute()
+     */
+    public void execute() {
+        XMLUtils.toSax(new ByteArrayInputStream(this.xmlString.getBytes()), this.getXMLConsumer());
+    }
+
+    @Override
+    public String toString() {
+        return StringRepresentation.buildString(this, "xmlString=" + this.xmlString);
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/component/StringGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message