You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by tc...@apache.org on 2002/03/26 20:58:10 UTC

cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/precept ConfigurationHelper.java

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 <tc...@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