Package com.sun.codemodel.internal

Examples of com.sun.codemodel.internal.JMethod.body()


        var2 = constrc2.param(faultBean, "faultInfo");
        JVar var3 = constrc2.param(Throwable.class, "cause");
        constrc2.javadoc().addParam(var1);
        constrc2.javadoc().addParam(var2);
        constrc2.javadoc().addParam(var3);
        JBlock cb2 = constrc2.body();
        cb2.invoke("super").arg(var1).arg(var3);
        cb2.assign(fr, var2);


        //getFaultInfo() method
View Full Code Here



        //getFaultInfo() method
        JMethod fim = cls.method(JMod.PUBLIC, faultBean, "getFaultInfo");
        fim.javadoc().addReturn().add("returns fault bean: "+faultBean.fullName());
        JBlock fib = fim.body();
        fib._return(fi);
        fault.setExceptionClass(cls);

    }
}
View Full Code Here

        // Generating constructor
        // for e.g:  public ExampleService()
        JMethod constructor1 = cls.constructor(JMod.PUBLIC);
        String constructor1Str = String.format("super(__getWsdlLocation(), %s);", serviceName);
        constructor1.body().directStatement(constructor1Str);

        // Generating constructor
        // for e.g:  public ExampleService(WebServiceFeature ... features)
        if (options.target.isLaterThan(Options.Target.V2_2)) {
            JMethod constructor2 = cls.constructor(JMod.PUBLIC);
View Full Code Here

        // for e.g:  public ExampleService(WebServiceFeature ... features)
        if (options.target.isLaterThan(Options.Target.V2_2)) {
            JMethod constructor2 = cls.constructor(JMod.PUBLIC);
            constructor2.varParam(WebServiceFeature.class, "features");
            String constructor2Str = String.format("super(__getWsdlLocation(), %s, features);", serviceName);
            constructor2.body().directStatement(constructor2Str);
        }

        // Generating constructor
        // for e.g:  public ExampleService(URL wsdlLocation)
        if (options.target.isLaterThan(Options.Target.V2_2)) {
View Full Code Here

        // for e.g:  public ExampleService(URL wsdlLocation)
        if (options.target.isLaterThan(Options.Target.V2_2)) {
            JMethod constructor3 = cls.constructor(JMod.PUBLIC);
            constructor3.param(URL.class, "wsdlLocation");
            String constructor3Str = String.format("super(wsdlLocation, %s);", serviceName);
            constructor3.body().directStatement(constructor3Str);
        }

        // Generating constructor
        // for e.g:  public ExampleService(URL wsdlLocation, WebServiceFeature ... features)
        if (options.target.isLaterThan(Options.Target.V2_2)) {
View Full Code Here

        if (options.target.isLaterThan(Options.Target.V2_2)) {
            JMethod constructor4 = cls.constructor(JMod.PUBLIC);
            constructor4.param(URL.class, "wsdlLocation");
            constructor4.varParam(WebServiceFeature.class, "features");
            String constructor4Str = String.format("super(wsdlLocation, %s, features);", serviceName);
            constructor4.body().directStatement(constructor4Str);
        }

        // Generating constructor
        // for e.g:  public ExampleService(URL wsdlLocation, QName serviceName)
        JMethod constructor5 = cls.constructor(JMod.PUBLIC);
View Full Code Here

        // Generating constructor
        // for e.g:  public ExampleService(URL wsdlLocation, QName serviceName)
        JMethod constructor5 = cls.constructor(JMod.PUBLIC);
        constructor5.param(URL.class, "wsdlLocation");
        constructor5.param(QName.class, "serviceName");
        constructor5.body().directStatement("super(wsdlLocation, serviceName);");

        // Generating constructor
        // for e.g:  public ExampleService(URL, QName, WebServiceFeature ...)
        if (options.target.isLaterThan(Options.Target.V2_2)) {
            JMethod constructor6 = cls.constructor(JMod.PUBLIC);
View Full Code Here

        if (options.target.isLaterThan(Options.Target.V2_2)) {
            JMethod constructor6 = cls.constructor(JMod.PUBLIC);
            constructor6.param(URL.class, "wsdlLocation");
            constructor6.param(QName.class, "serviceName");
            constructor6.varParam(WebServiceFeature.class, "features");
            constructor6.body().directStatement("super(wsdlLocation, serviceName, features);");
        }

        //@WebService
        JAnnotationUse webServiceClientAnn = cls.annotate(cm.ref(WebServiceClient.class));
        writeWebServiceClientAnnotation(service, webServiceClientAnn);
View Full Code Here

        paramDoc.append("A list of ");
        paramDoc.append("{@link " + WebServiceFeature.class.getName() + "}");
        paramDoc.append("to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.");
        ret.add("returns " + retType.name());
        m.varParam(WebServiceFeature.class, "features");
        JBlock body = m.body();
        StringBuffer statement = new StringBuffer("return ");
        statement.append("super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
        statement.append(retType.name());
        statement.append(".class, features);");
        body.directStatement(statement.toString());
View Full Code Here

           return EXAMPLESERVICE_WSDL_LOCATION;
       }
     */
    private void writeGetWsdlLocation(JType retType, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
        JMethod m = cls.method(JMod.PRIVATE|JMod.STATIC , retType, "__getWsdlLocation");
        JConditional ifBlock = m.body()._if(exField.ne(JExpr._null()));
        ifBlock._then()._throw(exField);
        m.body()._return(urlField);
    }

    private void writeDefaultGetPort(Port port, JType retType, JDefinedClass cls) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.