1 55 package org.jboss.axis.wsdl.toJava; 56 57 import org.jboss.axis.wsdl.symbolTable.BindingEntry; 58 import org.jboss.axis.wsdl.symbolTable.Parameters; 59 import org.jboss.axis.wsdl.symbolTable.PortTypeEntry; 60 import org.jboss.axis.wsdl.symbolTable.SymbolTable; 61 62 import javax.wsdl.Operation; 63 import javax.wsdl.PortType; 64 import java.io.IOException ; 65 import java.io.PrintWriter ; 66 import java.util.Iterator ; 67 68 72 public class JavaInterfaceWriter extends JavaClassWriter 73 { 74 protected PortType portType; 75 protected BindingEntry bEntry; 76 77 80 protected JavaInterfaceWriter(Emitter emitter, 81 PortTypeEntry ptEntry, BindingEntry bEntry, SymbolTable symbolTable) 82 { 83 super(emitter, (String )bEntry.getDynamicVar(JavaBindingWriter.INTERFACE_NAME), "interface"); 84 this.portType = ptEntry.getPortType(); 85 this.bEntry = bEntry; 86 } 88 92 public void generate() throws IOException 93 { 94 String fqClass = getPackage() + "." + getClassName(); 95 96 if (!emitter.getGeneratedFileInfo().getClassNames().contains(fqClass)) 98 { 99 super.generate(); 100 } 101 } 103 106 protected String getClassText() 107 { 108 return "interface "; 109 } 111 114 protected String getExtendsText() 115 { 116 return "extends java.rmi.Remote "; 117 } 119 122 protected void writeFileBody(PrintWriter pw) throws IOException 123 { 124 Iterator operations = portType.getOperations().iterator(); 125 while (operations.hasNext()) 126 { 127 Operation operation = (Operation)operations.next(); 128 writeOperation(pw, operation); 129 } 130 } 132 135 protected void writeOperation(PrintWriter pw, Operation operation) throws IOException 136 { 137 writeComment(pw, operation.getDocumentationElement()); 138 Parameters parms = bEntry.getParameters(operation); 139 pw.println(parms.signature + ";"); 140 } 142 } | Popular Tags |