axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r487312 - /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
Date Thu, 14 Dec 2006 19:25:23 GMT
Author: nadiramra
Date: Thu Dec 14 11:25:22 2006
New Revision: 487312

URL: http://svn.apache.org/viewvc?view=rev&rev=487312
Log:
Code formatting....

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java?view=diff&rev=487312&r1=487311&r2=487312
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
Thu Dec 14 11:25:22 2006
@@ -39,8 +39,7 @@
 public class ClientStubHeaderWriter extends HeaderFileWriter
 {
     protected ArrayList methods;
-    public ClientStubHeaderWriter(WebServiceContext wscontext)
-        throws WrapperFault
+    public ClientStubHeaderWriter(WebServiceContext wscontext) throws WrapperFault
     {
         super(
             WrapperUtils.getClassNameFromFullyQualifiedName(
@@ -57,11 +56,9 @@
         try
         {
             writer.write("/*\n");
-            writer.write(
-                " * This file was auto-generated by the Axis C++ Web Service "
+            writer.write(" * This file was auto-generated by the Axis C++ Web Service "
                     + "Generator (WSDL2Ws)\n");
-            writer.write(
-                " * This file contains Client Stub Class for remote web service \n");
+            writer.write(" * This file contains Client Stub Class for remote web service
\n");
             writer.write(" */\n\n");
         }
         catch (IOException e)
@@ -78,8 +75,7 @@
         try
         {
             writer.write(
-                "public:\n\tSTORAGE_CLASS_INFO "
-                    + classname
+                "public:\n\tSTORAGE_CLASS_INFO " + classname
                     + "(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1);\n");
             writer.write("\tSTORAGE_CLASS_INFO " + classname + "();\n");
         }
@@ -114,48 +110,34 @@
         try
         {
             writer.write("public: \n");
+            
             for (int i = 0; i < methods.size(); i++)
             {
                 minfo = (MethodInfo) this.methods.get(i);
                 boolean isAllTreatedAsOutParams = false;
                 int noOfOutParams = minfo.getOutputParameterTypes().size();
+                
                 //write return type
                 if (0 == noOfOutParams)
-                {
                     writer.write("\tSTORAGE_CLASS_INFO void ");
-                }
-                else
+                else if (1 == noOfOutParams)
                 {
-                    if (1 == noOfOutParams)
-                    {
-                        ParameterInfo returnParam =
-                            (ParameterInfo) minfo
-                                .getOutputParameterTypes()
-                                .iterator()
-                                .next();
-                        String outParamTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returnParam,
wscontext);
-                        if ((outParamTypeName.lastIndexOf ("_Array") > 0)
-                        		||(CUtils.isSimpleType(outParamTypeName)
-								&& (returnParam.isNillable() || returnParam.isOptional())
-								&& !(CUtils.isPointerType(outParamTypeName))))
-                        {
-                        	writer.write(
-                                    "\tSTORAGE_CLASS_INFO "
-                                        + outParamTypeName
-                                        + " * ");
-                        }
-                        else
-                        	writer.write(
-                        			"\tSTORAGE_CLASS_INFO "
-                        			+ outParamTypeName
-                        			+ " ");
-                    }
+                    ParameterInfo returnParam =
+                        (ParameterInfo) minfo.getOutputParameterTypes().iterator().next();
+                    String outParamTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returnParam,
wscontext);
+                    if ((outParamTypeName.lastIndexOf ("_Array") > 0)
+                            ||(CUtils.isSimpleType(outParamTypeName)
+                            && (returnParam.isNillable() || returnParam.isOptional())
+                            && !(CUtils.isPointerType(outParamTypeName))))
+                        writer.write("\tSTORAGE_CLASS_INFO " + outParamTypeName + " * ");
                     else
-                    {
-                        isAllTreatedAsOutParams = true;
-                        writer.write("\tSTORAGE_CLASS_INFO void ");
-                    }
+                        writer.write("\tSTORAGE_CLASS_INFO " + outParamTypeName + " ");
                 }
+                else
+                {
+                    isAllTreatedAsOutParams = true;
+                    writer.write("\tSTORAGE_CLASS_INFO void ");
+                }                
                 //write return type
                 writer.write(minfo.getMethodname() + "(");
 
@@ -164,71 +146,42 @@
                 if (params.hasNext())
                 {
                     ParameterInfo fparam = (ParameterInfo) params.next();
-                    String paramTypeName = WrapperUtils
-                    .getClassNameFromParamInfoConsideringArrays(
-                            fparam,
-                            wscontext);
+                    String paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(fparam,wscontext);
                     if ((paramTypeName.lastIndexOf ("_Array") > 0)
-                    		||(CUtils.isSimpleType(paramTypeName)
-							&& fparam.isNillable()
-							&& !(CUtils.isPointerType(paramTypeName))))
-                    {
-                    	writer.write(
-    	                        paramTypeName
-    	                            + " * Value"
-    	                            + 0);
-                     }
+                            ||(CUtils.isSimpleType(paramTypeName)
+                                    && fparam.isNillable()
+                                    && !(CUtils.isPointerType(paramTypeName))))
+                        writer.write(paramTypeName + " * Value" + 0);
                     else
-                    {
-	                    writer.write(
-	                        paramTypeName
-	                            + " Value"
-	                            + 0);
-                    }
+                        writer.write(paramTypeName + " Value" + 0);
                 }
+                
                 for (int j = 1; params.hasNext(); j++)
                 {
                     ParameterInfo nparam = (ParameterInfo) params.next();
-                    String paramTypeName = WrapperUtils
-                    .getClassNameFromParamInfoConsideringArrays(
-                    		nparam,
-                            wscontext);
+                    String paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,
wscontext);
                     if (CUtils.isSimpleType(paramTypeName)
-							&& nparam.isNillable()
-							&& !(CUtils.isPointerType(paramTypeName)))
-                    {
-                    	writer.write(", "
-                    			+ paramTypeName
-    	                        + " * Value"
-    	                        + j);
-                    }
+                            && nparam.isNillable()
+                            && !(CUtils.isPointerType(paramTypeName)))
+                        writer.write(", " + paramTypeName + " * Value" + j);
                     else
-                    {
-	                    writer.write(", "
-	                    		+ paramTypeName
-	                            + " Value"
-	                            + j);
-                    }
+                        writer.write(", " + paramTypeName + " Value" + j);
                 }
+                
                 if (isAllTreatedAsOutParams)
                 {
                     params = minfo.getOutputParameterTypes().iterator();
                     for (int j = 0; params.hasNext(); j++)
                     {
                         ParameterInfo nparam = (ParameterInfo) params.next();
-                        writer.write(
-                            ", AXIS_OUT_PARAM "
-                                + WrapperUtils
-                                    .getClassNameFromParamInfoConsideringArrays(
-                                    nparam,
-                                    wscontext)
+                        writer.write(", AXIS_OUT_PARAM "
+                                + WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)
                                 + " *OutValue"
                                 + j);
                     }
                 }
                 writer.write(");\n");
             }
-            //damitha
         }
         catch (Exception e)
         {
@@ -253,6 +206,7 @@
             Iterator types = this.wscontext.getTypemap().getTypes().iterator();
             HashSet typeSet = new HashSet();
             String typeName = null;
+            
             while (types.hasNext())
             {
                 atype = (Type) types.next();
@@ -263,15 +217,13 @@
                 if (null != typeName)
                     typeSet.add(typeName);
             }
+            
             Iterator itr = typeSet.iterator();
             while (itr.hasNext())
             {
-                writer.write(
-                    "#include \""
-                        + itr.next().toString()
-                        + CUtils.CPP_HEADER_SUFFIX
-                        + "\"\n");
+                writer.write("#include \"" + itr.next().toString() + CUtils.CPP_HEADER_SUFFIX
+ "\"\n");
             }
+            
             //Method to print the Fault Exception headers
             //writeFaultHeaders();
             writer.write("\n");
@@ -302,11 +254,8 @@
                     FaultInfo info = (FaultInfo) fault.next();
                     faultInfoName = info.getFaultInfo();
                     writer.write(
-                        "#include \"Axis"
-                            + faultInfoName.toString()
-                            + "Exception"
-                            + CUtils.CPP_HEADER_SUFFIX
-                            + "\"\n");
+                        "#include \"Axis" + faultInfoName.toString()
+                            + "Exception" + CUtils.CPP_HEADER_SUFFIX + "\"\n");
                 }
                 writer.write("\n");
             }



---------------------------------------------------------------------
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