You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2004/10/26 15:17:54 UTC

svn commit: rev 55606 - incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation

Author: andreas
Date: Tue Oct 26 06:17:53 2004
New Revision: 55606

Modified:
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/AbstractDOMTransformer.java
Log:
changed AbstractDOMTransformer from Composable to Serviceable

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/AbstractDOMTransformer.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/AbstractDOMTransformer.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/AbstractDOMTransformer.java	Tue Oct 26 06:17:53 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: AbstractDOMTransformer.java,v 1.6 2004/03/01 16:18:20 gregor Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.cocoon.transformation;
 
@@ -24,9 +24,10 @@
 
 import org.apache.avalon.excalibur.pool.Recyclable;
 import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.avalon.framework.component.Composable;
 import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.transformation.AbstractTransformer;
@@ -38,44 +39,42 @@
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
 
-
 /**
  * An Abstract DOM Transformer, for use when a transformer needs a DOM-based
- * view of the document.
- * Subclass this interface and implement <code>transform(Document doc)</code>.
- * If you need a ComponentManager there is an instance variable
- * <code>manager</code> for use.
+ * view of the document. Subclass this interface and implement
+ * <code>transform(Document doc)</code>. If you need a ComponentManager there
+ * is an instance variable <code>manager</code> for use.
  */
 public abstract class AbstractDOMTransformer extends AbstractTransformer implements Transformer,
-    DOMBuilder.Listener, Composable, Disposable, Recyclable {
+        DOMBuilder.Listener, Serviceable, Disposable, Recyclable {
     /**
-     *  The SAX entity resolver
+     * The SAX entity resolver
      */
     protected SourceResolver resolver;
 
     /**
-     *  The request object model
+     * The request object model
      */
     protected Map objectModel;
 
     /**
-     *  The URI requested
+     * The URI requested
      */
     protected String source;
 
     /**
-     *  Parameters in the sitemap
+     * Parameters in the sitemap
      */
     protected Parameters parameters;
 
     /**
-     * A <code>ComponentManager</code> which is available for use.
+     * A <code>ServiceManager</code> which is available for use.
      */
-    protected ComponentManager manager;
+    protected ServiceManager manager;
 
     /**
-     * The <code>DOMBuilder</code> used to build DOM tree out of
-     *incoming SAX events.
+     * The <code>DOMBuilder</code> used to build DOM tree out of incoming SAX
+     * events.
      */
     protected DOMBuilder builder;
 
@@ -88,21 +87,15 @@
     }
 
     /**
-     * Set the component manager.
-     */
-    public void compose(ComponentManager manager) {
-        this.manager = manager;
-    }
-
-    /**
      * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
-     * the source and sitemap <code>Parameters</code> used to process the request.
-     *
+     * the source and sitemap <code>Parameters</code> used to process the
+     * request.
+     * 
      * If you wish to process the parameters, override this method, call
      * <code>super()</code> and then add your code.
      */
     public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
-        throws ProcessingException, SAXException, IOException {
+            throws ProcessingException, SAXException, IOException {
         this.resolver = resolver;
         this.objectModel = objectModel;
         this.source = src;
@@ -145,7 +138,8 @@
     }
 
     /**
-     * Transform the specified DOM, returning a new DOM to stream down the pipeline.
+     * Transform the specified DOM, returning a new DOM to stream down the
+     * pipeline.
      * @param doc The DOM Document representing the SAX stream
      * @return A DOM Document to stream down the pipeline
      */
@@ -158,203 +152,78 @@
         builder.setDocumentLocator(locator);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void startDocument() throws SAXException {
         builder.startDocument();
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void endDocument() throws SAXException {
         builder.endDocument();
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param prefix DOCUMENT ME!
-     * @param uri DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void startPrefixMapping(String prefix, String uri)
-        throws SAXException {
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
         builder.startPrefixMapping(prefix, uri);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param prefix DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void endPrefixMapping(String prefix) throws SAXException {
         builder.endPrefixMapping(prefix);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param uri DOCUMENT ME!
-     * @param loc DOCUMENT ME!
-     * @param raw DOCUMENT ME!
-     * @param a DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void startElement(String uri, String loc, String raw, Attributes a)
-        throws SAXException {
+    public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException {
         builder.startElement(uri, loc, raw, a);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param uri DOCUMENT ME!
-     * @param loc DOCUMENT ME!
-     * @param raw DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void endElement(String uri, String loc, String raw)
-        throws SAXException {
+    public void endElement(String uri, String loc, String raw) throws SAXException {
         builder.endElement(uri, loc, raw);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param c DOCUMENT ME!
-     * @param start DOCUMENT ME!
-     * @param len DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void characters(char[] c, int start, int len)
-        throws SAXException {
+    public void characters(char[] c, int start, int len) throws SAXException {
         builder.characters(c, start, len);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param c DOCUMENT ME!
-     * @param start DOCUMENT ME!
-     * @param len DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void ignorableWhitespace(char[] c, int start, int len)
-        throws SAXException {
+    public void ignorableWhitespace(char[] c, int start, int len) throws SAXException {
         builder.ignorableWhitespace(c, start, len);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param target DOCUMENT ME!
-     * @param data DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void processingInstruction(String target, String data)
-        throws SAXException {
+    public void processingInstruction(String target, String data) throws SAXException {
         builder.processingInstruction(target, data);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param name DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void skippedEntity(String name) throws SAXException {
         builder.skippedEntity(name);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param name DOCUMENT ME!
-     * @param publicId DOCUMENT ME!
-     * @param systemId DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
-    public void startDTD(String name, String publicId, String systemId)
-        throws SAXException {
+    public void startDTD(String name, String publicId, String systemId) throws SAXException {
         builder.startDTD(name, publicId, systemId);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void endDTD() throws SAXException {
         builder.endDTD();
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param name DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void startEntity(String name) throws SAXException {
         builder.startEntity(name);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param name DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void endEntity(String name) throws SAXException {
         builder.endEntity(name);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void startCDATA() throws SAXException {
         builder.startCDATA();
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
-     */
     public void endCDATA() throws SAXException {
         builder.endCDATA();
     }
 
+    public void comment(char[] ch, int start, int len) throws SAXException {
+        builder.comment(ch, start, len);
+    }
+
     /**
-     * DOCUMENT ME!
-     *
-     * @param ch DOCUMENT ME!
-     * @param start DOCUMENT ME!
-     * @param len DOCUMENT ME!
-     *
-     * @throws SAXException DOCUMENT ME!
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
-    public void comment(char[] ch, int start, int len)
-        throws SAXException {
-        builder.comment(ch, start, len);
+    public void service(ServiceManager manager) throws ServiceException {
+        this.manager = manager;
     }
-}
+}
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org