cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation/helpers MirrorRecorder.java
Date Thu, 30 Jan 2003 05:00:17 GMT
vgritsenko    2003/01/29 21:00:15

  Modified:    src/java/org/apache/cocoon/components/language/markup/xsp
                        JSGenerator.java
               src/java/org/apache/cocoon/components/language/programming
                        CompiledProgrammingLanguage.java
               src/java/org/apache/cocoon/components/language/programming/javascript
                        CompiledJavascriptLanguage.java
               src/java/org/apache/cocoon/components/modules/input
                        DigestMetaModule.java
               src/java/org/apache/cocoon/components/request/multipart
                        MultipartParser.java
               src/java/org/apache/cocoon/components/source SourceUtil.java
               src/java/org/apache/cocoon/components/store
                        JispFilesystemStore.java
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ContinueNode.java MatchNode.java MountNode.java
                        SerializeNode.java
               src/java/org/apache/cocoon/components/validation/schematron
                        SchematronFactory.java
               src/java/org/apache/cocoon/components/xmlform Form.java
               src/java/org/apache/cocoon/generation
                        MP3DirectoryGenerator.java
               src/java/org/apache/cocoon/i18n XMLResourceBundle.java
               src/java/org/apache/cocoon/transformation/helpers
                        MirrorRecorder.java
  Log:
  cosmetic changes (mostly removal of unused variables)
  
  Revision  Changes    Path
  1.13      +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/JSGenerator.java
  
  Index: JSGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/JSGenerator.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JSGenerator.java	19 Dec 2002 15:14:56 -0000	1.12
  +++ JSGenerator.java	30 Jan 2003 05:00:11 -0000	1.13
  @@ -160,7 +160,7 @@
           }
   
           // add enter/exit here, too 
  -        Context context = Context.enter();
  +        Context.enter();
           try {
               global.put("objectModel", global, Context.toObject(this.objectModel, global));
               global.put("request", global, Context.toObject(this.request, global));
  
  
  
  1.11      +5 -3      xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/CompiledProgrammingLanguage.java
  
  Index: CompiledProgrammingLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/CompiledProgrammingLanguage.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CompiledProgrammingLanguage.java	29 Mar 2002 20:32:01 -0000	1.10
  +++ CompiledProgrammingLanguage.java	30 Jan 2003 05:00:12 -0000	1.11
  @@ -174,7 +174,8 @@
           // Don't need to test for existence of the object code as it might be bundled into the WAR.
           try {
               Class program = this.loadProgram(filename, baseDirectory);
  -            Object testInstance = program.newInstance();
  +            // Create and discard test instance.
  +            program.newInstance();
               return new JavaProgram(program);
           } catch (Throwable t) {
               throw new LanguageException("Unable to preload program " + filename, t);
  @@ -212,7 +213,8 @@
   
           // Try to instantiate once to ensure there are no exceptions thrown in the constructor
           try {
  -            Object testInstance = program.newInstance();
  +            // Create and discard test instance
  +            program.newInstance();
           } catch(IllegalAccessException iae) {
               getLogger().debug("No public constructor for class " + program.getName());
           } catch(Exception e) {
  
  
  
  1.5       +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/javascript/CompiledJavascriptLanguage.java
  
  Index: CompiledJavascriptLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/javascript/CompiledJavascriptLanguage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CompiledJavascriptLanguage.java	7 Jan 2003 23:17:09 -0000	1.4
  +++ CompiledJavascriptLanguage.java	30 Jan 2003 05:00:12 -0000	1.5
  @@ -87,8 +87,6 @@
               String name, File baseDirectory, String encoding
               ) throws LanguageException {
           try {
  -            Main compiler = (Main) this.compilerClass.newInstance();
  -
               int pos = name.lastIndexOf(File.separatorChar);
               String filename = name.substring(pos + 1);
               String pathname =
  
  
  
  1.14      +4 -12     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java
  
  Index: DigestMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DigestMetaModule.java	27 Jan 2003 10:37:15 -0000	1.13
  +++ DigestMetaModule.java	30 Jan 2003 05:00:12 -0000	1.14
  @@ -159,9 +159,6 @@
           }
   
   
  -
  -
  -        Object result = null;
           Object value = getValue(name, objectModel,
                                   this.input, this.defaultInput, this.inputConf,
                                   null, inputName, inputConfig);
  @@ -188,10 +185,7 @@
       }
   
   
  -
  -
  -
  -    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
            if (!this.initialized) {
  @@ -223,9 +217,7 @@
      }
   
   
  -
  -
  -    public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 
  +    public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
           if (!this.initialized) {
  @@ -291,7 +283,7 @@
       /**
        * Create the output representation.
        * @param b a <code>byte[]</code>
  -     * @param encode an <code>int</code>, one of {@link ENCODING_NONE},{@link ENCODING_URL},{@link ENCODING_HEX}
  +     * @param encode an <code>int</code>, one of {@link #ENCODING_NONE},{@link #ENCODING_URL},{@link #ENCODING_HEX}
        * @return an <code>Object</code>
        */
       Object encodeByteArray(byte[] b, int encode) {
  
  
  
  1.6       +6 -9      xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/MultipartParser.java
  
  Index: MultipartParser.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/MultipartParser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MultipartParser.java	21 Jan 2003 15:55:50 -0000	1.5
  +++ MultipartParser.java	30 Jan 2003 05:00:12 -0000	1.6
  @@ -97,18 +97,15 @@
       /** Field silentlyRename           */
       private boolean silentlyRename;
   
  -    /** Field maxUploadSize           */
  -    private int maxUploadSize;
  -
       /** Field characterEncoding       */
       private String characterEncoding;
       /**
        * Constructor, parses given request
        *
        * @param request The servlet request.
  -     * @param saveUploadFilesToDisk Write fileparts to the uploadDirectory. If true the corresponding object
  +     * @param saveUploadedFilesToDisk Write fileparts to the uploadDirectory. If true the corresponding object
        *              in the hashtable will contain a FilePartFile, if false a FilePartArray
  -     * @param File uploadDirectory The directory to write to if saveUploadedFilesToDisk is true.
  +     * @param uploadDirectory The directory to write to if saveUploadedFilesToDisk is true.
        * @param saveUploadedFilesToDisk
        * @param uploadDirectory
        * @param allowOverwrite Allow existing files to be overwritten.
  @@ -126,9 +123,10 @@
           this.uploadDirectory = uploadDirectory;
           this.allowOverwrite = allowOverwrite;
           this.silentlyRename = silentlyRename;
  -        this.maxUploadSize = maxUploadSize;
           this.characterEncoding = request.getCharacterEncoding();
  -        if (this.characterEncoding == null) this.characterEncoding = "ISO-8859-1";
  +        if (this.characterEncoding == null) {
  +            this.characterEncoding = "ISO-8859-1";
  +        }
   
           if (request.getContentLength() > maxUploadSize) {
               throw new IOException("Content length exceeds maximum upload size");
  @@ -288,7 +286,6 @@
               throws IOException {
   
           byte[] buf = new byte[INLINE_BUFFER_SIZE];
  -        ByteArrayOutputStream out = new ByteArrayOutputStream();
           StringBuffer value = new StringBuffer();
   
           while (in.getState() == TokenStream.STATE_READING) {
  
  
  
  1.15      +62 -63    xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java
  
  Index: SourceUtil.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SourceUtil.java	29 Jan 2003 14:56:47 -0000	1.14
  +++ SourceUtil.java	30 Jan 2003 05:00:13 -0000	1.15
  @@ -87,8 +87,7 @@
    * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version $Id$
    */
  -public final class SourceUtil
  -{
  +public final class SourceUtil {
   
       /** Avoid instantiation */
       protected SourceUtil() {
  @@ -272,11 +271,11 @@
        * @throws SAXException If a SAX exception occurs.
        * @throws SourceException If the source an exception throws.
        */
  -    static public Source getSource(String uri, Parameters typeParameters,
  -                                   SourceParameters resourceParameters,
  -                                   SourceResolver resolver)
  -                                     throws IOException, SAXException,
  -                                            SourceException {
  +    static public Source getSource( String           uri,
  +                                    Parameters       typeParameters,
  +                                    SourceParameters resourceParameters,
  +                                    SourceResolver   resolver)
  +    throws IOException, SAXException, SourceException {
   
           // first step: encode parameters which are already appended to the url
           int queryPos = uri.indexOf('?');
  @@ -305,16 +304,16 @@
                   uri = buffer.toString();
               }
           }
  -        boolean followRedirects = ((typeParameters!=null)
  -                                   ? typeParameters.getParameterAsBoolean("followRedirects", true)
  -                                   : true);
  +        // FIXME: followRedirects: Is it something which is not completed?
  +//        boolean followRedirects = (typeParameters != null ?
  +//                                   typeParameters.getParameterAsBoolean("followRedirects", true)
  +//                                      : true);
           String method = ((typeParameters!=null)
                            ? typeParameters.getParameter("method", "GET")
                            : "GET");
  -
           if (method.equalsIgnoreCase("POST") &&
  -            ((resourceParameters==null) ||
  -             !resourceParameters.hasParameters())) {
  +                (resourceParameters == null ||
  +                !resourceParameters.hasParameters())) {
               method = "GET";
           }
           if (uri.startsWith("cocoon:") && (resourceParameters!=null) &&
  @@ -428,13 +427,14 @@
        *
        * @throws ProcessingException
        */
  -    public static void writeDOM(String location, Parameters typeParameters,
  +    public static void writeDOM(String location,
  +                                Parameters typeParameters,
                                   SourceParameters parameters,
                                   DocumentFragment frag,
                                   SourceResolver resolver,
                                   String serializerName,
                                   ComponentManager manager)
  -                                  throws ProcessingException {
  +            throws ProcessingException {
   
           Source source = null;
   
  @@ -455,29 +455,29 @@
                       // Lookup the Serializer
                       // FIXME (CZ) : Due to the CM hierarchy we don't get the
                       // correct serializer selector...
  -                    // ComponentSelector selector = null;
  -                    // Serializer serializer = null;
  -                    // OutputStream oStream = null;
  -                    // try {
  -                    // selector = (ComponentSelector)manager.lookup(Serializer.ROLE + "Selector");
  -                    // serializer = (Serializer)selector.select(serializerName);
  -                    // oStream = ws.getOutputStream();
  -                    // serializer.setOutputStream(oStream);
  -                    // DOMStreamer streamer = new DOMStreamer(serializer);
  -                    // streamer.stream(frag);
  -                    // } finally {
  -                    // if (oStream != null) {
  -                    // oStream.flush();
  -                    // try {
  -                    // oStream.close();
  -                    // } finally {
  -                    // if ( selector != null ) {
  -                    // selector.release( serializer );
  -                    // manager.release( selector );
  -                    // }
  -                    // }
  -                    // }
  -                    // }
  +//                    ComponentSelector selector = null;
  +//                    Serializer serializer = null;
  +//                    OutputStream oStream = null;
  +//                    try {
  +//                        selector = (ComponentSelector)manager.lookup(Serializer.ROLE + "Selector");
  +//                        serializer = (Serializer)selector.select(serializerName);
  +//                        oStream = ws.getOutputStream();
  +//                        serializer.setOutputStream(oStream);
  +//                        DOMStreamer streamer = new DOMStreamer(serializer);
  +//                        streamer.stream(frag);
  +//                    } finally {
  +//                        if (oStream != null) {
  +//                            oStream.flush();
  +//                            try {
  +//                                oStream.close();
  +//                            } finally {
  +//                                if ( selector != null ) {
  +//                                    selector.release( serializer );
  +//                                    manager.release( selector );
  +//                                }
  +//                            }
  +//                        }
  +//                    }
                       final String content = XMLUtils.serializeNode(frag,
                                                  XMLUtils.defaultSerializeToXMLFormat(false));
                       OutputStream oStream = ws.getOutputStream();
  @@ -491,29 +491,29 @@
                   // Lookup the Serializer
                   // FIXME (CZ) : Due to the CM hierarchy we don't get the
                   // correct serializer selector...
  -                // ComponentSelector selector = null;
  -                // Serializer serializer = null;
  -                // ByteArrayOutputStream oStream = new ByteArrayOutputStream();
  -                // try {
  -                // selector = (ComponentSelector)manager.lookup(Serializer.ROLE + "Selector");
  -                // serializer = (Serializer)selector.select(serializerName);
  -                // serializer.setOutputStream(oStream);
  -                // DOMStreamer streamer = new DOMStreamer(serializer);
  -                // streamer.stream(frag);
  -                // } finally {
  -                // if (oStream != null) {
  -                // oStream.flush();
  -                // try {
  -                // oStream.close();
  -                // } finally {
  -                // if ( selector != null ) {
  -                // selector.release( serializer );
  -                // manager.release( selector );
  -                // }
  -                // }
  -                // }
  -                // }
  -                // final String content = oStream.toString();
  +//                ComponentSelector selector = null;
  +//                Serializer serializer = null;
  +//                ByteArrayOutputStream oStream = new ByteArrayOutputStream();
  +//                try {
  +//                    selector = (ComponentSelector)manager.lookup(Serializer.ROLE + "Selector");
  +//                    serializer = (Serializer)selector.select(serializerName);
  +//                    serializer.setOutputStream(oStream);
  +//                    DOMStreamer streamer = new DOMStreamer(serializer);
  +//                    streamer.stream(frag);
  +//                } finally {
  +//                    if (oStream != null) {
  +//                        oStream.flush();
  +//                        try {
  +//                            oStream.close();
  +//                        } finally {
  +//                            if ( selector != null ) {
  +//                                selector.release( serializer );
  +//                                manager.release( selector );
  +//                            }
  +//                        }
  +//                    }
  +//                }
  +//                final String content = oStream.toString();
                   final String content = XMLUtils.serializeNode(frag,
                                              XMLUtils.defaultSerializeToXMLFormat(false));
   
  @@ -572,7 +572,6 @@
               fragment.appendChild(doc.getDocumentElement());
   
               return fragment;
  -
           } catch (IOException ce) {
               throw new ProcessingException(ce);
           } catch (SAXException ce) {
  
  
  
  1.11      +26 -24    xml-cocoon2/src/java/org/apache/cocoon/components/store/JispFilesystemStore.java
  
  Index: JispFilesystemStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/JispFilesystemStore.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JispFilesystemStore.java	17 Dec 2002 14:58:32 -0000	1.10
  +++ JispFilesystemStore.java	30 Jan 2003 05:00:13 -0000	1.11
  @@ -183,18 +183,21 @@
   
           try {
               if (params.getParameterAsBoolean("use-cache-directory", false)) {
  -                if (this.getLogger().isDebugEnabled())
  +                if (getLogger().isDebugEnabled()) {
                       getLogger().debug("Using cache directory: " + m_cacheDir);
  +                }
                   setDirectory(m_cacheDir);
               } else if (params.getParameterAsBoolean("use-work-directory", false)) {
  -                if (this.getLogger().isDebugEnabled())
  +                if (getLogger().isDebugEnabled()) {
                       getLogger().debug("Using work directory: " + m_workDir);
  +                }
                   setDirectory(m_workDir);
               } else if (params.getParameter("directory", null) != null) {
                   String dir = params.getParameter("directory");
                   dir = IOUtils.getContextFilePath(m_workDir.getPath(), dir);
  -                if (this.getLogger().isDebugEnabled())
  +                if (getLogger().isDebugEnabled()) {
                       getLogger().debug("Using directory: " + dir);
  +                }
                   setDirectory(new File(dir));
               } else {
                   try {
  @@ -212,9 +215,9 @@
           String indexName = params.getParameter("m_indexFile", "cocoon.idx");
           m_Order = params.getParameterAsInteger("order", 301);
           if (getLogger().isDebugEnabled()) {
  -            this.getLogger().debug("Database file name = " + databaseName);
  -            this.getLogger().debug("Index file name = " + indexName);
  -            this.getLogger().debug("Order=" + m_Order);
  +            getLogger().debug("Database file name = " + databaseName);
  +            getLogger().debug("Index file name = " + indexName);
  +            getLogger().debug("Order=" + m_Order);
           }
   
           m_databaseFile = new File(m_directoryFile, databaseName);
  @@ -232,14 +235,14 @@
           try {
               if (m_databaseFile.exists()) {
                   if (getLogger().isDebugEnabled()) {
  -                    this.getLogger().debug("initialize(): Datafile exists");
  +                    getLogger().debug("initialize(): Datafile exists");
                   }
                   m_Database = new IndexedObjectDatabase(m_databaseFile.toString(), false);
                   m_Index = new BTreeIndex(m_indexFile.toString());
                   m_Database.attachIndex(m_Index);
               } else {
                   if (getLogger().isDebugEnabled()) {
  -                    this.getLogger().debug("initialize(): Datafile does not exist");
  +                    getLogger().debug("initialize(): Datafile does not exist");
                   }
                   m_Database = new IndexedObjectDatabase(m_databaseFile.toString(), false);
                   m_Index = new BTreeIndex(m_indexFile.toString(),
  @@ -270,7 +273,7 @@
       public synchronized Object get(Object key) {
           Object value = null;
           try {
  -            value = m_Database.read(this.wrapKeyObject(key), m_Index);
  +            value = m_Database.read(wrapKeyObject(key), m_Index);
               if (getLogger().isDebugEnabled()) {
                   if (value != null) {
                       if (getLogger().isDebugEnabled()) {
  @@ -299,19 +302,19 @@
           throws IOException {
   
           if (getLogger().isDebugEnabled()) {
  -            this.getLogger().debug("store(): Store file with key: "
  +            getLogger().debug("store(): Store file with key: "
                                     + key.toString());
  -            this.getLogger().debug("store(): Store file with value: "
  +            getLogger().debug("store(): Store file with value: "
                                     + value.toString());
           }
   
           if (value instanceof Serializable) {
               try {
                   KeyObject[] keyArray = new KeyObject[1];
  -                keyArray[0] = this.wrapKeyObject(key);
  +                keyArray[0] = wrapKeyObject(key);
                   m_Database.write(keyArray, (Serializable) value);
               } catch (Exception e) {
  -                this.getLogger().error("store(..): Exception", e);
  +                getLogger().error("store(..): Exception", e);
               }
           } else {
               throw new IOException("Object not Serializable");
  @@ -345,13 +348,13 @@
           BTreeObjectEnumeration enum = new BTreeObjectEnumeration(m_Database.createIterator(m_Index),this);
   
           if (getLogger().isDebugEnabled()) {
  -            this.getLogger().debug("clear(): Clearing the database ");
  +            getLogger().debug("clear(): Clearing the database ");
           }
           
           while(enum.hasMoreElements()) {
               Object tmp = enum.nextElement();
               if (getLogger().isDebugEnabled()) {
  -                this.getLogger().debug("clear(): Removing key: " + tmp.toString());
  +                getLogger().debug("clear(): Removing key: " + tmp.toString());
               }
               this.remove(tmp);
           }
  @@ -364,16 +367,16 @@
        */
       public synchronized void remove(Object key) {
           if (getLogger().isDebugEnabled()) {
  -            this.getLogger().debug("remove(..) Remove item");
  +            getLogger().debug("remove(..) Remove item");
           }
   
           try {
               KeyObject[] keyArray = new KeyObject[1];
  -            keyArray[0] = this.wrapKeyObject(key);
  +            keyArray[0] = wrapKeyObject(key);
               m_Database.remove(keyArray);
           } catch (KeyNotFound ignore) {
           } catch (Exception e) {
  -            this.getLogger().error("remove(..): Exception", e);
  +            getLogger().error("remove(..): Exception", e);
           }
       }
   
  @@ -387,13 +390,13 @@
           long res = -1;
   
           try {
  -            res = m_Index.findKey(this.wrapKeyObject(key));
  +            res = m_Index.findKey(wrapKeyObject(key));
               if (getLogger().isDebugEnabled()) {
  -                this.getLogger().debug("containsKey(..): res=" + res);
  +                getLogger().debug("containsKey(..): res=" + res);
               }
           } catch (KeyNotFound ignore) {
           } catch (Exception e) {
  -            this.getLogger().error("containsKey(..): Exception", e);
  +            getLogger().error("containsKey(..): Exception", e);
           }
   
           if (res > 0) {
  @@ -432,8 +435,7 @@
        */
       private KeyObject wrapKeyObject(Object key) {
           // TODO: Implementation of Integer and Long keys
  -        String skey = String.valueOf(key);
  -        return new JispStringKey(key.toString());
  +        return new JispStringKey(String.valueOf(key));
       }
   
       class BTreeObjectEnumeration implements Enumeration {
  
  
  
  1.7       +77 -81    xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ContinueNode.java
  
  Index: ContinueNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ContinueNode.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ContinueNode.java	5 Dec 2002 10:20:35 -0000	1.6
  +++ ContinueNode.java	30 Jan 2003 05:00:13 -0000	1.7
  @@ -71,88 +71,84 @@
    * @since March 25, 2002
    */
   public class ContinueNode
  -  extends AbstractProcessingNode
  -  implements Configurable, Composable
  +        extends AbstractProcessingNode
  +        implements Configurable, Composable
   {
  -  protected String continuationId;
  -  protected List parameters;
  -  protected VariableResolver continuationIdResolver;
  -  protected ComponentManager manager;
  -
  -  public ContinueNode(String contId)
  -  {
  -    this.continuationId = contId;
  -  }
  -
  -  public void configure(Configuration config)
  -    throws ConfigurationException
  -  {
  -    parameters = new ArrayList();
  -
  -    Configuration[] params = config.getChildren("parameter");
  -    for (int i = 0; i < params.length; i++) {
  -      Configuration param = params[i];
  -      String name = param.getAttribute("name", null);
  -      String value = param.getAttribute("value", null);
  -      parameters.add(new Interpreter.Argument(name, value));
  -    }
  -
  -    try {
  -      // The continuation id should would need to be resolved at all
  -      // times, but who knows...
  -      if (VariableResolverFactory.needsResolve(continuationId)) {
  -        this.continuationIdResolver
  -          = VariableResolverFactory.getResolver(continuationId, this.manager);
  -      }
  -    }
  -    catch (PatternException ex) {
  -      throw new ConfigurationException(ex.toString());
  -    }
  -  }
  -
  -  public void compose(ComponentManager manager)
  -  {
  -    this.manager = manager;
  -  }
  -
  -  public boolean invoke(Environment env, InvokeContext context)
  -      throws Exception
  -  {
  -    List params = null;
  -
  -    // Resolve parameters
  -    if (this.parameters != null)
  -      params = CallFunctionNode.resolveList(this.parameters, this.manager,
  -                                            context, env.getObjectModel());
  -
  -    String contId = continuationId;
  +    protected String continuationId;
  +    protected List parameters;
  +    protected VariableResolver continuationIdResolver;
  +    protected ComponentManager manager;
  +
  +    public ContinueNode(String contId) {
  +        this.continuationId = contId;
  +    }
  +
  +    public void configure(Configuration config)
  +            throws ConfigurationException
  +    {
  +        parameters = new ArrayList();
  +
  +        Configuration[] params = config.getChildren("parameter");
  +        for (int i = 0; i < params.length; i++) {
  +            Configuration param = params[i];
  +            String name = param.getAttribute("name", null);
  +            String value = param.getAttribute("value", null);
  +            parameters.add(new Interpreter.Argument(name, value));
  +        }
  +
  +        try {
  +            // The continuation id should would need to be resolved at all
  +            // times, but who knows...
  +            if (VariableResolverFactory.needsResolve(continuationId)) {
  +                this.continuationIdResolver
  +                        = VariableResolverFactory.getResolver(continuationId, this.manager);
  +            }
  +        } catch (PatternException ex) {
  +            throw new ConfigurationException(ex.toString());
  +        }
  +    }
  +
  +    public void compose(ComponentManager manager) {
  +        this.manager = manager;
  +    }
  +
  +    public boolean invoke(Environment env, InvokeContext context)
  +            throws Exception
  +    {
  +        List params = null;
  +
  +        // Resolve parameters
  +        if (this.parameters != null)
  +            params = CallFunctionNode.resolveList(this.parameters, this.manager,
  +                                                  context, env.getObjectModel());
  +
  +        String contId = continuationId;
  +
  +        if (continuationIdResolver != null) {
  +            contId = continuationIdResolver.resolve(context, env.getObjectModel());
  +        }
  +
  +        InterpreterSelector selector
  +                = (InterpreterSelector)manager.lookup(Interpreter.ROLE);
  +
  +        // FIXME: How to detect the language associated with the
  +        // continuation object? Use the default language for now, but it
  +        // should be fixed ASAP.
  +        String language = selector.getDefaultLanguage();
  +
  +        // Obtain the Interpreter instance for this language
  +        Interpreter interpreter = (Interpreter)selector.select(language);
  +
  +        // Obtain the redirector
  +        // Redirector redirector = PipelinesNode.getRedirector(env);
  +
  +        env.setComponentManager(this.manager);
  +        try {
  +            interpreter.handleContinuation(contId, params, env /*, redirector*/);
  +        } finally {
  +            selector.release((Component)interpreter);
  +        }
   
  -    if (continuationIdResolver != null) {
  -      contId = continuationIdResolver.resolve(context, env.getObjectModel());
  +        return true;
       }
  -
  -    InterpreterSelector selector
  -      = (InterpreterSelector)manager.lookup(Interpreter.ROLE);
  -
  -    // FIXME: How to detect the language associated with the
  -    // continuation object? Use the default language for now, but it
  -    // should be fixed ASAP.
  -    String language = selector.getDefaultLanguage();
  -
  -    // Obtain the Interpreter instance for this language
  -    Interpreter interpreter = (Interpreter)selector.select(language);
  -    
  -    // Obtain the redirector
  -    Redirector redirector = PipelinesNode.getRedirector(env);
  -
  -    env.setComponentManager(this.manager);
  -    try {
  -      interpreter.handleContinuation(contId, params, env /*, redirector*/);
  -    }
  -    finally {
  -      selector.release((Component)interpreter);
  -    }
  -
  -    return true;
  -  }
   }
  
  
  
  1.8       +2 -5      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java
  
  Index: MatchNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MatchNode.java	5 Dec 2002 10:25:51 -0000	1.7
  +++ MatchNode.java	30 Jan 2003 05:00:13 -0000	1.8
  @@ -74,7 +74,7 @@
    */
   
   public class MatchNode extends SimpleSelectorProcessingNode
  -implements ParameterizableProcessingNode, Composable, Disposable {
  +        implements ParameterizableProcessingNode, Composable, Disposable {
   
       /** The 'pattern' attribute */
       private VariableResolver pattern;
  @@ -113,7 +113,6 @@
           // Perform any common invoke functionality 
           super.invoke(env, context);
   
  -        List mapStack = context.getMapStack();
           Map objectModel = env.getObjectModel();
   
           String resolvedPattern = pattern.resolve(context, objectModel);
  @@ -124,13 +123,11 @@
           if (this.threadSafeMatcher != null) {
               // Avoid select() and try/catch block (faster !)
               result = this.threadSafeMatcher.match(resolvedPattern, objectModel, resolvedParams);
  -
           } else {
               // Get matcher from selector
               Matcher matcher = (Matcher)this.selector.select(this.componentName);
               try {
                   result = matcher.match(resolvedPattern, objectModel, resolvedParams);
  -
               } finally {
                   this.selector.release(matcher);
               }
  
  
  
  1.10      +1 -6      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
  
  Index: MountNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MountNode.java	5 Dec 2002 10:25:51 -0000	1.9
  +++ MountNode.java	30 Jan 2003 05:00:13 -0000	1.10
  @@ -62,7 +62,6 @@
   
   import java.util.HashMap;
   import java.util.Iterator;
  -import java.util.List;
   import java.util.Map;
   
   /**
  @@ -70,7 +69,6 @@
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
    * @version CVS $Id$
    */
  -
   public class MountNode extends AbstractProcessingNode implements Composable {
   
       /** The 'uri-prefix' attribute */
  @@ -104,7 +102,6 @@
       public final boolean invoke(Environment env, InvokeContext context)
         throws Exception {
   
  -        List mapStack = context.getMapStack();
           Map objectModel = env.getObjectModel();
   
           String resolvedSource = this.source.resolve(context, objectModel);
  @@ -133,7 +130,6 @@
                   // Processor will create its own pipelines
                   return processor.process(env);
               }
  -
           } finally {
               // Restore context
               env.setContext(oldPrefix, oldURI);
  @@ -148,7 +144,6 @@
           TreeProcessor processor = (TreeProcessor)processors.get(source);
   
           if (processor == null) {
  -
               // Handle directory mounts
               String actualSource;
               if (source.charAt(source.length() - 1) == '/') {
  
  
  
  1.11      +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
  
  Index: SerializeNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SerializeNode.java	9 Jan 2003 18:20:19 -0000	1.10
  +++ SerializeNode.java	30 Jan 2003 05:00:13 -0000	1.11
  @@ -125,7 +125,6 @@
   
           ProcessingPipeline pipeline = context.getProcessingPipeline();
   
  -        List mapStack = context.getMapStack();
           Map objectModel = env.getObjectModel();
   
           pipeline.setSerializer(
  
  
  
  1.12      +0 -3      xml-cocoon2/src/java/org/apache/cocoon/components/validation/schematron/SchematronFactory.java
  
  Index: SchematronFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/validation/schematron/SchematronFactory.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SchematronFactory.java	15 Jan 2003 13:17:40 -0000	1.11
  +++ SchematronFactory.java	30 Jan 2003 05:00:13 -0000	1.12
  @@ -112,14 +112,12 @@
   		throws InstantiationException {
   		SchematronSchema schema = null;
   		try {
  -
   			// load Schema file into a DOM document
   			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
   			DocumentBuilder dbld = dbf.newDocumentBuilder();
   			Document document = dbld.parse(schemaSrc);
   
   			schema = buildSchema(document);
  -
   		} catch (Exception e) {
   			logger.error("!!! Failed loading Schematron schema", e);
   			throw new CascadingRuntimeException(
  @@ -136,7 +134,6 @@
   	 */
   	protected SchematronSchema buildSchema(Document doc) {
   		SchematronSchema schema = new SchematronSchema();
  -		boolean errors = false;
   
   		doc.getNamespaceURI();
   		doc.getPrefix();
  
  
  
  1.15      +35 -51    xml-cocoon2/src/java/org/apache/cocoon/components/xmlform/Form.java
  
  Index: Form.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xmlform/Form.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Form.java	17 Jan 2003 23:47:19 -0000	1.14
  +++ Form.java	30 Jan 2003 05:00:13 -0000	1.15
  @@ -90,7 +90,6 @@
    * @author michael_hampel@sonynetservices.com 
    * @version $Revision$ $Date$
    */
  -
   public class Form {
   
   	public static String SCOPE_REQUEST = "request";
  @@ -267,18 +266,17 @@
   	/**
   	 * Resolves a nodeset selector
   	 * into a list of concrete node locations
  -	 * @param xpath the nodeset selector
  +	 * @param xpathSelector the nodeset selector
   	 *
   	 * @return a Set of XPath strings pointing to 
   	 * each nodeset satisfying the nodeset selector
  -	 * 
  -	 * @todo the Collection return type should be replaced with a Set.
  +	 *
  +     * <p>
  +	 * TODO: the Collection return type should be replaced with a Set.
   	 * LinkedHashSet implementation should be used. All resolved 
   	 * nodes are unique in the resulting set, therefore Set is more appropriate.
   	 * Since LinkedHashSet is only available in JDK 1.4 or later, it is not
   	 * appropriate to make the change immediately.
  -	 *
  -	 *
   	 */
   	public Collection locate(String xpathSelector) {
   		if (model_ == null)
  @@ -302,7 +300,7 @@
   
   	/**
   	 *
  -	 * @param the validation phase
  +	 * @param phase the validation phase
   	 *
   	 * @return
   	 * if validation finishes without any violations, 
  @@ -332,18 +330,17 @@
   	}
   
   	/**
  -	 * <p>
  -	 *  Populates an HTML Form POST into the XMLForm model (JavaBean or DOM node).
  -	 *
  -	 *  Expects that all request parameter names are XPath expressions 
  -	 *  to attributes of the model.
  -	 *  For each request parameter, finds and assigns its value to the
  -	 *  JavaBean property corresponding to the parameter's name
  +	 * Populates an HTML Form POST into the XMLForm model (JavaBean or DOM node).
   	 *
  +     * <p>
  +	 * Expects that all request parameter names are XPath expressions
  +	 * to attributes of the model.
  +	 * For each request parameter, finds and assigns its value to the
  +	 * JavaBean property corresponding to the parameter's name
  +     * </p>
   	 *
  -	 *  @todo provide a more sophisticated examples with checkboxes, multi choice,
  -	 *  radio button, text area, file upload, etc.
  -	 * </p>
  +	 * TODO: provide a more sophisticated examples with checkboxes, multi choice,
  +	 * radio button, text area, file upload, etc.
   	 */
   	public void populate(Map sitemapObjectModel) {
   		// clean violations_ set
  @@ -399,7 +396,6 @@
   		if (violations_ != null) {
   			updateViolationsAsSortedSet();
   		}
  -
   	}
   
   	/**
  @@ -507,10 +503,10 @@
   	}
   
   	/**
  -	* filters custom request parameter
  -	* not refering to the model
  +	* Filters custom request parameter not refering to the model
   	*
  -	* @todo implement default filtering
  +    * <p>
  +	* TODO: implement default filtering
   	* for standard Cocoon parameters
   	* like cocoon-action[-suffix]
   	*
  @@ -557,14 +553,11 @@
   	 * and return the current form view
   	 */
   	public String getFormView(Map sitemapObjectModel) {
  -		Request request = getRequest(sitemapObjectModel);
  -		return (String) getRequest(sitemapObjectModel).getParameter(
  -			Form.FORM_VIEW_PARAM);
  +		return getRequest(sitemapObjectModel).getParameter(Form.FORM_VIEW_PARAM);
   	}
   
   	/**
  -	 *
  -	 * This method is called before 
  +	 * This method is called before
   	 * the form is populated with request parameters.
   	 *
   	 * Semantically similar to that of the 
  @@ -575,7 +568,6 @@
   	 * not checked.
   	 *
   	 * Calls reset on all FormListeners
  -	 *
   	 */
   	protected void reset() {
   		// notify FormListeners
  @@ -592,7 +584,7 @@
   	/**
   	 * Loads a form from the request or session
   	 *
  -	 * @param objectMap
  +	 * @param sitemapObjectModel
   	 * @param id the form id
   	 */
   	public static Form lookup(Map sitemapObjectModel, String id) {
  @@ -615,7 +607,7 @@
   	 * and session to ensure that a subsequent 
   	 * Form.lookup will not succeed.
   	 *
  -	 * @param objectMap
  +	 * @param sitemapObjectModel
   	 * @param id the form id
   	 */
   	public static void remove(Map sitemapObjectModel, String id) {
  @@ -630,8 +622,8 @@
   	/**
   	 * Saves the form in the request or session
   	 *
  -	 * @param objectMap 
  -	 * @param isSessionScope if true the form will be bound in the session, otherwise request
  +	 * @param sitemapObjectModel
  +	 * @param scope if true the form will be bound in the session, otherwise request
   	 */
   	public void save(Map sitemapObjectModel, String scope) {
   		Request request = getRequest(sitemapObjectModel);
  @@ -730,7 +722,7 @@
   		FormViewState formViewState =
   			(FormViewState) viewStateMap_.get(viewName);
   		if (formViewState == null) {
  -			formViewState = new FormViewState(viewName);
  +			formViewState = new FormViewState();
   			viewStateMap_.put(viewName, formViewState);
   		}
   		return formViewState;
  @@ -740,38 +732,30 @@
   	 * Internal class used for keeping state information
   	 * during the life cycle of a form.
   	 * 
  -	 * Used only for session scoped forms
  -	 * 
  +	 * <p>Used only for session scoped forms
   	 */
   	class FormViewState {
  +        private Map modelReferences_ = new HashMap();
   
  -		FormViewState(String viewName) {
  -			viewName_ = viewName;
  -		}
  +		FormViewState() {
  +        }
   
   		/**
   		 * 
   		 * @return Map of (String modelPropertyReference, String inputType) pairs 
  -		 * 
   		 */
   		Map getModelReferenceMap() {
   			return modelReferences_;
   		}
   
  -		void addModelReferenceAndInputType(
  -			String modelPropertyReference,
  -			String inputType) {
  -			modelReferences_.put(modelPropertyReference, inputType);
  +		void addModelReferenceAndInputType(String modelPropertyReference,
  +                                           String inputType) {
  +            modelReferences_.put(modelPropertyReference, inputType);
   		}
   
   		void clear() {
   			modelReferences_.clear();
   		}
  -
  -		private Map modelReferences_ = new HashMap();
  -
  -		private String viewName_;
  -
   	}
   
   	/** the set of violations the model commited during validation */
  @@ -792,8 +776,9 @@
   	/** 
   	 * The unique identifier for this form. Used when form is stored in request 
   	 * or session for reference by other components
  -	 *
  -	 * @todo a centralized form registry would be helpful to prevent from id collision
  +     *
  +	 * <p>
  +	 * TODO: a centralized form registry would be helpful to prevent from id collision
   	 */
   	private String id_ = null;
   
  @@ -816,5 +801,4 @@
   	 * 
   	 */
   	private Map viewStateMap_ = new HashMap();
  -
   }
  
  
  
  1.6       +10 -11    xml-cocoon2/src/java/org/apache/cocoon/generation/MP3DirectoryGenerator.java
  
  Index: MP3DirectoryGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/MP3DirectoryGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MP3DirectoryGenerator.java	5 Dec 2002 10:32:57 -0000	1.5
  +++ MP3DirectoryGenerator.java	30 Jan 2003 05:00:13 -0000	1.6
  @@ -84,18 +84,15 @@
   {
       // MP3 Constants
       private static final int VERSION_MPEG1       = 3;
  -    private static final int VERSION_MPEG2       = 2;
  +    // private static final int VERSION_MPEG2       = 2;
       private static final int MODE_DUAL_CHANNEL   = 2;
       private static final int MODE_JOINT_STEREO   = 1;
       private static final int MODE_SINGLE_CHANNEL = 3;
       private static final int MODE_STEREO         = 0;
  -    private static final int BITRATE_441         = 0;
  -    private static final int BITRATE_48          = 1;
  -    private static final int BITRATE_32          = 2;
       private static final int VBR_FRAMES_FLAG     = 1;
  -    private static final int VBR_BYTES_FLAG      = 2;
  -    private static final int VBR_TOC_FLAG        = 4;
  -    private static final int VBR_SCALE_FLAG      = 8;
  +    // private static final int VBR_BYTES_FLAG      = 2;
  +    // private static final int VBR_TOC_FLAG        = 4;
  +    // private static final int VBR_SCALE_FLAG      = 8;
   
       // Attributes
       protected static String MP3_FREQUENCY_ATTR_NAME = "frequency";
  @@ -192,12 +189,14 @@
   
           int version = (header >>> 19) & 3;
           int layer = 4 - (header >>> 17) & 3;
  -        int protection = (header >>> 16) & 1;
  +        // int protection = (header >>> 16) & 1;
           int bitrate = (header >>> 12) & 0xF;
           int frequency = (header >>> 10) & 3;
           // Value 3 is reserved
  -        if (frequency == 3) return;
  -        int padding = (header >>> 9) & 1;
  +        if (frequency == 3) {
  +            return;
  +        }
  +        // int padding = (header >>> 9) & 1;
           int mode = ((header >>> 6) & 3);
   
           attributes.addAttribute("", MP3_FREQUENCY_ATTR_NAME, MP3_FREQUENCY_ATTR_NAME, "CDATA",
  
  
  
  1.17      +8 -34     xml-cocoon2/src/java/org/apache/cocoon/i18n/XMLResourceBundle.java
  
  Index: XMLResourceBundle.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/i18n/XMLResourceBundle.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XMLResourceBundle.java	22 Jan 2003 05:19:18 -0000	1.16
  +++ XMLResourceBundle.java	30 Jan 2003 05:00:14 -0000	1.17
  @@ -64,6 +64,7 @@
   
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.logger.Logger;
   
   import org.apache.excalibur.xml.xpath.XPathProcessor;
  @@ -79,7 +80,6 @@
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  -
   /**
    * Implementation of <code>Bundle</code> interface for XML resources. Represents a single XML message bundle.
    *
  @@ -87,12 +87,13 @@
    * @author <a href="mailto:neeme@one.lv">Neeme Praks</a>
    * @author <a href="mailto:oleg@one.lv">Oleg Podolsky</a>
    * @author <a href="mailto:mattam@netcourrier.com">Matthieu Sozeau</a>
  - * @author <a href="mailto:kpiroumian@apache.org">Konstantin Piroumian</a> $Id: XMLResourceBundle.java,v 1.13
  - *         2003/01/07 23:56:12 giacomo Exp $
  + * @author <a href="mailto:kpiroumian@apache.org">Konstantin Piroumian</a>
  + * @version $Id$
    */
   public class XMLResourceBundle
       extends ResourceBundle
       implements Bundle {
  +
       /** DOM factory */
       protected static DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
   
  @@ -133,15 +134,14 @@
       public void compose(ComponentManager manager)
           throws ComponentException {
           this.manager = manager;
  -        this.processor = (XPathProcessor)this.manager.lookup(XPathProcessor.ROLE);
  +        this.processor = (XPathProcessor) this.manager.lookup(XPathProcessor.ROLE);
       }
   
       /**
        * Implements Disposable interface for this class.
        */
       public void dispose() {
  -        // FIXME (KP): How to release the XPathProcessor?
  -        // this.manager.release(this.processor);
  +        this.manager.release((Component) this.processor);
           this.processor = null;
       }
   
  @@ -197,6 +197,7 @@
        */
       protected synchronized Document loadResourceBundle(String fileName)
           throws IOException, ParserConfigurationException, SAXException {
  +
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           DocumentBuilder builder = factory.newDocumentBuilder();
           Source source = null;
  @@ -246,21 +247,6 @@
       }
   
       /**
  -     * Does the &quot;key-cache&quot; contain the value with such key?
  -     *
  -     * @param key the key to the value to be returned
  -     *
  -     * @return true if contains, false otherwise
  -     */
  -    private boolean cacheContains(String key) {
  -        if (logger.isDebugEnabled()) {
  -            logger.debug(name + ": cache contains: " + key);
  -        }
  -
  -        return cache.containsKey(key);
  -    }
  -
  -    /**
        * Does the &quot;key-not-found-cache&quot; contain such key?
        *
        * @param key the key to the value to be returned
  @@ -350,7 +336,6 @@
   
                   if (attrs != null) {
                       Node temp = null;
  -                    String pathToAttr = null;
                       int attrnum = attrs.getLength();
   
                       for (int j = 0; j < attrnum; j++) {
  @@ -386,7 +371,7 @@
   
           Node value = getFromCache(key);
   
  -        if ((value == null) && !cacheNotFoundContains(key)) {
  +        if (value == null && !cacheNotFoundContains(key)) {
               if (doc != null) {
                   value = (Node)_getObject(this.doc.getDocumentElement(), key);
               }
  @@ -417,17 +402,6 @@
        */
       private Object _getObject(Node node, String key) {
           return _getNode(node, key);
  -    }
  -
  -    /**
  -     * Get the node with the supplied XPath key.
  -     *
  -     * @param key the key
  -     *
  -     * @return the node
  -     */
  -    private Node _getNode(String key) {
  -        return _getNode(this.doc.getDocumentElement(), key);
       }
   
       /**
  
  
  
  1.4       +223 -251  xml-cocoon2/src/java/org/apache/cocoon/transformation/helpers/MirrorRecorder.java
  
  Index: MirrorRecorder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/helpers/MirrorRecorder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MirrorRecorder.java	5 Dec 2002 10:01:04 -0000	1.3
  +++ MirrorRecorder.java	30 Jan 2003 05:00:14 -0000	1.4
  @@ -68,7 +68,6 @@
    * @author <a href="mailto:mattam@netcourrier.com">Matthieu Sozeau</a>
    * @version CVS $Id$
    */
  -
   public class MirrorRecorder
       extends NOPRecorder
       implements EventRecorder, Cloneable {
  @@ -76,298 +75,271 @@
       private ArrayList events;
   
       // Used for indexing (parameters)
  -    class NullEvent
  -	implements EventRecorder
  -    {
  -	private String s;
  -	public NullEvent(String s)
  -	    {
  -		this.s = s;
  -	    }
  +    class NullEvent implements EventRecorder {
  +        private String s;
  +
  +        public NullEvent(String s) {
  +            this.s = s;
  +        }
   
  -	public String name() {
  -	    return s;
  -	}
  +        public String name() {
  +            return s;
  +        }
   
  -	public void send(ContentHandler handler)
  -	    throws SAXException
  -	    { }
  +        public void send(ContentHandler handler)
  +                throws SAXException
  +        { }
   
   
  -	public Object clone() {
  -	    return new NullEvent(s);
  -	}
  +        public Object clone() {
  +            return new NullEvent(s);
  +        }
   
  -	public String toString() {
  -	    return("{" + s + "}");
  -	}
  +        public String toString() {
  +            return "{" + s + "}";
  +        }
       }
   
  -    class StartEvent
  -	implements EventRecorder
  -    {
  -	protected String uri, name, raw;
  -	protected Attributes attr;
  +    class StartEvent implements EventRecorder {
  +        protected String uri, name, raw;
  +        protected Attributes attr;
  +
  +        public StartEvent(String namespace, String name, String raw,
  +                          Attributes attr)
  +        {
  +            this.uri = namespace;
  +            this.name = name;
  +            this.raw = raw;
  +            this.attr = attr;
  +        }
  +
  +        public void send(ContentHandler handler)
  +                throws SAXException {
  +            handler.startElement(uri, name, raw, attr);
  +        }
   
  -	public StartEvent(String namespace, String name, String raw,
  -			  Attributes attr)
  -	    {
  -		this.uri = namespace;
  -		this.name = name;
  -		this.raw = raw;
  -		this.attr = attr;
  -	    }
  -
  -	public void send(ContentHandler handler)
  -	    throws SAXException
  -	    {
  -		handler.startElement(uri, name, raw, attr);
  -	    }
  -
  -	public Object clone() {
  -	    return new StartEvent(uri, name, raw, new AttributesImpl(attr));
  -	}
  -
  -	public String toString() {
  -	    StringBuffer str = new StringBuffer("<" + raw);
  -	    if(attr != null) {
  -		for(int i = 0; i < attr.getLength(); ++i)
  -		    str.append(" " + attr.getQName(i) + "=\"" + attr.getValue(i) + "\"");
  -	    }
  +        public Object clone() {
  +            return new StartEvent(uri, name, raw, new AttributesImpl(attr));
  +        }
   
  -	    return str.append(">").toString();
  -	}
  +        public String toString() {
  +            StringBuffer str = new StringBuffer("<" + raw);
  +            if(attr != null) {
  +                for(int i = 0; i < attr.getLength(); ++i)
  +                    str.append(" " + attr.getQName(i) + "=\"" + attr.getValue(i) + "\"");
  +            }
  +
  +            return str.append(">").toString();
  +        }
       }
   
  -    class EndEvent
  -	implements EventRecorder
  +    class EndEvent implements EventRecorder
       {
  -	protected String uri, name, raw;
  -
  -	public EndEvent(String namespace, String name, String raw) {
  -	    this.uri = namespace;
  -	    this.name = name;
  -	    this.raw = raw;
  -	}
  -
  -	public Object clone() {
  -	    return new EndEvent(uri, name, raw);
  -	}
  -
  -	public void send(ContentHandler handler)
  -	    throws SAXException
  -	    {
  -		handler.endElement(uri, name, raw);
  -	    }
  -	public String toString() {
  -	    return("</" + raw + ">");
  +        protected String uri, name, raw;
   
  -	}
  +        public EndEvent(String namespace, String name, String raw) {
  +            this.uri = namespace;
  +            this.name = name;
  +            this.raw = raw;
  +        }
  +
  +        public Object clone() {
  +            return new EndEvent(uri, name, raw);
  +        }
  +
  +        public void send(ContentHandler handler)
  +                throws SAXException
  +        {
  +            handler.endElement(uri, name, raw);
  +        }
  +
  +        public String toString() {
  +            return "</" + raw + ">";
  +        }
       }
   
  -    class CharacterEvent
  -	implements EventRecorder
  +    class CharacterEvent implements EventRecorder
       {
  -	private String ch;
  +        private String ch;
   
  -	public CharacterEvent(char ary[], int start, int length) {
  -	    ch = new String(ary, start, length);
  -	}
  -
  -	public Object clone() {
  -	    return new CharacterEvent(ch.toCharArray(), 0, ch.length());
  -	}
  -
  -	public CharacterEvent(String str)
  -	    {
  -		ch = str;
  -	    }
  -
  -	public void send(ContentHandler handler)
  -	    throws SAXException
  -	    {
  -		handler.characters(ch.toCharArray(), 0, ch.length());
  -	    }
  -
  -	public String toString() {
  -	    return ch;
  -	}
  +        public CharacterEvent(char ary[], int start, int length) {
  +            ch = new String(ary, start, length);
  +        }
  +
  +        public Object clone() {
  +            return new CharacterEvent(ch.toCharArray(), 0, ch.length());
  +        }
  +
  +        public CharacterEvent(String str)
  +        {
  +            ch = str;
  +        }
  +
  +        public void send(ContentHandler handler)
  +                throws SAXException
  +        {
  +            handler.characters(ch.toCharArray(), 0, ch.length());
  +        }
  +
  +        public String toString() {
  +            return ch;
  +        }
       }
   
       public MirrorRecorder() {
  -	this.events = new ArrayList();
  +        this.events = new ArrayList();
       }
   
       public MirrorRecorder(Node n) {
  -	this.events = new ArrayList();
  +        this.events = new ArrayList();
   
  -	if(n != null)
  -	{
  -	    NodeList childs = n.getChildNodes();
  -	    for(int i = 0; i < childs.getLength(); ++i)
  -	    {
  -		try {
  -		    nodeToEvents(childs.item(i));
  -		} catch(SAXException e) {
  -		    //FIXME: what to do?
  -		}
  -	    }
  -	}
  -    }
  -
  -    private void nodeToEvents(Node n)
  -	throws SAXException {
  -	Attributes attrs;
  -
  -	switch(n.getNodeType()) {
  -	case Node.ELEMENT_NODE:
  -	    if(n.getAttributes() instanceof AttributeMap)
  -	    {
  -		NamedNodeMap map = n.getAttributes();
  -		Node node;
  -		attrs = new AttributesImpl();
  -
  -		for(int i = 0; i < map.getLength(); ++i)
  -		{
  -		    node = map.item(i);
  -		    ((AttributesImpl) attrs).addAttribute(node.getNamespaceURI(), node.getLocalName(), node.getNodeName(), "CDATA", node.getNodeValue());
  -		}
  -	    }
  -	    else
  -		attrs = (Attributes) n.getAttributes();
  -
  -	    startElement(n.getNamespaceURI(), n.getNodeName(), n.getNodeName(), attrs);
  -	    if(n.hasChildNodes()) {
  -		NodeList childs = n.getChildNodes();
  -		for(int i = 0; i < childs.getLength(); ++i)
  -		{
  -		    nodeToEvents(childs.item(i));
  -		}
  -	    }
  -	    endElement(n.getNamespaceURI(), n.getNodeName(), n.getNodeName());
  -	    break;
  -	case Node.TEXT_NODE:
  -	    characters(n.getNodeValue());
  -	    break;
  -	}
  +        if(n != null) {
  +            NodeList childs = n.getChildNodes();
  +            for(int i = 0; i < childs.getLength(); ++i) {
  +                try {
  +                    nodeToEvents(childs.item(i));
  +                } catch (SAXException e) {
  +                    // FIXME: what to do?
  +                }
  +            }
  +        }
  +    }
  +
  +    private void nodeToEvents(Node n) throws SAXException {
  +        Attributes attrs;
  +
  +        switch(n.getNodeType()) {
  +            case Node.ELEMENT_NODE:
  +                if(n.getAttributes() instanceof AttributeMap) {
  +                    NamedNodeMap map = n.getAttributes();
  +                    Node node;
  +                    attrs = new AttributesImpl();
  +
  +                    for(int i = 0; i < map.getLength(); ++i) {
  +                        node = map.item(i);
  +                        ((AttributesImpl) attrs).addAttribute(node.getNamespaceURI(),
  +                                                              node.getLocalName(),
  +                                                              node.getNodeName(),
  +                                                              "CDATA",
  +                                                              node.getNodeValue());
  +                    }
  +                } else {
  +                    attrs = (Attributes) n.getAttributes();
  +                }
  +                startElement(n.getNamespaceURI(), n.getNodeName(), n.getNodeName(), attrs);
  +                if (n.hasChildNodes()) {
  +                    NodeList childs = n.getChildNodes();
  +                    for(int i = 0; i < childs.getLength(); ++i) {
  +                        nodeToEvents(childs.item(i));
  +                    }
  +                }
  +                endElement(n.getNamespaceURI(), n.getNodeName(), n.getNodeName());
  +                break;
  +            case Node.TEXT_NODE:
  +                characters(n.getNodeValue());
  +                break;
  +        }
       }
   
       public MirrorRecorder(MirrorRecorder n) {
  -	this.events = new ArrayList();
  -	for(int i = 0; i < n.events.size(); ++i)
  -	{
  -	    EventRecorder e = (EventRecorder) n.events.get(i);
  -	    this.events.add(e.clone());
  -	}
  +        this.events = new ArrayList();
  +        for(int i = 0; i < n.events.size(); ++i) {
  +            EventRecorder e = (EventRecorder) n.events.get(i);
  +            this.events.add(e.clone());
  +        }
       }
   
       public Object clone() {
  -	return new MirrorRecorder(this);
  +        return new MirrorRecorder(this);
       }
   
       public void startElement(String namespace, String name, String raw,
  -                         Attributes attr)
  -    throws SAXException {
  -	events.add(new StartEvent(namespace, name, raw, attr));
  +                             Attributes attr)
  +            throws SAXException {
  +        events.add(new StartEvent(namespace, name, raw, attr));
       }
   
       public void endElement(String namespace, String name, String raw)
  -    throws SAXException {
  -	events.add(new EndEvent(namespace, name, raw));
  +            throws SAXException {
  +        events.add(new EndEvent(namespace, name, raw));
       }
   
       public void characters(char ary[], int start, int length)
  -    throws SAXException {
  -	characters(new String(ary, start, length));
  +            throws SAXException {
  +        characters(new String(ary, start, length));
       }
   
  -    public void characters(String tmp)
  -	throws SAXException {
  -	int i = 0, j = 0, index = 0;
  -
  -	while(tmp.length() > 0) {
  -
  -	    i = tmp.indexOf('{', i);
  -	    if(i == -1)
  -	    {
  -		events.add(new CharacterEvent(tmp));
  -		return;
  -	    }
  -	    else
  -	    {
  -		if(i >= 0) {
  -		    events.add(new CharacterEvent(tmp.substring(0, i)));
  -		}
  -
  -		j = tmp.indexOf('}', i);
  -		if(j != -1) {
  -		    events.add(new NullEvent(tmp.substring(i + 1, j)));
  -		    tmp = tmp.substring(j + 1, tmp.length());
  -		    i = 0;
  -		}
  -	    }
  -	}
  -    }
  -
  -    public void send(ContentHandler handler)
  -	throws SAXException
  -	{
  -	    for(int i = 0; i < events.size(); ++i)
  -	    {
  -		((EventRecorder) (events.get(i))).send(handler);
  -	    }
  -	}
  -
  -    public void send(ContentHandler handler, Map params)
  -	throws SAXException
  -	{
  -	    int id;
  -	    EventRecorder param;
  -
  -	    for(int i = 0; i < events.size(); ++i)
  -	    {
  -		if(events.get(i) instanceof NullEvent) {
  -		    param = (EventRecorder) params.get(((NullEvent) events.get(i)).name());
  -		    if(param != null)
  -			param.send(handler);
  -		}
  -		else ((EventRecorder) (events.get(i))).send(handler);
  -	    }
  -	}
  +    public void characters(String tmp) throws SAXException {
  +        int i = 0, j = 0;
  +
  +        while(tmp.length() > 0) {
  +            i = tmp.indexOf('{', i);
  +            if(i == -1) {
  +                events.add(new CharacterEvent(tmp));
  +                return;
  +            } else {
  +                if(i >= 0) {
  +                    events.add(new CharacterEvent(tmp.substring(0, i)));
  +                }
  +
  +                j = tmp.indexOf('}', i);
  +                if(j != -1) {
  +                    events.add(new NullEvent(tmp.substring(i + 1, j)));
  +                    tmp = tmp.substring(j + 1, tmp.length());
  +                    i = 0;
  +                }
  +            }
  +        }
  +    }
  +
  +    public void send(ContentHandler handler) throws SAXException {
  +        for(int i = 0; i < events.size(); ++i) {
  +            ((EventRecorder) (events.get(i))).send(handler);
  +        }
  +    }
  +
  +    public void send(ContentHandler handler, Map params) throws SAXException
  +    {
  +        EventRecorder param;
  +
  +        for(int i = 0; i < events.size(); ++i) {
  +            if(events.get(i) instanceof NullEvent) {
  +                param = (EventRecorder) params.get(((NullEvent) events.get(i)).name());
  +                if(param != null)
  +                    param.send(handler);
  +            } else {
  +                ((EventRecorder) (events.get(i))).send(handler);
  +            }
  +        }
  +    }
   
       public String text() {
  -	StringBuffer s = new StringBuffer();
  +        StringBuffer s = new StringBuffer();
  +
  +        for(int i = 0; i < events.size(); ++i) {
  +            s.append(events.get(i).toString());
  +        }
  +        return(s.toString());
  +    }
   
  -	for(int i = 0; i < events.size(); ++i)
  -	{
  -	    s.append(events.get(i).toString());
  -	}
  -	return(s.toString());
  -    }
  -
  -    public String toString()
  -	{
  -	    StringBuffer s = new StringBuffer("MirrorRecorder: ");
  -	    s.append(String.valueOf(events.size()) + " event(s)");
  -	    s.append("\ntext: ");
  -	    for(int i = 0; i < events.size(); ++i)
  -	    {
  -		if(events.get(i) instanceof CharacterEvent) {
  -		    s.append(events.get(i).toString());
  -		}
  -	    }
  -
  -	    return s.toString();
  -	}
  -
  -    public void recycle()
  -	{
  -	    events.clear();
  -	}
  -
  -    public boolean empty()
  -	{
  -	    return (events.size() == 0);
  -	}
  +    public String toString() {
  +        StringBuffer s = new StringBuffer("MirrorRecorder: ");
  +        s.append(String.valueOf(events.size()) + " event(s)");
  +        s.append("\ntext: ");
  +        for(int i = 0; i < events.size(); ++i) {
  +            if(events.get(i) instanceof CharacterEvent) {
  +                s.append(events.get(i).toString());
  +            }
  +        }
   
  +        return s.toString();
  +    }
  +
  +    public void recycle() {
  +        events.clear();
  +    }
  +
  +    public boolean empty() {
  +        return events.size() == 0;
  +    }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message