axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdinap...@apache.org
Subject svn commit: r356742 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal: BeanParamWriter.java ParmHeaderFileWriter.java
Date Wed, 14 Dec 2005 07:26:21 GMT
Author: cdinapala
Date: Tue Dec 13 23:26:14 2005
New Revision: 356742

URL: http://svn.apache.org/viewcvs?rev=356742&view=rev
Log:
Correct the code generation problem of "All" constructs.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=356742&r1=356741&r2=356742&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Tue Dec 13 23:26:14 2005
@@ -154,6 +154,7 @@
             	String methodName = attribs[i].getParamNameWithoutSymbols();
                 String parameterName = methodName;
                 String properParamName = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
+                String type = attribs[i].getTypeName();
 
                 if( methodName.endsWith( "_"))
                 {
@@ -195,15 +196,32 @@
 	                    	anyCounter += 1;
 	                    	parameterName = parameterName + Integer.toString(anyCounter);
 	                    }
+	                    if(attribs[i].getAllElement())
+	                    {
+	                    	writer.write("\n" + properParamName + " " + classname
+		                            + "::get" + methodName + "()\n{\n");
+	                    }
+	                    else
+	                    {
+		                    writer.write("\n" + properParamName + " * " + classname
+		                            + "::get" + methodName + "()\n{\n");
+	                    }
 	                    
-	                    writer.write("\n" + properParamName + " * " + classname
-	                            + "::get" + methodName + "()\n{\n");
-	
 	                    writer.write("\t" + "return " + parameterName + " ; \n}\n");
 	
-	                    writer.write("\n" + "void " + classname + "::set"
-	                            + methodName + "(" + properParamName
-	                            + " * pInValue, bool deep)\n{\n");
+	                    if(attribs[i].getAllElement())
+	                    {
+	                    	writer.write("\n" + "void " + classname + "::set"
+		                            + methodName + "(" + properParamName
+		                            + " pInValue, bool deep)\n{\n");
+	                    }
+	                    else
+	                    {
+	                    	writer.write("\n" + "void " + classname + "::set"
+		                            + methodName + "(" + properParamName
+		                            + " * pInValue, bool deep)\n{\n");
+	                    }
+	                    
 	
 	                    writer.write("\tif (" + parameterName + " != NULL)\n");
                         writer.write("\t{\n");
@@ -217,7 +235,14 @@
                         writer.write("\t{\n");
                         writer.write("\t\tif (deep)\n");
                         writer.write("\t\t{\n");
-                        writer.write("\t\t\t" + parameterName + " = new " + properParamName
+ "();\n");
+                        if(attribs[i].getAllElement())
+                        {
+                        	writer.write("\t\t\t" + parameterName + " = new " + type + "();\n");
+                        }
+                        else
+                        {
+                        	writer.write("\t\t\t" + parameterName + " = new " + properParamName
+ "();\n");
+                        }
                         writer.write("\t\t\t*" + parameterName + " = *pInValue;\n");
                         writer.write("\t\t}\n");
                         writer.write("\t\telse\n");

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=356742&r1=356741&r2=356742&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
Tue Dec 13 23:26:14 2005
@@ -301,7 +301,7 @@
                 attribs[i].setParamName( CUtils.sanitiseAttributeName( classname, attribs[i].getParamName()));
                 
 				// FJP Nillable vv
-				if (isElementNillable(i) || attribs[i].isArray() || isElementOptional(i))
+				if (isElementNillable(i) || attribs[i].isArray() || isElementOptional(i) && !attribs[i].getAllElement())
 				{
 					if(attribs[i].isAnyType()){
 						anyCounter += 1;
@@ -331,26 +331,37 @@
 					        
 					    }
 					}
-				} else {
-					// FJP Nillable ^^
-					if(attribs[i].isAnyType()){
-						anyCounter += 1;
-						writer
-						.write("\t"
-								+ getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-								+ " " + attribs[i].getParamName()
-								+ Integer.toString(anyCounter)
-								+ ";\n");
-						
-					}
-						
-					else{
-				    writer.write("\t"
-                                + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                + " " + attribs[i].getParamNameWithoutSymbols()
-                                + ";\n");
+				} else 
+					{
+						if(attribs[i].getAllElement())
+						{
+							writer.write("\t"
+									 + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+									 + " " + attribs[i].getParamName()
+									 + ";\n");
+						}
+						else 
+						{
+							// FJP Nillable ^^
+							if(attribs[i].isAnyType()){
+								anyCounter += 1;
+								writer
+								.write("\t"
+										+ getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+										+ " " + attribs[i].getParamName()
+										+ Integer.toString(anyCounter)
+										+ ";\n");
+								
+							}
+								
+							else{
+						    writer.write("\t"
+		                                + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+		                                + " " + attribs[i].getParamNameWithoutSymbols()
+		                                + ";\n");
+							}
+						}
 					}
-				}
             }
             
             if (extensionBaseAttrib != null &&
@@ -417,21 +428,38 @@
 									+ getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
 									+ " * pInValue);\n\n");
 					}
-					else {
-                	
-                	
-						writer.write( "\n\t"
-                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                  + " * get"
-                                  + methodName
-                                  + "();\n");
+					else 
+					{
+						if(attribs[i].getAllElement())
+						{
+							writer.write( "\n\t"
+	                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+	                                  + " get"
+	                                  + methodName
+	                                  + "();\n");
 
-						writer.write( "\t"
-                                  + "void set"
-                                  + methodName
-                                  + "("
-                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                  + " * pInValue");
+							writer.write( "\t"
+	                                  + "void set"
+	                                  + methodName
+	                                  + "("
+	                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+	                                  + " pInValue");
+						}
+						else
+						{
+							writer.write( "\n\t"
+	                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+	                                  + " * get"
+	                                  + methodName
+	                                  + "();\n");
+	
+							writer.write( "\t"
+	                                  + "void set"
+	                                  + methodName
+	                                  + "("
+	                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+	                                  + " * pInValue");
+						}
 						if (isElementNillable(i) || isElementOptional(i))
 						{
 						    writer.write(", bool deep = true");



Mime
View raw message