axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaComplexTypeWriter.java
Date Thu, 28 Feb 2002 17:32:09 GMT
tomj        02/02/28 09:32:08

  Modified:    java/src/org/apache/axis/wsdl/toJava
                        JavaComplexTypeWriter.java
  Log:
  Emit an equals functions to ease testing.
  
  Revision  Changes    Path
  1.12      +28 -0     xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaComplexTypeWriter.java
  
  Index: JavaComplexTypeWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaComplexTypeWriter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JavaComplexTypeWriter.java	27 Feb 2002 13:41:28 -0000	1.11
  +++ JavaComplexTypeWriter.java	28 Feb 2002 17:32:08 -0000	1.12
  @@ -257,6 +257,34 @@
               pw.println();
           }
   
  +        pw.println("    public boolean equals(Object obj) {");
  +        pw.println("        // compare elements");
  +        pw.println("        " +  className + " other = (" + className + ") obj;");
  +        pw.println("        return");
  +        for (int i = 0; i < names.size(); i += 2) {
  +            String variableType = (String) names.get(i);
  +            String variable = (String) names.get(i + 1);
  +            
  +            if (variableType.equals("int") ||
  +                variableType.equals("long") ||
  +                variableType.equals("short") ||
  +                variableType.equals("float") ||
  +                variableType.equals("double") ||
  +                variableType.equals("boolean") ||
  +                variableType.equals("byte")) {
  +                pw.print("            " + variable + " == other.get" + 
  +                        Utils.capitalizeFirstChar(variable) + "()");
  +            } else {
  +                pw.print("            " + variable + ".equals(other.get" + 
  +                        Utils.capitalizeFirstChar(variable) + "())");
  +            }
  +            if (i == (names.size() - 2))
  +                pw.println(";");
  +            else
  +                pw.println(" &&");
  +        }
  +        pw.println("    }");
  +
           pw.println("}");
           pw.close();
       } // writeOperation
  
  
  

Mime
View raw message