axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaBindingWriter.java
Date Fri, 17 May 2002 02:22:41 GMT
scheu       02/05/16 19:22:40

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaBindingWriter.java
  Log:
  Changes to JavaBindingWriter to move complicated logic out of constructor to make it more
extendable
  
  Revision  Changes    Path
  1.10      +55 -41    xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBindingWriter.java
  
  Index: JavaBindingWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBindingWriter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JavaBindingWriter.java	16 May 2002 22:27:46 -0000	1.9
  +++ JavaBindingWriter.java	17 May 2002 02:22:40 -0000	1.10
  @@ -74,10 +74,13 @@
   * <bindingName>Stub.java, <bindingName>Skeleton.java, <bindingName>Impl.java.
   */
   public class JavaBindingWriter implements Generator {
  -    Generator stubWriter = null;
  -    Generator skelWriter = null;
  -    Generator implWriter = null;
  -    Generator interfaceWriter = null;
  +    protected Generator stubWriter = null;
  +    protected Generator skelWriter = null;
  +    protected Generator implWriter = null;
  +    protected Generator interfaceWriter = null;
  +    protected Emitter emitter;
  +    protected Binding binding;
  +    protected SymbolTable symbolTable;
   
       // This is the dynamic var key for the SEI (Service Endpoint
       // Interface) name.  This name could either be derived from
  @@ -93,42 +96,9 @@
               Emitter emitter,
               Binding binding,
               SymbolTable symbolTable) {
  -
  -        BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
  -
  -        // Interface writer
  -        PortTypeEntry ptEntry =
  -                symbolTable.getPortTypeEntry(binding.getPortType().getQName());
  -        if (ptEntry.isReferenced()) {
  -            interfaceWriter = getJavaInterfaceWriter(
  -                    emitter, ptEntry, bEntry, symbolTable);
  -        }
  -
  -        if (bEntry.isReferenced()) {
  -            // Stub writer
  -            stubWriter = getJavaStubWriter(emitter, bEntry, symbolTable);
  -
  -            // Skeleton and Impl writers
  -            if (emitter.isServerSide()) {
  -                if (emitter.isSkeletonWanted()) {
  -                    skelWriter = getJavaSkelWriter(emitter, bEntry, symbolTable);
  -                }
  -                String fileName = Utils.getJavaLocalName(bEntry.getName())
  -                        + "Impl.java";
  -                try {
  -                // NOTE:  Where does the fileExists method really belong?
  -                    if (!((JavaWriter) stubWriter).fileExists (fileName,
  -                            binding.getQName().getNamespaceURI())) {
  -                        implWriter = getJavaImplWriter(
  -                                emitter, bEntry, symbolTable);
  -                    }
  -                }
  -                catch (IOException ioe) {
  -                    System.err.println(
  -                            JavaUtils.getMessage("fileExistError00", fileName));
  -                }
  -            }
  -        }
  +        this.emitter = emitter;
  +        this.binding = binding;
  +        this.symbolTable = symbolTable;
       } // ctor
   
       /**
  @@ -166,9 +136,10 @@
       }
   
       /**
  -     * Write all the binding bindnigs:  stub, skeleton, and impl.
  +     * Write all the binding bindings:  stub, skeleton, and impl.
        */
       public void generate() throws IOException {
  +        setGenerators();
           if (interfaceWriter != null) {
               interfaceWriter.generate();
           }
  @@ -183,4 +154,47 @@
           }
       } // generate
   
  +    /** 
  +     * setGenerators
  +     * Logic to set the generators that are based on the Binding
  +     * This logic was moved from the constructor so extended interfaces
  +     * can more effectively use the hooks.
  +     */
  +    protected void setGenerators() {
  +        BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
  +        
  +        // Interface writer
  +        PortTypeEntry ptEntry =
  +            symbolTable.getPortTypeEntry(binding.getPortType().getQName());
  +        if (ptEntry.isReferenced()) {
  +            interfaceWriter = getJavaInterfaceWriter(
  +                                 emitter, ptEntry, bEntry, symbolTable);
  +        }
  +        
  +        if (bEntry.isReferenced()) {
  +            // Stub writer
  +            stubWriter = getJavaStubWriter(emitter, bEntry, symbolTable);
  +
  +            // Skeleton and Impl writers
  +            if (emitter.isServerSide()) {
  +                if (emitter.isSkeletonWanted()) {
  +                    skelWriter = getJavaSkelWriter(emitter, bEntry, symbolTable);
  +                }
  +                String fileName = Utils.getJavaLocalName(bEntry.getName())
  +                        + "Impl.java";
  +                try {
  +                // NOTE:  Where does the fileExists method really belong?
  +                    if (!((JavaWriter) stubWriter).fileExists (fileName,
  +                            binding.getQName().getNamespaceURI())) {
  +                        implWriter = getJavaImplWriter(
  +                                emitter, bEntry, symbolTable);
  +                    }
  +                }
  +                catch (IOException ioe) {
  +                    System.err.println(
  +                            JavaUtils.getMessage("fileExistError00", fileName));
  +                }
  +            }
  +        }
  +}
   } // class JavaBindingWriter
  
  
  

Mime
View raw message