Package com.sun.codemodel

Examples of com.sun.codemodel.JMethod.type()


        JDefinedClass echo = model._getClass("jsr181.echo.wrapped.EchoPortType");
        assertNotNull(echo);
       
        JMethod method = echo.getMethod("echo", new JType[] { model.ref(String.class) });
        assertNotNull(method);
        assertEquals( model.ref(String.class), method.type() );
       
        assertNotNull(model._getClass("jsr181.echo.wrapped.EchoClient"));
        assertNotNull(model._getClass("jsr181.echo.wrapped.EchoImpl"));
    }
   
View Full Code Here


        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("echo.wrapped.unbounded.EchoPortType");
        assertNotNull(echo);
       
        JMethod jm = echo.methods().iterator().next();
        assertEquals("java.util.List<java.lang.String>", jm.type().fullName());
    }
   
    public void testEchoUnboundedWithKeyword() throws Exception
    {
        Wsdl11Generator generator = new Wsdl11Generator();
View Full Code Here

        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("echo.wrapped.keyword.EchoPortType");
        assertNotNull(echo);
       
        JMethod jm = echo.methods().iterator().next();
        assertEquals("java.util.List<java.lang.String>", jm.type().fullName());
    }
   
    public void testWrappedMTOMEcho() throws Exception
    {
        Wsdl11Generator generator = new Wsdl11Generator();
View Full Code Here

        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("echo.wrapped.mtom.EchoPortType");
        assertNotNull(echo);
       
        JMethod jm = echo.methods().iterator().next();
        assertEquals("javax.activation.DataHandler", jm.type().fullName());
    }
}
View Full Code Here

        final JDefinedClass _interface = outline.getClassFactory().createInterface(jpackage, "Visitable", null);
    setOutput( _interface );
    final JMethod _method = getOutput().method(JMod.PUBLIC, void.class, "accept");
    final JTypeVar returnType = _method.generify("R");
    final JTypeVar exceptionType = _method.generify("E", Throwable.class);
    _method.type(returnType);
    _method._throws(exceptionType);
    final JClass narrowedVisitor = visitor.narrow(returnType, exceptionType);
    _method.param(narrowedVisitor, "aVisitor");
       
        for(ClassOutline classOutline : classes) {
View Full Code Here

                            + fo.getPropertyInfo().getName(true);

        JMethod method = dc.getMethod(getterName, new JType[0]);
        JDocComment doc = method.javadoc();
        int mods = method.mods().getValue();
        JType mtype = method.type();
        if (remapRet) {
            mtype = mtype.unboxify();
        }

        if (LOG.isLoggable(Level.FINE)) {
View Full Code Here

        String typeName = type.fullName();

        String getterName = ("java.lang.Boolean".equals(typeName) ? "is" : "get")
                            + fo.getPropertyInfo().getName(true);
        JMethod method = dc.getMethod(getterName, new JType[0]);
        JType mtype = method.type();
        String setterName = "set" + fo.getPropertyInfo().getName(true);
        method = dc.getMethod(setterName, new JType[] {mtype});
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Updating setter: " + setterName);
        }
View Full Code Here

        // remove existing method and define new one
        dc.methods().remove(method);

        int mods = method.mods().getValue();
        mtype = mtype.unboxify();
        method = dc.method(mods, method.type(), setterName);
       
        method.javadoc().append(doc);
        method.param(mtype, "value");

        JFieldRef fr = JExpr.ref(fieldName);
View Full Code Here

        method.param(mtype, "value");

        JFieldRef fr = JExpr.ref(fieldName);
        method.body().assign(fr, JExpr.ref("value"));
       
        method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
        method.body().assign(fr, JExpr._null());
       
        method = dc.getMethod("isSet" + fo.getPropertyInfo().getName(true), new JType[0]);
        if (method != null) {
            //move to end
View Full Code Here

                            + fo.getPropertyInfo().getName(true);

        JMethod method = dc.getMethod(getterName, new JType[0]);
        JDocComment doc = method.javadoc();
        int mods = method.mods().getValue();
        JType mtype = method.type();
        if (remapRet) {
            mtype = mtype.unboxify();
        }

        if (LOG.isLoggable(Level.FINE)) {
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.