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 na...@apache.org on 2006/04/05 08:43:35 UTC
svn commit: r391550 - in
/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp:
AllParamWriter.java ArrayParamHeaderWriter.java
Author: nadiramra
Date: Tue Apr 4 23:43:33 2006
New Revision: 391550
URL: http://svn.apache.org/viewcvs?rev=391550&view=rev
Log:
Format code so more readable - align braces, etc.
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java?rev=391550&r1=391549&r2=391550&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java Tue Apr 4 23:43:33 2006
@@ -59,9 +59,8 @@
if (type.isArray())
{
if (WSDL2Ws.verbose)
- {
System.out.println("Array writer called ......");
- }
+
QName qname = type.getName();
String elementType = type.getElementType();
@@ -76,17 +75,14 @@
continue;
}
- if (CUtils.isSimpleType(qname)
- && !CUtils.isDefinedSimpleType(qname))
+ if (CUtils.isSimpleType(qname) && !CUtils.isDefinedSimpleType(qname))
{
throw new WrapperFault(
- "No need to create an Array for simple type "
- + qname
- + "\n"
- + "It seems that some thing wrong with symbolTable population - Susantha");
+ "No need to create an Array for simple type " + qname + "\n"
+ + "It seems that some thing wrong with symbolTable population");
}
- ArrayParamHeaderWriter writer =
- (new ArrayParamHeaderWriter(wscontext, type));
+
+ ArrayParamHeaderWriter writer = (new ArrayParamHeaderWriter(wscontext, type));
if (!writer.isSimpleTypeArray())
{
writer.writeSource();
@@ -102,28 +98,22 @@
/* TODO do some processing to this type before synthesizing to remove ">" charactors.
* And then it should also be synthesized if command line option says to */
if(WSDL2Ws.verbose)
- System.out.println(
- "ignoring anonymous type " + type.getLanguageSpecificName() + "\n");
+ System.out.println("ignoring anonymous type " + type.getLanguageSpecificName() + "\n");
}
else
{
if (WSDL2Ws.verbose)
- {
- System.out.println(
- "struct writer called ......");
- }
- (new BeanParamWriter(wscontext, type))
- .writeSource();
- (new ParmHeaderFileWriter(wscontext, type))
- .writeSource();
+ System.out.println("struct writer called ......");
+
+ (new BeanParamWriter(wscontext, type)).writeSource();
+ (new ParmHeaderFileWriter(wscontext, type)).writeSource();
}
}
}
catch (Exception e)
{
System.out.println(
- "Error occurred generating code for "
- + type.getLanguageSpecificName()
+ "Error occurred generating code for " + type.getLanguageSpecificName()
+ ". Other classes will continue to be generated.");
e.printStackTrace();
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java?rev=391550&r1=391549&r2=391550&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 Tue Apr 4 23:43:33 2006
@@ -51,56 +51,37 @@
{
try
{
- this.writer =
- new BufferedWriter(new FileWriter(getFilePath(), false));
+ this.writer = new BufferedWriter(new FileWriter(getFilePath(), false));
writeClassComment();
- // if this headerfile not defined define it
- this.writer.write(
- "#if !defined(__"
- + classname.toUpperCase()
- + "_"
- + getFileType().toUpperCase()
- + "_H__INCLUDED_)\n");
- this.writer.write(
- "#define __"
- + classname.toUpperCase()
- + "_"
- + getFileType().toUpperCase()
- + "_H__INCLUDED_\n\n");
+
+ this.writer.write("#if !defined(__" + classname.toUpperCase()
+ + "_" + getFileType().toUpperCase() + "_H__INCLUDED_)\n");
+ this.writer.write("#define __" + classname.toUpperCase()
+ + "_" + getFileType().toUpperCase() + "_H__INCLUDED_\n\n");
+
if (attribs.length != 1)
{
- System.out.println(
- "Array "
- + classname
- + " contains unexpected no of variables");
- throw new WrapperFault(
- "Array type "
- + classname
- + " contain unexpected no of types");
+ System.out.println( "Array " + classname + " contains unexpected no of variables");
+ throw new WrapperFault("Array type " + classname + " contain unexpected no of types");
}
+
//include header file for the contained type
QName qname = WrapperUtils.getArrayType(type).getName();
if (!CUtils.isSimpleType(qname))
- {
writer.write("#include \""+ attribs[0].getTypeName() + ".hpp\"\n");
- }
+
writer.write("#include <axis/AxisUserAPI.hpp>\n\n");
writeArrayClassDefinition();
- this.writer.write(
- "#endif /* !defined(__"
- + classname.toUpperCase()
- + "_"
- + getFileType().toUpperCase()
- + "_H__INCLUDED_)*/\n");
+
+ this.writer.write("#endif /* !defined(__" + classname.toUpperCase()
+ + "_" + getFileType().toUpperCase() + "_H__INCLUDED_)*/\n");
+
writer.flush();
writer.close();
if (WSDL2Ws.verbose)
- {
- System.out.println(
- getFilePath().getAbsolutePath() + " created.....");
- }
+ System.out.println(getFilePath().getAbsolutePath() + " created.....");
}
catch (IOException e)
{
@@ -122,29 +103,19 @@
protected File getFilePath(boolean useServiceName) throws WrapperFault
{
- String targetOutputLocation =
- this.wscontext.getWrapInfo().getTargetOutputLocation();
+ String targetOutputLocation = this.wscontext.getWrapInfo().getTargetOutputLocation();
if (targetOutputLocation.endsWith("/"))
- {
- targetOutputLocation =
- targetOutputLocation.substring(
- 0,
- targetOutputLocation.length() - 1);
- }
+ targetOutputLocation = targetOutputLocation.substring(0,targetOutputLocation.length() - 1);
+
new File(targetOutputLocation).mkdirs();
- String fileName =
- targetOutputLocation + "/" + classname + CUtils.CPP_HEADER_SUFFIX;
+ String fileName = targetOutputLocation + "/" + classname + CUtils.CPP_HEADER_SUFFIX;
if (useServiceName)
{
- fileName =
- targetOutputLocation
- + "/"
+ fileName = targetOutputLocation + "/"
+ this.wscontext.getSerInfo().getServicename()
- + "_"
- + classname
- + CUtils.CPP_HEADER_SUFFIX;
+ + "_" + classname + CUtils.CPP_HEADER_SUFFIX;
}
return new File(fileName);
@@ -154,35 +125,33 @@
{
try
{
- Iterator itForTypes = wscontext.getTypemap().getTypes().iterator();
- boolean nillable = false;
-
- while( itForTypes.hasNext())
- {
- Type aType = (Type) itForTypes.next();
-
- if( aType.getLanguageSpecificName().indexOf( ">") > -1)
- {
- Iterator itForElemName = aType.getElementnames();
-
- while( itForElemName.hasNext() && !nillable)
- {
- String key = (String) itForElemName.next();
-
- if( aType.getElementForElementName( key).getNillable())
- {
- nillable = true;
- }
- }
- }
- }
-
- writer.write("class STORAGE_CLASS_INFO " + classname + " : public Axis_Array\n");
- writer.write("{\n");
- writer.write("\tpublic:\n");
- this.writeConstructors();
- this.writeDestructors();
- this.writeMethods();
+ Iterator itForTypes = wscontext.getTypemap().getTypes().iterator();
+ boolean nillable = false;
+
+ while( itForTypes.hasNext())
+ {
+ Type aType = (Type) itForTypes.next();
+
+ if( aType.getLanguageSpecificName().indexOf( ">") > -1)
+ {
+ Iterator itForElemName = aType.getElementnames();
+
+ while( itForElemName.hasNext() && !nillable)
+ {
+ String key = (String) itForElemName.next();
+
+ if( aType.getElementForElementName( key).getNillable())
+ nillable = true;
+ }
+ }
+ }
+
+ writer.write("class STORAGE_CLASS_INFO " + classname + " : public Axis_Array\n");
+ writer.write("{\n");
+ writer.write("\tpublic:\n");
+ this.writeConstructors();
+ this.writeDestructors();
+ this.writeMethods();
writer.write("};\n\n");
}
catch (IOException e)