axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r387688 - /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
Date Wed, 22 Mar 2006 02:08:47 GMT
Author: nadiramra
Date: Tue Mar 21 18:08:44 2006
New Revision: 387688

URL: http://svn.apache.org/viewcvs?rev=387688&view=rev
Log:
Format code so more readable - align braces, etc.

Modified:
    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/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=387688&r1=387687&r2=387688&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 Mar 21 18:08:44 2006
@@ -55,18 +55,17 @@
     {
         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");
+
             if (type.isSimpleType())
-            {
                 writeSimpleTypeWithEnumerations();
-            } else
+            else
             {
                 writePreprocessorStatements();
 
@@ -77,13 +76,7 @@
                     this.writer.write(" : public SoapFaultException");
                 this.writer.write("\n{\n");
                 writeAttributes();
-
-                /**
-                 * Dushshantha: Call writeGetSetMethods() method.
-                 */
-
                 writeGetSetMethods();
-                //..................................
                 writeConstructors();
                 writeDestructors();
                 writeDeepCopyFlags();
@@ -94,9 +87,9 @@
             writer.flush();
             writer.close();
             if (WSDL2Ws.verbose)
-                System.out.println(getFilePath().getAbsolutePath()
-                        + " created.....");
-        } catch (IOException e)
+                System.out.println(getFilePath().getAbsolutePath() + " created.....");
+        } 
+        catch (IOException e)
         {
             e.printStackTrace();
             throw new WrapperFault(e);
@@ -109,14 +102,10 @@
     private void writeDeepCopyFlags() throws WrapperFault
     {
         if (type.isArray())
-        {
             return;
-        }
         
         if (attribs.length == 0)
-        {
             return;
-        }
         
         try
         {
@@ -125,15 +114,20 @@
             {
                 Type type = attribs[i].getType();
                 boolean isPointerType = false;
+                
                 if (type.isSimpleType())
-                {
                     isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));

-                }
                 else
-                {
                     isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
-                }
-                if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()) &&
!attribs[i].isArray() &&(isElementNillable(i) || isElementOptional(i) || isPointerType
|| attribs[i].getChoiceElement() || attribs[i].getAllElement()))
+
+                if ((attribs[i].isSimpleType() 
+                        || attribs[i].getType().isSimpleType()) 
+                        && !attribs[i].isArray() 
+                        && (isElementNillable(i) 
+                                || isElementOptional(i) 
+                                || isPointerType 
+                                || attribs[i].getChoiceElement() 
+                                || attribs[i].getAllElement()))
                 {
                     if (!foundDeepCopyType)
                     {
@@ -160,57 +154,48 @@
 
             Vector restrictionData = type.getEnumerationdata();
             if (restrictionData == null)
-            {
                 return;
-            }
+
             TypeEntry baseEType = (TypeEntry) restrictionData.firstElement();
             QName baseType = baseEType.getQName();
             if (!CUtils.isSimpleType(baseType))
-            {
                 return;
-            }
+
             String langTypeName = CUtils.getclass4qname(baseType);
             writer.write("typedef ");
-            if (CUtils.isPointerType(CUtils.getclass4qname(baseType)) || "xsd__base64Binary".equals(CUtils.getclass4qname(baseType))
|| "xsd__hexBinary".equals(CUtils.getclass4qname(baseType)))
+            if (CUtils.isPointerType(CUtils.getclass4qname(baseType)) 
+                    || "xsd__base64Binary".equals(CUtils.getclass4qname(baseType)) 
+                    || "xsd__hexBinary".equals(CUtils.getclass4qname(baseType)))
             {
                 writer.write(langTypeName + " " + classname + ";\n");
-                writer.write("typedef " + langTypeName + "_Array " + classname
-                        + "_Array;\n");
+                writer.write("typedef " + langTypeName + "_Array " + classname + "_Array;\n");
+                
                 for (int i = 1; i < restrictionData.size(); i++)
                 {
                     QName value = (QName) restrictionData.elementAt(i);
                     if ("enumeration".equals(value.getLocalPart()))
                     {
-                        //writer.write("static const "+classname+"
-                        // "+classname+"_"+value.getNamespaceURI()+" = \""+
-                        // value.getNamespaceURI()+"\";\n");
-                        //Samisa 23/08/2004
                         writer.write("static const " + classname + " "
                                 + classname + "_" + value.getNamespaceURI()
                                 + " = \"" + value.getNamespaceURI() + "\";\n");
-                        //Samisa
-                    } else
+                    } 
+                    else if ("maxLength".equals(value.getLocalPart()))
                     {
-                        if ("maxLength".equals(value.getLocalPart()))
-                        {
-                            writer.write("static const int " + classname
-                                    + "_MaxLength = " + value.getNamespaceURI()
-                                    + ";\n");
-                        } else
-                        {
-                            if ("minLength".equals(value.getLocalPart()))
-                            {
-                                writer.write("static const int " + classname
-                                        + "_MinLength = "
-                                        + value.getNamespaceURI() + ";\n");
-                            }
-                        }
+                        writer.write("static const int " + classname
+                                + "_MaxLength = " + value.getNamespaceURI() + ";\n");
+                    } 
+                    else if ("minLength".equals(value.getLocalPart()))
+                    {
+                        writer.write("static const int " + classname
+                                + "_MinLength = " + value.getNamespaceURI() + ";\n");
                     }
                 }
-            } else if ("int".equals(baseType.getLocalPart()))
+            } 
+            else if ("int".equals(baseType.getLocalPart()))
             {
                 if (restrictionData.size() > 1)
-                { //there are enumerations or min/maxInclusive
+                {
+                    //there are enumerations or min/maxInclusive
                     boolean isEnum = false;
                     boolean hasRestrictionItems = false;
                     for (int i = 1; i < restrictionData.size(); i++)
@@ -220,56 +205,43 @@
                         {
                             isEnum = true;
                             if (i > 1)
-                            {
                                 writer.write(", ");
-                            } else
-                            {
+                            else
                                 writer.write(" enum { ");
-                            }
+
                             writer.write("ENUM" + classname.toUpperCase() + "_"
                                     + value.getNamespaceURI() + "="
                                     + value.getNamespaceURI());
-                        } else if ("minInclusive".equals(value.getLocalPart()))
+                        } 
+                        else if ("minInclusive".equals(value.getLocalPart()))
                         {
                             hasRestrictionItems = true;
                             if (i <= 1)
-                            {
-                                writer.write(langTypeName + " " + classname
-                                        + ";\n");
-                            }
+                                writer.write(langTypeName + " " + classname + ";\n");
+                            
                             writer.write("static const int " + classname
-                                    + "_MinInclusive = "
-                                    + value.getNamespaceURI() + ";\n");
-                        } else if ("maxInclusive".equals(value.getLocalPart()))
+                                    + "_MinInclusive = " + value.getNamespaceURI() + ";\n");
+                        } 
+                        else if ("maxInclusive".equals(value.getLocalPart()))
                         {
                             hasRestrictionItems = true;
                             if (i <= 1)
-                            {
-                                writer.write(langTypeName + " " + classname
-                                        + ";\n");
-                            }
+                                writer.write(langTypeName + " " + classname + ";\n");
+
                             writer.write("static const int " + classname
-                                    + "_MaxInclusive = "
-                                    + value.getNamespaceURI() + ";\n");
+                                    + "_MaxInclusive = " + value.getNamespaceURI() + ";\n");
                         }
                     }
+                    
                     if (isEnum)
-                    {
                         writer.write("} " + classname + ";\n");
-                    } else
-                    {
-                        if (!hasRestrictionItems)
-                        {
-                            writer
-                                    .write(langTypeName + " " + classname
-                                            + ";\n");
-                        }
-                    }
-                } else
-                {
+                    else if (!hasRestrictionItems)
+                        writer.write(langTypeName + " " + classname + ";\n");
+                } 
+                else
                     writer.write(langTypeName + " " + classname + ";\n");
-                }
-            } else
+            } 
+            else
             {
                 writer.write(langTypeName + " " + classname + ";\n");
                 for (int i = 1; i < restrictionData.size(); i++)
@@ -277,18 +249,14 @@
                     QName value = (QName) restrictionData.elementAt(i);
                     if ("enumeration".equals(value.getLocalPart()))
                     {
-                        //writer.write("static const "+classname+"
-                        // "+classname+"_"+value.getNamespaceURI()+" = "+
-                        // value.getNamespaceURI()+";\n");
-                        //Samisa 23/08/2004
                         writer.write("static const " + classname + " "
                                 + classname + "_" + value.getNamespaceURI()
                                 + " = \"" + value.getNamespaceURI() + "\";\n");
-                        //Samisa
                     }
                 }
             }
-        } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -299,9 +267,8 @@
         int anyCounter = 0;
         
         if (type.isArray())
-        {
             return;
-        }
+
         try
         {
             writer.write("public:\n");
@@ -309,88 +276,68 @@
             {
                 attribs[i].setParamName( CUtils.sanitiseAttributeName( classname, attribs[i].getParamName()));
                 
-                // FJP Nillable vv
-                if (isElementNillable(i) || attribs[i].isArray() || isElementOptional(i)
&& !attribs[i].getAllElement())
+                if (isElementNillable(i) 
+                        || attribs[i].isArray() 
+                        || isElementOptional(i) 
+                        && !attribs[i].getAllElement())
                 {
-                                        
-                    if(attribs[i].isAnyType()){
+                    if(attribs[i].isAnyType())
+                    {
                         anyCounter += 1;
-                            writer
-                        .write("\t"
+                        writer.write("\t"
                                 + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
                                 + " * " + attribs[i].getParamName()
                                 + Integer.toString(anyCounter)
                                 + ";\n");
                     }
-                    else
+                    else if( attribs[i].isArray())
                     {
-                        if( attribs[i].isArray())
-                        {
-                            String paramName = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
-                            if (!paramName.endsWith("*"))
-                            {
-                                paramName += " *";
-                            }
-                            
-                            if (!attribs[i].isSimpleType() && attribs[i].getType().isSimpleType())
-                            {
-                                writer.write("\t");
-                            }
-                            else
-                            {
-                                writer.write("\tclass ");
-                            }
-                            writer.write(paramName
-                                     + " " + attribs[i].getParamName()
-                                     + ";\n");
-                            
-                        }
+                        String paramName = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
+                        if (!paramName.endsWith("*"))
+                            paramName += " *";
+                        
+                        if (!attribs[i].isSimpleType() && attribs[i].getType().isSimpleType())
+                            writer.write("\t");
                         else
-                        {
-                            if(attribs[i].getChoiceElement()&& !isElementNillable(i))
-                                writer.write("\t"
-                                     + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                     + " " + attribs[i].getParamName()
-                                     + ";\n");
-                            else
-                                writer.write("\t"
-                                         + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                         + " * " + attribs[i].getParamName()
-                                         + ";\n");
-                            
-                        }
-                    }
-                } else 
-                    {
-                        if(attribs[i].getAllElement() || attribs[i].getChoiceElement() )
-                        {
-                            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");
-                            }
-                        }
+                            writer.write("\tclass ");
+
+                        writer.write(paramName + " " + attribs[i].getParamName() + ";\n");
                     }
+                    else if(attribs[i].getChoiceElement() && !isElementNillable(i))
+                        writer.write("\t"
+                             + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                             + " " + attribs[i].getParamName()
+                             + ";\n");
+                    else
+                        writer.write("\t"
+                                 + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                 + " * " + attribs[i].getParamName()
+                                 + ";\n");
+                } 
+                else if(attribs[i].getAllElement() || attribs[i].getChoiceElement() )
+                {
+                    writer.write("\t"
+                             + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                             + " " + attribs[i].getParamName()
+                             + ";\n");
+                }
+                else 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 &&
@@ -401,7 +348,8 @@
                              + " "
                              + extensionBaseAttrib.getParamNameWithoutSymbols() + ";\n");
             }
-        } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -415,9 +363,7 @@
         int anyCounter = 0;
         
         if (type.isArray())
-        {
             return;
-        }
         
         try
         {
@@ -430,28 +376,21 @@
                     String localMethodName = methodName.substring( 0, methodName.length()
- 1);
                     
                     if( localMethodName.equals( classname))
-                    {
                         methodName = localMethodName; 
-                    }
                 }
                 
-// FJP Nillable vv
                 if (isElementNillable(i)  || attribs[i].isArray() || isElementOptional(i))
                 {
-                    if ( attribs[i].isAnyType()){
+                    if ( attribs[i].isAnyType())
+                    {
                         anyCounter += 1;
-                        writer
-                            .write("\t"
+                        writer.write("\t"
                                     + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
                                     + " * get"
-                                    + methodName
-                                    + Integer.toString(anyCounter)
-                                    + "();\n");
+                                    + methodName + Integer.toString(anyCounter) + "();\n");
 
-                        writer
-                            .write("\t"
-                                    + "void set"
-                                    + methodName
+                        writer.write("\t"
+                                    + "void set" + methodName
                                     + Integer.toString(anyCounter)
                                     + "("
                                     + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
@@ -463,142 +402,97 @@
                         {
                             String paramName = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
                             if (!paramName.endsWith("*"))
-                            {
                                 paramName += " *";
+
+                            if (attribs[i].isArray())
+                            {
+                                writer.write( "\n\t" + paramName + " get" + methodName +
"();\n");
+
+                                writer.write( "\t" + "void set" + methodName + "(" + paramName
+ " pInValue");
                             }
-                            if (attribs[i].isArray()){
+                            else if (isElementNillable(i))
+                            {
                                 writer.write( "\n\t"
-                                          + paramName
-                                          + " get"
-                                          + methodName
-                                          + "();\n");
+                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                  + " * get" + methodName + "();\n");
 
                                 writer.write( "\t"
-                                          + "void set"
-                                          + methodName
-                                          + "("
-                                          + paramName
-                                          + " pInValue");
+                                  + "void set" + methodName + "("
+                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                  + " * pInValue");
                             }
-                            else{
-                                if (isElementNillable(i)){
-                                    writer.write( "\n\t"
-                                      + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                      + " * get"
-                                      + methodName
-                                      + "();\n");
-
-                                    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");
-                                }
+                            else
+                            {
+                                writer.write( "\n\t"
+                                          + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                          + " get" + methodName + "();\n");
+
+                                writer.write( "\t"
+                                          + "void set" + methodName + "("
+                                          + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                          + " pInValue");
                             }
                         }
                         else
                         {
                             writer.write( "\n\t"
                                       + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                      + " * get"
-                                      + methodName
-                                      + "();\n");
+                                      + " * get" + methodName + "();\n");
     
                             writer.write( "\t"
-                                      + "void set"
-                                      + methodName
-                                      + "("
+                                      + "void set" + methodName + "("
                                       + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
                                       + " * pInValue");
                         }
-                        if ((isElementNillable(i) || isElementOptional(i) || attribs[i].getAllElement()
|| attribs[i].getChoiceElement() ) && !attribs[i].isArray())
-                        {
+                        
+                        if ((isElementNillable(i) || isElementOptional(i) 
+                                || attribs[i].getAllElement() || attribs[i].getChoiceElement()
) 
+                             && !attribs[i].isArray())
                             writer.write(", bool deep = true");
-                        }
+                        
                         writer.write(");\n");
                     }
                 }
-                else
+                else if ( attribs[i].isAnyType())
                 {
-// FJP Nillable ^^
-                    if ( attribs[i].isAnyType()){
-                        anyCounter += 1;
-                        writer
-                            .write("\t"
-                                    + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                    + " get"
-                                    + methodName
-                                    + Integer.toString(anyCounter)
-                                    + "();\n");
+                    anyCounter += 1;
+                    writer.write("\t"
+                                + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                + " get" + methodName + Integer.toString(anyCounter) + "();\n");
 
-                        writer
-                            .write("\t"
-                                    + "void set"
-                                    + methodName
-                                    + Integer.toString(anyCounter)
-                                    + "("
-                                    + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                    + "  InValue);\n\n");
-                    }
-                    else {
+                    writer.write("\t"
+                                + "void set" + methodName + Integer.toString(anyCounter)
+ "("
+                                + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                + "  InValue);\n\n");
+                }
+                else 
+                {
+                    writer.write("\n\t"
+                                + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                + " get" + methodName + "();\n");
+
+                    writer.write("\t"
+                                + "void set" + methodName + "("
+                                + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+                                + " InValue");
                     
+                    Type type = attribs[i].getType();
+                    boolean isPointerType = false;
                     
+                    if (type.isSimpleType())
+                        isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));

+                    else
+                        isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
                     
-                    /**
-                     * Dushshantha: Write setter
-                     */
-
-                        writer.write("\n\t"
-                                    + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                    + " get"
-                                    + methodName
-                                    + "();\n");
-
-                    /**
-                     * Dushshantha: Write getter
-                     */
-
-                        writer.write("\t"
-                                    + "void set"
-                                    + methodName
-                                    + "("
-                                    + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-                                    + " InValue");
-                        Type type = attribs[i].getType();
-                        boolean isPointerType = false;
-                        if (type.isSimpleType())
-                        {
-                            isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));

-                        }
-                        else
-                        {
-                            isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
-                        }
-                        
-                        if ( (attribs[i].getAllElement() || attribs[i].getChoiceElement()
|| isPointerType) && (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
-                        {
-                            writer.write(", bool deep = true");
-                        }
-                        writer.write(");\n");
-                    }
+                    if ( (attribs[i].getAllElement() || attribs[i].getChoiceElement() ||
isPointerType) 
+                         && (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
+                        writer.write(", bool deep = true");
+                    
+                    writer.write(");\n");
                 }
             }
-        } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -611,7 +505,8 @@
             writer.write("\n\t" + classname + "();\n");
             writer.write("\t" + classname + "(const " + classname + " & original);\n");
             writeReset();
-       } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -621,7 +516,8 @@
         try
         {
             writer.write("\n\tvoid reset();\n");
-       } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -635,7 +531,8 @@
                 writer.write("\tvirtual ~" + classname + "() throw();\n");
             else
                 writer.write("\tvirtual ~" + classname + "();\n");
-        } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -652,17 +549,13 @@
 
     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)
         {
@@ -685,29 +578,29 @@
         {
             writer.write("#include <axis/AxisUserAPI.hpp>\n");
             writer.write("#include <axis/AxisUserAPIArrays.hpp>\n");
+            
             if (this.type.isFault())
             {
                 writer.write("#include <axis/SoapFaultException.hpp>\n");
                 writer.write("using namespace std;\n");
             }
+            
             writer.write("AXIS_CPP_NAMESPACE_USE \n\n");
             HashSet typeSet = new HashSet();
             for (int i = 0; i < attribs.length; i++)
             {
-                if ((attribs[i].isArray()) && !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
-                {
+                if ((attribs[i].isArray()) && 
+                        !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
                     typeSet.add(attribs[i].getTypeName() + "_Array");
-                }
+
                 if (!(attribs[i].isSimpleType() || attribs[i].isAnyType()))
-                {
                     typeSet.add(attribs[i].getTypeName());
-                }
             }
+            
             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");
             }
 
             //Local name and the URI for the type
@@ -722,19 +615,20 @@
             typeSet = new HashSet();
             for (int i = 0; i < attribs.length; i++)
             {
-                if (!attribs[i].isArray() && !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
+                if (!attribs[i].isArray() && 
+                        !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
                         && !attribs[i].isAnyType())
-                {
                     typeSet.add(attribs[i].getTypeName());
-                }
             }
+            
             itr = typeSet.iterator();
             while (itr.hasNext())
             {
                 writer.write("class " + itr.next().toString() + ";\n");
             }
 
-        } catch (IOException e)
+        } 
+        catch (IOException e)
         {
             throw new WrapperFault(e);
         }



Mime
View raw message