You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2002/06/25 09:55:13 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/variables PreparedVariableResolver.java

sylvain     2002/06/25 00:55:13

  Modified:    src/java/org/apache/cocoon/components/treeprocessor
                        AbstractProcessingNodeBuilder.java
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        MatchNodeBuilder.java SelectNodeBuilder.java
               src/java/org/apache/cocoon/components/treeprocessor/variables
                        PreparedVariableResolver.java
  Log:
  Fix : ProcessingNodeBuilders must be *Re*composable. This is now implemented by AbstractProcessingNodeBuilder, which will avoid to forget it.
  
  Revision  Changes    Path
  1.5       +7 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
  
  Index: AbstractProcessingNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractProcessingNodeBuilder.java	24 Jun 2002 20:32:18 -0000	1.4
  +++ AbstractProcessingNodeBuilder.java	25 Jun 2002 07:55:13 -0000	1.5
  @@ -52,7 +52,7 @@
   
   import org.apache.avalon.framework.logger.AbstractLoggable;
   
  -import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.component.Recomposable;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -75,13 +75,17 @@
   
   
   public abstract class AbstractProcessingNodeBuilder extends AbstractLoggable
  -  implements ProcessingNodeBuilder, Composable {
  +  implements ProcessingNodeBuilder, Recomposable {
   
       protected TreeBuilder treeBuilder;
       
       protected ComponentManager manager;
   
       public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
  +    }
  +
  +    public void recompose(ComponentManager manager) throws ComponentException {
           this.manager = manager;
       }
   
  
  
  
  1.6       +2 -14     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNodeBuilder.java
  
  Index: MatchNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNodeBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MatchNodeBuilder.java	24 Jun 2002 20:32:19 -0000	1.5
  +++ MatchNodeBuilder.java	25 Jun 2002 07:55:13 -0000	1.6
  @@ -50,9 +50,7 @@
   */
   package org.apache.cocoon.components.treeprocessor.sitemap;
   
  -import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.Recomposable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.thread.ThreadSafe;
  @@ -74,19 +72,9 @@
    */
   
   public class MatchNodeBuilder extends AbstractParentProcessingNodeBuilder
  -  implements Recomposable, ThreadSafe {
  +  implements ThreadSafe {
   
       private static final String SELECTOR_ROLE = Matcher.ROLE + "Selector";
  -
  -    private ComponentManager manager;
  -
  -    public void compose(ComponentManager manager) {
  -        this.manager = manager;
  -    }
  -
  -    public void recompose(ComponentManager manager) {
  -        this.manager = manager;
  -    }
   
       public ProcessingNode buildNode(Configuration config) throws Exception {
   
  
  
  
  1.5       +2 -15     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNodeBuilder.java
  
  Index: SelectNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNodeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SelectNodeBuilder.java	24 Jun 2002 20:32:19 -0000	1.4
  +++ SelectNodeBuilder.java	25 Jun 2002 07:55:13 -0000	1.5
  @@ -64,9 +64,6 @@
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolverFactory;
   
   import java.util.*;
  -import org.apache.avalon.framework.component.Recomposable;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.ComponentException;
   
   /**
    *
  @@ -74,19 +71,9 @@
    * @version CVS $Id$
    */
   
  -public class SelectNodeBuilder extends AbstractParentProcessingNodeBuilder implements ThreadSafe, Recomposable {
  +public class SelectNodeBuilder extends AbstractParentProcessingNodeBuilder {
   
       private static final String SELECTOR_ROLE = Selector.ROLE + "Selector";
  -
  -    private ComponentManager manager;
  -
  -    public void compose(ComponentManager manager) {
  -        this.manager = manager;
  -    }
  -
  -    public void recompose(ComponentManager manager) {
  -        this.manager = manager;
  -    }
   
       public ProcessingNode buildNode(Configuration config) throws Exception {
   
  
  
  
  1.2       +0 -22     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java
  
  Index: PreparedVariableResolver.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PreparedVariableResolver.java	24 Jun 2002 20:32:20 -0000	1.1
  +++ PreparedVariableResolver.java	25 Jun 2002 07:55:13 -0000	1.2
  @@ -305,26 +305,4 @@
           this.selector = null;
           this.manager = null;
       }
  -    
  -//        public void dump() {
  -//            System.out.println(this.originalExpr + " compiled in :");
  -//            for (int i = 0; i < this.strings.length; i++) {
  -//                System.out.print("[" + this.levels[i] + ":'" + this.strings[i] + "'] ");
  -//            }
  -//            System.out.println();
  -//            System.out.println();
  -//        }
  -//
  -//    public static void main(String [] args) throws Exception {
  -//
  -//        new PreparedVariableResolver("&{../../blah}").dump();
  -//        new PreparedVariableResolver("{t1}tt{t2}x").dump();
  -//        new PreparedVariableResolver("\\{t1}tt{t2}xx").dump();
  -//        new PreparedVariableResolver("{t1}tt\\{t2}xx").dump();
  -//        new PreparedVariableResolver("{t1}tt{t2}xx").dump();
  -//        new PreparedVariableResolver("xx{../t1}{../../../t2}zz").dump();
  -//        new PreparedVariableResolver("xx{../t1}\\{../../../t2}zz").dump();
  -//
  -//    }
  -
   }
  
  
  

----------------------------------------------------------------------
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