You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ha...@apache.org on 2004/02/15 20:08:53 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/modules/input ModuleHolder.java ChainMetaModule.java

haul        2004/02/15 11:08:53

  Modified:    src/java/org/apache/cocoon/components/modules/input
                        ChainMetaModule.java
  Added:       src/java/org/apache/cocoon/components/modules/input
                        ModuleHolder.java
  Log:
  move ModuleHolder up from nested
  handle empty configuration similar to not existing configuration
  
  Revision  Changes    Path
  1.2       +3 -9      cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/ChainMetaModule.java
  
  Index: ChainMetaModule.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/ChainMetaModule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ChainMetaModule.java	9 Mar 2003 00:09:02 -0000	1.1
  +++ ChainMetaModule.java	15 Feb 2004 19:08:53 -0000	1.2
  @@ -99,12 +99,6 @@
    */
   public class ChainMetaModule extends AbstractMetaModule implements ThreadSafe {
   
  -    class ModuleHolder {
  -        public String name = null;
  -        public InputModule input = null;
  -        public Configuration config = null;
  -    }
  -
       private ModuleHolder[] inputs = null;
   
       private boolean emptyAsNull = false;
  @@ -189,7 +183,7 @@
           Configuration[] inputConfigs = null;
           boolean allValues = this.allValues;
           boolean emptyAsNull = this.emptyAsNull;
  -        if (modeConf!=null) {
  +        if (modeConf!=null && modeConf.getChildren().length > 0) {
               inputConfigs = modeConf.getChildren("input-module");
               emptyAsNull = modeConf.getChild("empty-as-null").getValueAsBoolean(emptyAsNull);
               allValues = modeConf.getChild("all-values").getValueAsBoolean(allValues);
  @@ -253,7 +247,7 @@
           Configuration[] inputConfigs = null;
           boolean emptyAsNull = this.emptyAsNull;
           boolean allNames = this.allNames;
  -        if (modeConf!=null) {
  +        if (modeConf!=null && modeConf.getChildren().length > 0) {
               inputConfigs = modeConf.getChildren("input-module");
               emptyAsNull = modeConf.getChild("empty-as-null").getValueAsBoolean(emptyAsNull);
               allNames = modeConf.getChild("all-names").getValueAsBoolean(allNames);
  
  
  
  1.1                  cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/ModuleHolder.java
  
  Index: ModuleHolder.java
  ===================================================================
  /*
   * Copyright 2003 BASF IT Services
   * All rights reserved.
   * 
   * Created on 14.12.2003
   */
  package org.apache.cocoon.components.modules.input;
  
  import org.apache.avalon.framework.configuration.Configuration;
  
  /**
   * @author <a href="mailto:christian.haul@basf-it-services.com">Christian Haul</a>
   * @version CVS $Id: ModuleHolder.java,v 1.1 2004/02/15 19:08:53 haul Exp $
   */
  public class ModuleHolder {
  
      public String name = null;
      public InputModule input = null;
      public Configuration config = null;
  
      public ModuleHolder() {
          super();
      }
  
      public ModuleHolder(String name, Configuration config) {
          this();
          this.name = name;
          this.config = config;
      }
      
      public ModuleHolder(String name, Configuration config, InputModule input) {
          this(name, config);
          this.input = input;
      }
  
  }