FileDocCategorySizeDatePackage
JavaInterfaceWriter.javaAPI DocApache Axis 1.43723Sat Apr 22 18:57:28 BST 2006org.apache.axis.wsdl.toJava

JavaInterfaceWriter

public class JavaInterfaceWriter extends JavaClassWriter
This is Wsdl2java's PortType Writer. It writes the .java file which contains the interface.

Fields Summary
protected javax.wsdl.PortType
portType
Field portType
protected org.apache.axis.wsdl.symbolTable.BindingEntry
bEntry
Field bEntry
Constructors Summary
protected JavaInterfaceWriter(Emitter emitter, org.apache.axis.wsdl.symbolTable.PortTypeEntry ptEntry, org.apache.axis.wsdl.symbolTable.BindingEntry bEntry, org.apache.axis.wsdl.symbolTable.SymbolTable symbolTable)
Constructor.

param
emitter
param
ptEntry
param
bEntry
param
symbolTable


        super(emitter,
                (String) bEntry.getDynamicVar(JavaBindingWriter.INTERFACE_NAME),
                "interface");

        this.portType = ptEntry.getPortType();
        this.bEntry = bEntry;
    
Methods Summary
public voidgenerate()
Override generate method to prevent duplicate interfaces because of two bindings referencing the same portType

throws
IOException


        String fqClass = getPackage() + "." + getClassName();

        // Do not emit the same portType/interface twice
        if (!emitter.getGeneratedFileInfo().getClassNames().contains(fqClass)) {
            super.generate();
        }
    
protected java.lang.StringgetClassText()
Returns "interface ".

return

        return "interface ";
    
protected java.lang.StringgetExtendsText()
Returns "extends java.rmi.Remote ".

return

        return "extends java.rmi.Remote ";
    
protected voidwriteFileBody(java.io.PrintWriter pw)
Write the body of the portType interface file.

param
pw
throws
IOException


        Iterator operations = portType.getOperations().iterator();

        while (operations.hasNext()) {
            Operation operation = (Operation) operations.next();

            writeOperation(pw, operation);
        }
    
protected voidwriteOperation(java.io.PrintWriter pw, javax.wsdl.Operation operation)
This method generates the interface signatures for the given operation.

param
pw
param
operation
throws
IOException


        writeComment(pw, operation.getDocumentationElement(), true);

        Parameters parms = bEntry.getParameters(operation);

        pw.println(parms.signature + ";");