axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/wsdl/toJava Emitter.java JavaGeneratorFactory.java
Date Fri, 09 Apr 2004 18:37:05 GMT
gawor       2004/04/09 11:37:05

  Modified:    java/src/org/apache/axis/wsdl/toJava Emitter.java
                        JavaGeneratorFactory.java
  Log:
  a way to disable name mangling in case of anonymous type collisions
  
  Revision  Changes    Path
  1.68      +18 -0     ws-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- Emitter.java	8 Apr 2004 13:09:06 -0000	1.67
  +++ Emitter.java	9 Apr 2004 18:37:04 -0000	1.68
  @@ -89,6 +89,8 @@
       
       private boolean bBuildFileGeneration = false;
   
  +    private boolean typeCollisionProtection = true;
  +
       /** Field packageName */
       private String packageName = null;
   
  @@ -882,4 +884,20 @@
       public void generateAll(boolean all) {
           setAllWanted(all);
       }    // generateAll
  +    
  +    /**
  +     * Get the type collision protection setting
  +     * @return
  +     */
  +    public boolean isTypeCollisionProtection(){
  +        return this.typeCollisionProtection;
  +    }
  +    
  +    /**
  +     * Enable/disable type collision protection
  +     * @param value
  +     */
  +    public void setTypeCollisionProtection(boolean value){
  +        this.typeCollisionProtection = value;
  +    }
   }
  
  
  
  1.50      +16 -14    ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java
  
  Index: JavaGeneratorFactory.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- JavaGeneratorFactory.java	8 Apr 2004 13:09:06 -0000	1.49
  +++ JavaGeneratorFactory.java	9 Apr 2004 18:37:04 -0000	1.50
  @@ -608,21 +608,23 @@
                   typeQName = new QName(typeQName.getNamespaceURI(),
                           localName);
   
  -                // If there is already an existing type,
  -                // there will be a collision.
  -                // If there is an existing anon type,
  -                // there will be a  collision.
  -                // In both cases, mangle the name.
  -                symbolTable.getType(typeQName);
  -
  -                if (anonQNames.get(typeQName) != null) {
  -                    localName += "Type" + uniqueNum++;
  -                    typeQName =
  -                    new QName(typeQName.getNamespaceURI(),
  -                            localName);
  +                if (emitter.isTypeCollisionProtection()) {
  +                    // If there is already an existing type,
  +                    // there will be a collision.
  +                    // If there is an existing anon type,
  +                    // there will be a  collision.
  +                    // In both cases, mangle the name.
  +                    symbolTable.getType(typeQName);
  +                    
  +                    if (anonQNames.get(typeQName) != null) {
  +                        localName += "Type" + uniqueNum++;
  +                        typeQName =
  +                            new QName(typeQName.getNamespaceURI(),
  +                                      localName);
  +                    }
  +                    
  +                    anonQNames.put(typeQName, typeQName);
                   }
  -
  -                anonQNames.put(typeQName, typeQName);
   
                   // Now set the name with the constructed qname
                   tEntry.setName(emitter.getJavaName(typeQName));
  
  
  

Mime
View raw message