1 16 package org.apache.axis.wsdl.toJava; 17 18 import org.apache.axis.wsdl.symbolTable.BindingEntry; 19 import org.apache.axis.wsdl.symbolTable.Parameters; 20 import org.apache.axis.wsdl.symbolTable.PortTypeEntry; 21 import org.apache.axis.wsdl.symbolTable.SymbolTable; 22 23 import javax.wsdl.Operation; 24 import javax.wsdl.PortType; 25 import java.io.IOException ; 26 import java.io.PrintWriter ; 27 import java.util.Iterator ; 28 29 33 public class JavaInterfaceWriter extends JavaClassWriter { 34 35 36 protected PortType portType; 37 38 39 protected BindingEntry bEntry; 40 41 49 protected JavaInterfaceWriter(Emitter emitter, PortTypeEntry ptEntry, 50 BindingEntry bEntry, 51 SymbolTable symbolTable) { 52 53 super(emitter, 54 (String ) bEntry.getDynamicVar(JavaBindingWriter.INTERFACE_NAME), 55 "interface"); 56 57 this.portType = ptEntry.getPortType(); 58 this.bEntry = bEntry; 59 } 61 67 public void generate() throws IOException { 68 69 String fqClass = getPackage() + "." + getClassName(); 70 71 if (!emitter.getGeneratedFileInfo().getClassNames().contains(fqClass)) { 73 super.generate(); 74 } 75 } 77 82 protected String getClassText() { 83 return "interface "; 84 } 86 91 protected String getExtendsText() { 92 return "extends java.rmi.Remote "; 93 } 95 101 protected void writeFileBody(PrintWriter pw) throws IOException { 102 103 Iterator operations = portType.getOperations().iterator(); 104 105 while (operations.hasNext()) { 106 Operation operation = (Operation) operations.next(); 107 108 writeOperation(pw, operation); 109 } 110 } 112 119 protected void writeOperation(PrintWriter pw, Operation operation) 120 throws IOException { 121 122 writeComment(pw, operation.getDocumentationElement(), true); 123 124 Parameters parms = bEntry.getParameters(operation); 125 126 pw.println(parms.signature + ";"); 127 } } | Popular Tags |