You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2008/08/22 23:52:38 UTC
svn commit: r688203 - in
/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: ./ c/ cpp/
Author: nadiramra
Date: Fri Aug 22 14:52:38 2008
New Revision: 688203
URL: http://svn.apache.org/viewvc?rev=688203&view=rev
Log:
Simplify, remove redundant/unused code.
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/BasicFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamHeaderWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/CFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/CPPClassWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/BasicFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/BasicFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/BasicFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/BasicFileWriter.java Fri Aug 22 14:52:38 2008
@@ -27,6 +27,7 @@
import org.apache.axis.wsdl.wsdl2ws.SourceWriter;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
+import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
/**
* Basic file writer.
@@ -37,19 +38,37 @@
protected String c_classname;
protected String c_fileExtension;
protected BufferedWriter c_writer;
- public BasicFileWriter(String classname)throws WrapperFault{
- c_classname = classname;
+ protected WebServiceContext wscontext = null;
+
+ public BasicFileWriter(String classname, String fileExtension) throws WrapperFault
+ {
+ c_classname = classname;
+ c_fileExtension = fileExtension;
}
- public abstract void writeSource()throws WrapperFault;
+ public abstract void writeSource() throws WrapperFault;
protected void writeClassComment() throws WrapperFault {}
protected void writePreprocessorStatements() throws WrapperFault {}
protected void writeAttributes() throws WrapperFault {}
protected void writeConstructors() throws WrapperFault {};
protected void writeDestructors() throws WrapperFault {};
protected abstract void writeMethods() throws WrapperFault;
- protected File getFilePath() throws WrapperFault
+
+ protected File getFilePath(boolean useServiceName) throws WrapperFault
{
- return getFilePath(false);
+ if (wscontext == null)
+ throw new WrapperFault("Context not set.");
+
+ String targetOutputLocation = wscontext.getWrapperInfo().getTargetOutputLocation();
+ new File(targetOutputLocation).mkdirs();
+
+ String serviceName = "";
+ if (useServiceName)
+ serviceName = wscontext.getServiceInfo().getServicename() + "_";
+
+ String fileName = targetOutputLocation + "/" + serviceName + c_classname + c_fileExtension;
+
+ wscontext.addGeneratedFile(fileName);
+
+ return new File(fileName);
}
- protected abstract File getFilePath(boolean b)throws WrapperFault;
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java Fri Aug 22 14:52:38 2008
@@ -45,14 +45,12 @@
// array of parameter types and attributes
protected ParameterInfo[] attribs;
- protected WebServiceContext wscontext;
-
// Type of this param
protected Type type;
- public ParamWriter(WebServiceContext wscontext, Type type) throws WrapperFault
+ public ParamWriter(WebServiceContext wscontext, Type type, String fileExtension) throws WrapperFault
{
- super(CUtils.getLanguageTypeName4Type(type));
+ super(CUtils.getLanguageTypeName4Type(type), fileExtension);
this.wscontext = wscontext;
this.type = type;
populateAttribList();
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamHeaderWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamHeaderWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.c;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -42,14 +41,14 @@
public ArrayParamHeaderWriter(WebServiceContext wscontext, Type type)
throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getHeaderFileExtension());
}
public void writeSource() throws WrapperFault
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
c_writer.write("#if !defined(__" + c_classname.toUpperCase() + "_H__INCLUDED_)\n");
@@ -74,7 +73,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -88,23 +87,6 @@
return CUtils.isSimpleType(qname);
}
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getHeaderFileExtension();
-
- if (useServiceName)
- {
- fileName = targetOutputLocation + "/"
- + this.wscontext.getServiceInfo().getServicename()
- + "_" + c_classname + CUtils.getHeaderFileExtension();
- }
-
- return new File(fileName);
- }
-
protected void writeArrayClassDefinition() throws WrapperFault
{
try
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.c;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -47,7 +46,7 @@
public ArrayParamWriter(WebServiceContext wscontext, Type type)
throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getImplFileExtension());
}
/* (non-Javadoc)
@@ -57,7 +56,7 @@
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
// Write prolog
writeClassComment();
@@ -90,7 +89,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -204,17 +203,4 @@
throw new WrapperFault(e);
}
}
-
- /* (non-Javadoc)
- * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath(boolean)
- */
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getImplFileExtension();
-
- return new File(fileName);
- }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java Fri Aug 22 14:52:38 2008
@@ -22,7 +22,6 @@
package org.apache.axis.wsdl.wsdl2ws.c;
-import java.io.File;
import java.io.IOException;
import org.apache.axis.wsdl.wsdl2ws.CUtils;
@@ -990,9 +989,4 @@
throw new WrapperFault(e);
}
}
-
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- return null;
- }
}
\ No newline at end of file
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/CFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/CFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/CFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/CFileWriter.java Fri Aug 22 14:52:38 2008
@@ -23,7 +23,6 @@
package org.apache.axis.wsdl.wsdl2ws.c;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -31,19 +30,16 @@
import org.apache.axis.wsdl.wsdl2ws.CUtils;
import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
-import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
public abstract class CFileWriter extends BasicFileWriter
{
- protected WebServiceContext wscontext;
-
/**
* @param classname
* @throws WrapperFault
*/
public CFileWriter(String classname) throws WrapperFault
{
- super(classname);
+ super(classname, CUtils.getImplFileExtension());
}
/* (non-Javadoc)
@@ -53,7 +49,7 @@
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
writePreprocessorStatements();
writeGlobalCodes();
@@ -62,7 +58,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -76,25 +72,4 @@
*/
protected void writeGlobalCodes() throws WrapperFault
{}
-
- /* (non-Javadoc)
- * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath(boolean)
- */
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getImplFileExtension();
-
- if (useServiceName)
- {
- String serviceName = this.wscontext.getServiceInfo().getServicename();
- fileName = targetOutputLocation + "/" + serviceName + "_" + c_classname + CUtils.getImplFileExtension();
- this.wscontext.addGeneratedFile(serviceName + "_" + c_classname + CUtils.getImplFileExtension());
- }
- else
- this.wscontext.addGeneratedFile(c_classname + CUtils.getImplFileExtension());
-
- return new File(fileName);
- }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java Fri Aug 22 14:52:38 2008
@@ -24,26 +24,23 @@
package org.apache.axis.wsdl.wsdl2ws.c;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import org.apache.axis.wsdl.wsdl2ws.BasicFileWriter;
+import org.apache.axis.wsdl.wsdl2ws.CUtils;
import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
-import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
public abstract class HeaderFileWriter extends BasicFileWriter
{
- protected WebServiceContext wscontext;
-
/**
* @param classname
* @throws WrapperFault
*/
public HeaderFileWriter(String classname) throws WrapperFault
{
- super(classname);
+ super(classname, CUtils.getHeaderFileExtension());
}
/* (non-Javadoc)
@@ -53,7 +50,7 @@
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
@@ -78,7 +75,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -86,24 +83,4 @@
}
}
-
- /* (non-Javadoc)
- * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath(boolean)
- */
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + ".h";
-
- if (useServiceName)
- fileName = targetOutputLocation + "/" + this.getServiceName() + "_" + c_classname + ".h";
-
- return new File(fileName);
- }
- protected String getServiceName() throws WrapperFault
- {
- return wscontext.getServiceInfo().getServicename();
- }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java Fri Aug 22 14:52:38 2008
@@ -44,7 +44,7 @@
*/
public ParamCFileWriter(WebServiceContext wscontext, Type type) throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getImplFileExtension());
}
/**
@@ -59,7 +59,7 @@
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
writePreprocessorStatements();
if (type.isSimpleType())
@@ -74,7 +74,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.c;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
@@ -45,14 +44,14 @@
{
public ParmHeaderFileWriter(WebServiceContext wscontext, Type type) throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getHeaderFileExtension());
}
public void writeSource() throws WrapperFault
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
// if this headerfile not defined define it
@@ -88,7 +87,7 @@
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -321,26 +320,6 @@
protected void writeMethods() throws WrapperFault
{}
- /* (non-Javadoc)
- * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath(boolean)
- */
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getHeaderFileExtension();
-
- if (useServiceName)
- {
- fileName = targetOutputLocation + "/"
- + this.wscontext.getServiceInfo().getServicename() + "_"
- + c_classname + CUtils.getHeaderFileExtension();
- }
-
- return new File(fileName);
- }
-
protected void writeFunctionPrototypes() throws WrapperFault
{
Iterator types = wscontext.getTypemap().getTypes().iterator();
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.cpp;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -42,14 +41,14 @@
public ArrayParamHeaderWriter(WebServiceContext wscontext, Type type)
throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getHeaderFileExtension());
}
public void writeSource() throws WrapperFault
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
c_writer.write("#if !defined(__" + c_classname.toUpperCase()
@@ -79,7 +78,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -93,23 +92,6 @@
return CUtils.isSimpleType(qname);
}
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getHeaderFileExtension();
-
- if (useServiceName)
- {
- fileName = targetOutputLocation + "/"
- + this.wscontext.getServiceInfo().getServicename()
- + "_" + c_classname + CUtils.getHeaderFileExtension();
- }
-
- return new File(fileName);
- }
-
protected void writeArrayClassDefinition() throws WrapperFault
{
try
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java Fri Aug 22 14:52:38 2008
@@ -17,7 +17,6 @@
package org.apache.axis.wsdl.wsdl2ws.cpp;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -41,7 +40,7 @@
public ArrayParamWriter(WebServiceContext wscontext, Type type)
throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getImplFileExtension());
}
/* (non-Javadoc)
@@ -51,7 +50,7 @@
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
c_writer.write("#include \"" + c_classname + ".hpp\"\n\n");
@@ -59,7 +58,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -257,25 +256,4 @@
throw new WrapperFault(e);
}
}
-
- /* (non-Javadoc)
- * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath(boolean)
- */
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getImplFileExtension();
-
- if (useServiceName)
- {
- fileName = targetOutputLocation + "/"
- + this.wscontext.getServiceInfo().getServicename()
- + "_" + c_classname + CUtils.getHeaderFileExtension();
- }
-
- return new File(fileName);
- }
-
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java Fri Aug 22 14:52:38 2008
@@ -31,7 +31,6 @@
package org.apache.axis.wsdl.wsdl2ws.cpp;
-import java.io.File;
import java.io.IOException;
import java.util.Iterator;
@@ -1351,9 +1350,4 @@
throw new WrapperFault(e);
}
}
-
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- return null;
- }
}
\ No newline at end of file
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/CPPClassWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/CPPClassWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/CPPClassWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/CPPClassWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.cpp;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -32,13 +31,12 @@
import org.apache.axis.wsdl.wsdl2ws.CUtils;
import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
-import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
public abstract class CPPClassWriter extends BasicFileWriter
{
public CPPClassWriter(String classname) throws WrapperFault
{
- super(classname);
+ super(classname, CUtils.getImplFileExtension());
}
public void writeSource() throws WrapperFault
@@ -46,7 +44,7 @@
try
{
c_writer =
- new BufferedWriter(new FileWriter(getFilePath(), false));
+ new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
writePreprocessorStatements();
@@ -62,7 +60,7 @@
c_writer.close();
if (WSDL2Ws.c_verbose)
System.out.println(
- getFilePath().getAbsolutePath() + " created.....");
+ getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
@@ -74,26 +72,4 @@
protected void writeGlobalCodes() throws WrapperFault
{}
-
- protected WebServiceContext wscontext;
-
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getImplFileExtension();
-
- if (useServiceName)
- {
- String serviceName = this.wscontext.getServiceInfo().getServicename();
- fileName = targetOutputLocation + "/" + serviceName + "_" + c_classname + CUtils.getImplFileExtension();
- this.wscontext.addGeneratedFile(serviceName + "_" + c_classname + CUtils.getImplFileExtension());
- }
- else
- {
- this.wscontext.addGeneratedFile(c_classname + CUtils.getImplFileExtension());
- }
-
- return new File(fileName);
- }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java Fri Aug 22 14:52:38 2008
@@ -58,11 +58,6 @@
this.methods = wscontext.getServiceInfo().getMethods();
}
- protected String getServiceName() throws WrapperFault
- {
- return wscontext.getServiceInfo().getServicename();
- }
-
protected void writeClassComment() throws WrapperFault
{
try
@@ -158,7 +153,7 @@
{
if ("AxisClientException".equals(c_classname))
{
- c_writer.write("#include \"" + getServiceName() + "_" + c_classname
+ c_writer.write("#include \"" + wscontext.getServiceInfo().getServicename() + "_" + c_classname
+ CUtils.getHeaderFileExtension() + "\"\n\n");
}
else
@@ -903,12 +898,4 @@
throw new WrapperFault(e);
}
}
-
- /* (non-Javadoc)
- * @see org.apache.axis.wsdl.wsdl2ws.cpp.CPPClassWriter#writeGlobalCodes()
- * Used by literal code too!
- */
- protected void writeGlobalCodes() throws WrapperFault
- {
- }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java Fri Aug 22 14:52:38 2008
@@ -52,22 +52,16 @@
protected File getFilePath(boolean useServiceName) throws WrapperFault
{
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
+ String targetOutputLocation = wscontext.getWrapperInfo().getTargetOutputLocation();
new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + faultInfoName + CUtils.getHeaderFileExtension();
-
+
+ String serviceName = "";
if (useServiceName)
- {
- fileName =
- targetOutputLocation
- + "/"
- + this.wscontext.getServiceInfo().getServicename()
- + "_"
- + faultInfoName
- + CUtils.getHeaderFileExtension();
- }
-
+ serviceName = wscontext.getServiceInfo().getServicename() + "_";
+
+ String fileName = targetOutputLocation + "/" + serviceName + faultInfoName + c_fileExtension;
+
+ wscontext.addGeneratedFile(fileName);
return new File(fileName);
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java Fri Aug 22 14:52:38 2008
@@ -37,14 +37,12 @@
public class ExceptionWriter extends BasicFileWriter
{
- private WebServiceContext wscontext;
-
private String faultInfoName;
public ExceptionWriter(WebServiceContext wscontext, String faultInfoName)
throws WrapperFault
{
- super(wscontext.getServiceInfo().getServicename());
+ super(wscontext.getServiceInfo().getServicename(), CUtils.getImplFileExtension());
this.wscontext = wscontext;
this.faultInfoName = "Axis" + faultInfoName + "Exception";
}
@@ -54,20 +52,16 @@
*/
protected File getFilePath(boolean useServiceName) throws WrapperFault
{
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
+ String targetOutputLocation = wscontext.getWrapperInfo().getTargetOutputLocation();
new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + faultInfoName + CUtils.getImplFileExtension();
-
+
+ String serviceName = "";
if (useServiceName)
- {
- fileName = targetOutputLocation + "/" + this.getServiceName() + "_" + faultInfoName + CUtils.getImplFileExtension();
- this.wscontext.addGeneratedFile(this.getServiceName() + "_" + faultInfoName + CUtils.getImplFileExtension());
- }
- else
- {
- this.wscontext.addGeneratedFile(faultInfoName + CUtils.getImplFileExtension());
- }
+ serviceName = wscontext.getServiceInfo().getServicename() + "_";
+
+ String fileName = targetOutputLocation + "/" + serviceName + faultInfoName + c_fileExtension;
+
+ wscontext.addGeneratedFile(fileName);
return new File(fileName);
}
@@ -261,7 +255,7 @@
{
try
{
- String filename = getFilePath().getName();
+ String filename = getFilePath(false).getName();
c_writer =
new BufferedWriter(
@@ -279,7 +273,7 @@
c_writer.close();
if (WSDL2Ws.c_verbose)
System.out.println(
- getFilePath().getAbsolutePath() + " created.....");
+ getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.cpp;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -32,20 +31,18 @@
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
import org.apache.axis.wsdl.wsdl2ws.BasicFileWriter;
import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
-import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
public abstract class HeaderFileWriter extends BasicFileWriter
{
- protected WebServiceContext wscontext;
public HeaderFileWriter(String classname) throws WrapperFault
{
- super(classname);
+ super(classname, CUtils.getHeaderFileExtension());
}
public void writeSource() throws WrapperFault
{
try
{
- String filename = getFilePath().getName();
+ String filename = getFilePath(false).getName();
c_writer =
new BufferedWriter(
@@ -102,7 +99,7 @@
c_writer.close();
if (WSDL2Ws.c_verbose)
System.out.println(
- getFilePath().getAbsolutePath() + " created.....");
+ getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
@@ -114,20 +111,6 @@
protected abstract String getExtendsPart(); //{return " ";}
protected abstract String getFileType();
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getHeaderFileExtension();
-
- if (useServiceName)
- {
- fileName = targetOutputLocation + "/" + this.getServiceName() + "_" + c_classname + CUtils.getHeaderFileExtension();
- }
-
- return new File(fileName);
- }
protected String getServiceName() throws WrapperFault
{
return wscontext.getServiceInfo().getServicename();
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java Fri Aug 22 14:52:38 2008
@@ -40,7 +40,7 @@
public ParamCPPFileWriter(WebServiceContext wscontext, Type type)
throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getImplFileExtension());
}
protected void writeConstructors() throws WrapperFault
@@ -54,7 +54,7 @@
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
writePreprocessorStatements();
@@ -72,7 +72,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java Fri Aug 22 14:52:38 2008
@@ -24,7 +24,6 @@
package org.apache.axis.wsdl.wsdl2ws.cpp;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
@@ -46,14 +45,14 @@
public ParmHeaderFileWriter(WebServiceContext wscontext, Type type)
throws WrapperFault
{
- super(wscontext, type);
+ super(wscontext, type, CUtils.getHeaderFileExtension());
}
public void writeSource() throws WrapperFault
{
try
{
- c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+ c_writer = new BufferedWriter(new FileWriter(getFilePath(false), false));
writeClassComment();
// if this headerfile not defined define it
c_writer.write("#if !defined(__" + c_classname.toUpperCase() + "_"
@@ -95,7 +94,7 @@
c_writer.flush();
c_writer.close();
if (WSDL2Ws.c_verbose)
- System.out.println(getFilePath().getAbsolutePath() + " created.....");
+ System.out.println(getFilePath(false).getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -470,24 +469,6 @@
{
}
- protected File getFilePath(boolean useServiceName) throws WrapperFault
- {
- String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
- new File(targetOutputLocation).mkdirs();
-
- String fileName = targetOutputLocation + "/" + c_classname + CUtils.getHeaderFileExtension();
-
- if (useServiceName)
- {
- fileName = targetOutputLocation + "/"
- + this.wscontext.getServiceInfo().getServicename() + "_"
- + c_classname + CUtils.getHeaderFileExtension();
- }
-
- return new File(fileName);
- }
-
-
protected void writeFunctionPrototypes() throws WrapperFault
{
try
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java?rev=688203&r1=688202&r2=688203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java Fri Aug 22 14:52:38 2008
@@ -44,8 +44,8 @@
public void writeSource() throws WrapperFault
{
- // We should not overwrite the service file if it already exsists
- if (! getFilePath().exists())
+ // We should not overwrite the service file if it already exists
+ if (! getFilePath(false).exists())
super.writeSource();
}