cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/precept ConfigurationHelper.java
Date Tue, 26 Mar 2002 19:58:10 GMT
tcurdt      02/03/26 11:58:10

  Added:       src/scratchpad/src/org/apache/cocoon/precept
                        ConfigurationHelper.java
  Log:
  added for debugging
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/precept/ConfigurationHelper.java
  
  Index: ConfigurationHelper.java
  ===================================================================
  /*
   * @version: Mar 26, 2002
   * @author: Torsten Curdt <tcurdt@dff.st>
   */
  package org.apache.cocoon.precept;
  
  import org.apache.avalon.framework.configuration.Configuration;
  
  public class ConfigurationHelper {
    public final static String toString( Configuration conf ) {
      String result = "<" + conf.getName();
  
      String[] attributes = conf.getAttributeNames();
      for(int i=0;i<attributes.length;i++) {
        try {
          result += " " + attributes[i] + "=\"" + conf.getAttribute(attributes[i]) + "\"";
        }
        catch(Throwable t) {
        }
      }
  
      result += ">";
  
      try {
        result += conf.getValue();
      }
      catch(Throwable t) {
      }
  
      Configuration[] childs = conf.getChildren();
      for(int i=0;i<childs.length;i++) {
        Configuration child = childs[i];
        result += toString(child);
      }
  
      return(result + "</" + conf.getName() + ">");
    }
  }
  
  
  

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