axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r809759 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen: ./ emitter/ extension/
Date Mon, 31 Aug 2009 21:50:11 GMT
Author: veithen
Date: Mon Aug 31 21:50:11 2009
New Revision: 809759

URL: http://svn.apache.org/viewvc?rev=809759&view=rev
Log:
AXIS2-4477: Let the code generator track all output files, so that we can limit pretty printing
to generated files.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractPrettyPrinterExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=809759&r1=809758&r2=809759&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
Mon Aug 31 21:50:11 2009
@@ -380,7 +380,7 @@
     public CodeGenConfiguration(Map<String,CommandLineOption> optionMap) {
         CodegenConfigLoader.loadConfig(this, optionMap);
         this.axisServices = new ArrayList<AxisService>();
-        this.outputXmlFileNamesList = new ArrayList<String>();
+        this.outputFileNamesList = new ArrayList<String>();
     }
 
 
@@ -563,18 +563,18 @@
     }
 
     // this is used to keep the generated xml file list to pretty print.
-    private List<String> outputXmlFileNamesList;
+    private List<String> outputFileNamesList;
 
-    public List<String> getOutputXmlFileNamesList() {
-        return outputXmlFileNamesList;
+    public List<String> getOutputFileNamesList() {
+        return outputFileNamesList;
     }
 
-    public void setOutputXmlFileNamesList(List<String> outputXmlFileNamesList) {
-        this.outputXmlFileNamesList = outputXmlFileNamesList;
+    public void setOutputFileNamesList(List<String> outputXmlFileNamesList) {
+        this.outputFileNamesList = outputXmlFileNamesList;
     }
 
-    public void addXmlFileName(String fileName){
-       this.outputXmlFileNamesList.add(fileName);
+    public void addOutputFileName(String fileName){
+       this.outputFileNamesList.add(fileName);
     }
     public void setoutputSourceLocation(boolean setoutputsourcelocation)
     {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=809759&r1=809758&r2=809759&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Mon Aug 31 21:50:11 2009
@@ -569,7 +569,6 @@
         antBuildWriter.setDatabindingFramework(codeGenConfiguration.getDatabindingType());
         antBuildWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(skeletonModel, antBuildWriter);
-        codeGenConfiguration.addXmlFileName(antBuildWriter.getOutputFile().getAbsolutePath());//$NON-SEC-3
     }
 
     /**
@@ -1982,7 +1981,6 @@
                         this.codeGenConfiguration.getOutputLanguage());
         serviceXmlWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(serviceXMLModel, serviceXmlWriter);
-        codeGenConfiguration.addXmlFileName(serviceXmlWriter.getOutputFile().getAbsolutePath());//$NON-SEC-3
 
     }
 
@@ -2641,6 +2639,7 @@
         String className = model.getDocumentElement().getAttribute("name");
 
         writer.createOutFile(packageName, className);
+        codeGenConfiguration.addOutputFileName(writer.getOutputFile().getAbsolutePath());//$NON-SEC-3
 
         // use the global resolver
         writer.parse(model, resolver);

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractPrettyPrinterExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractPrettyPrinterExtension.java?rev=809759&r1=809758&r2=809759&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractPrettyPrinterExtension.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractPrettyPrinterExtension.java
Mon Aug 31 21:50:11 2009
@@ -46,11 +46,13 @@
      */
     protected void prettify(File file, CodeGenConfiguration configuration) {
 
-        List xmlFileList = configuration.getOutputXmlFileNamesList();
+        List fileList = configuration.getOutputFileNamesList();
         String fileName = null;
-        for (Iterator iter = xmlFileList.iterator();iter.hasNext();){
+        for (Iterator iter = fileList.iterator();iter.hasNext();){
             fileName = (String) iter.next();
-            prettifyFile(new File(fileName));
+            if (fileName.toLowerCase().endsWith(fileExtension)) {
+                prettifyFile(new File(fileName));
+            }
         }
 
     }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java?rev=809759&r1=809758&r2=809759&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java
Mon Aug 31 21:50:11 2009
@@ -20,7 +20,6 @@
 package org.apache.axis2.wsdl.codegen.extension;
 
 import org.apache.axis2.util.PrettyPrinter;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
 
 import java.io.File;
 
@@ -36,26 +35,6 @@
     }
 
     /**
-     * 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();
-            if (childFiles != null) {
-                for (int i = 0; i < childFiles.length; i++) {
-                    prettify(childFiles[i], configuration);
-                }
-            }
-        }
-    }
-
-    /**
      * Overridden to call the java pretty printer
      *
      * @param file



Mime
View raw message