axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r557218 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen: ./ emitter/ extension/ writer/
Date Wed, 18 Jul 2007 10:40:14 GMT
Author: amilas
Date: Wed Jul 18 03:40:06 2007
New Revision: 557218

URL: http://svn.apache.org/viewvc?view=rev&rev=557218
Log:
resolve the issue Axis2-2947

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/writer/AntBuildWriter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ServiceXMLWriter.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?view=diff&rev=557218&r1=557217&r2=557218
==============================================================================
--- 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
Wed Jul 18 03:40:06 2007
@@ -373,6 +373,7 @@
     public CodeGenConfiguration(Map optionMap) {
         CodegenConfigLoader.loadConfig(this, optionMap);
         this.axisServices = new ArrayList();
+        this.outputXmlFileNamesList = new ArrayList();
     }
 
 
@@ -553,5 +554,20 @@
 
     public void setOverride(boolean override) {
         isOverride = override;
+    }
+
+    // this is used to keep the generated xml file list to pretty print.
+    private List outputXmlFileNamesList;
+
+    public List getOutputXmlFileNamesList() {
+        return outputXmlFileNamesList;
+    }
+
+    public void setOutputXmlFileNamesList(List outputXmlFileNamesList) {
+        this.outputXmlFileNamesList = outputXmlFileNamesList;
+    }
+
+    public void addXmlFileName(String fileName){
+       this.outputXmlFileNamesList.add(fileName);
     }
 }

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?view=diff&rev=557218&r1=557217&r2=557218
==============================================================================
--- 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
Wed Jul 18 03:40:06 2007
@@ -563,6 +563,7 @@
         antBuildWriter.setDatabindingFramework(codeGenConfiguration.getDatabindingType());
         antBuildWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(skeletonModel, antBuildWriter);
+        codeGenConfiguration.addXmlFileName(antBuildWriter.getOutputFile().getAbsolutePath());
     }
 
     /**
@@ -1885,6 +1886,7 @@
                         this.codeGenConfiguration.getOutputLanguage());
         serviceXmlWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(serviceXMLModel, serviceXmlWriter);
+        codeGenConfiguration.addXmlFileName(serviceXmlWriter.getOutputFile().getAbsolutePath());
 
     }
 

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?view=diff&rev=557218&r1=557217&r2=557218
==============================================================================
--- 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
Wed Jul 18 03:40:06 2007
@@ -22,6 +22,8 @@
 import org.apache.axis2.wsdl.codegen.CodeGenerationException;
 
 import java.io.File;
+import java.util.List;
+import java.util.Iterator;
 
 public abstract class AbstractPrettyPrinterExtension extends AbstractCodeGenerationExtension
{
     /** If the extension for property file changes it might effect this as well !!! */
@@ -31,7 +33,7 @@
 
         //recurse through the output files and prettify them
         File outputFolder = configuration.getOutputLocation();
-        prettify(outputFolder);
+        prettify(outputFolder,configuration);
 
 
     }
@@ -41,16 +43,13 @@
      *
      * @param file
      */
-    protected void prettify(File file) {
-        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]);
-            }
+    protected void prettify(File file, CodeGenConfiguration configuration) {
+
+        List xmlFileList = configuration.getOutputXmlFileNamesList();
+        String fileName = null;
+        for (Iterator iter = xmlFileList.iterator();iter.hasNext();){
+            fileName = (String) iter.next();
+            prettifyFile(new File(fileName));
         }
 
     }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java?view=diff&rev=557218&r1=557217&r2=557218
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
Wed Jul 18 03:40:06 2007
@@ -46,7 +46,7 @@
     }
 
     public void createOutFile(String packageName, String fileName) throws Exception {
-        File outputFile = org.apache.axis2.util.FileWriter.createClassFile(outputFileLocation,
+        outputFile = org.apache.axis2.util.FileWriter.createClassFile(outputFileLocation,
                                                      "",
                                                      "build",
                                                      ".xml");

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java?view=diff&rev=557218&r1=557217&r2=557218
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
Wed Jul 18 03:40:06 2007
@@ -188,4 +188,12 @@
     public void setOverride(boolean override) {
         isOverride = override;
     }
+
+    public File getOutputFile() {
+        return outputFile;
+    }
+
+    public void setOutputFile(File outputFile) {
+        this.outputFile = outputFile;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ServiceXMLWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ServiceXMLWriter.java?view=diff&rev=557218&r1=557217&r2=557218
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ServiceXMLWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ServiceXMLWriter.java
Wed Jul 18 03:40:06 2007
@@ -36,7 +36,7 @@
 
 
     public void createOutFile(String packageName, String fileName) throws Exception {
-        File outputFile = org.apache.axis2.util.FileWriter.createClassFile(outputFileLocation,
+        outputFile = org.apache.axis2.util.FileWriter.createClassFile(outputFileLocation,
                                                      packageName,
                                                      "services",
                                                      ".xml");



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


Mime
View raw message