You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/08/01 18:32:24 UTC

svn commit: r561864 - /webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java

Author: dims
Date: Wed Aug  1 09:32:22 2007
New Revision: 561864

URL: http://svn.apache.org/viewvc?view=rev&rev=561864
Log:
fix broken support for prettifying the wsdl2java generated java code. svn revision 557218 totally broke this support as it assumed that the base classes's prettify was called only for xml files

Modified:
    webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java

Modified: webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java?view=diff&rev=561864&r1=561863&r2=561864
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java (original)
+++ webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java Wed Aug  1 09:32:22 2007
@@ -19,6 +19,7 @@
 package org.apache.axis2.wsdl.codegen.extension;
 
 import org.apache.axis2.util.PrettyPrinter;
+import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
 
 import java.io.File;
 
@@ -31,6 +32,24 @@
         * well !!!
         */
         fileExtension = ".java";
+    }
+
+    /**
+     * Recursive procedure to prettify the files
+     *
+     * @param file
+     */
+    protected void prettify(File file, CodeGenConfiguration configuration) {
+        if (file.isFile() &&
+                file.exists() &&
+                file.getName().toLowerCase().endsWith(fileExtension)) {
+            prettifyFile(file);
+        } else if (file.isDirectory()) {
+            File[] childFiles = file.listFiles();
+            for (int i = 0; i < childFiles.length; i++) {
+                prettify(childFiles[i], configuration);
+            }
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org