Package com.sun.codemodel

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


    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) {
            classOutline.implClass._implements(getOutput());
        }
    }
View Full Code Here


        for(ClassOutline classOutline : classes) {
            if (!classOutline.target.isAbstract()) {
                // add the bean to the visitor
                JMethod vizMethod = getOutput().method(JMod.PUBLIC, returnType, "visit");
                vizMethod._throws(exceptionType);
                vizMethod.param(classOutline.implClass, "aBean");
            }
        }
    }
}
View Full Code Here

        for (ClassOutline classOutline : classes) {
            if (!classOutline.target.isAbstract()) {
                // add the bean to the traverser
                JMethod traverseMethod = getOutput().method(JMod.PUBLIC, void.class, "traverse");
                traverseMethod._throws(exceptionType);
                traverseMethod.param(classOutline.implClass, "aBean");
                traverseMethod.param(narrowedVisitor, "aVisitor");
            }
        }
        jpackage.remove(scratch);
    }
View Full Code Here

            if (!classOutline.target.isAbstract()) {
                // add the bean to the traverser
                JMethod traverseMethod = getOutput().method(JMod.PUBLIC, void.class, "traverse");
                traverseMethod._throws(exceptionType);
                traverseMethod.param(classOutline.implClass, "aBean");
                traverseMethod.param(narrowedVisitor, "aVisitor");
            }
        }
        jpackage.remove(scratch);
    }
}
View Full Code Here

        for (ClassOutline classOutline : classes) {
            if (!classOutline.target.isAbstract()) {
                // add the method to the base vizzy
                JMethod _method = getOutput().method(JMod.PUBLIC, returnType, "visit");
                _method._throws(exceptionType);
        _method.param(classOutline.implClass, "aBean");
        _method.body()._return(JExpr._null());
            }
        }
    }
}
View Full Code Here

        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);
        method.body().assign(fr, JExpr.ref("value"));
       
        method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
View Full Code Here

        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);
        method.body().assign(fr, JExpr.ref("value"));
       
        method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
View Full Code Here

        kmlClass.boxify().staticInvoke(generateUnMarshallerFileFile).arg(fileunmarshallVar).arg(JExpr.FALSE));
  }

  private JMethod generateValidateMethod(final ClassOutlineImpl cc) {
    final JMethod generateValidate = cc.implClass.method(JMod.PRIVATE | JMod.STATIC, cc.implClass.owner().BOOLEAN, "validate");
    final JVar unmarshallValidateVar = generateValidate.param(JMod.FINAL, jaxbUnmarshallerClass, "unmarshaller");
    final JTryBlock tryValidateBlock = generateValidate.body()._try();
    final JVar schemaFactoryVar = tryValidateBlock.body().decl(schemaFactoryClass, "sf",
        schemaFactoryClass.boxify().staticInvoke("newInstance").arg(xmlConstantsClass.boxify().staticRef("W3C_XML_SCHEMA_NS_URI")));
    final JVar schemaFileVar = tryValidateBlock.body().decl(fileClass, "schemaFile", JExpr._new(fileClass).arg(schemaLocationVar));
    final JVar schemaVar = tryValidateBlock.body().decl(schemaClass, "schema", schemaFactoryVar.invoke("newSchema").arg(schemaFileVar));
View Full Code Here

    final JClass xmladapter = outline.getCodeModel().ref(XmlAdapter.class).narrow(Integer.class).narrow(Boolean.class);
    booleanConverter._extends(xmladapter);
   
    // toString
    final JMethod unmarshal = booleanConverter.method(JMod.PUBLIC, Boolean.class, "unmarshal");
    final JVar stringConstructorArg = unmarshal.param(JMod.FINAL, Integer.class, "i");
    unmarshal.annotate(Override.class);
    unmarshal._throws(Exception.class);
    unmarshal.body()._return(JOp.cond(stringConstructorArg.eq(JExpr._null()), JExpr._null(), stringConstructorArg.eq(JExpr.lit(1))));
   
    // toString
View Full Code Here

    unmarshal._throws(Exception.class);
    unmarshal.body()._return(JOp.cond(stringConstructorArg.eq(JExpr._null()), JExpr._null(), stringConstructorArg.eq(JExpr.lit(1))));
   
    // toString
    final JMethod marshal = booleanConverter.method(JMod.PUBLIC, Integer.class, "marshal");
    final JVar unmarshallparam = marshal.param(JMod.FINAL, Boolean.class, "b");
    marshal.annotate(Override.class);
    marshal._throws(Exception.class);
    marshal.body()._return(JOp.cond(unmarshallparam.eq(JExpr._null()), JExpr._null(), JOp.cond(unmarshallparam, JExpr.lit(1), JExpr.lit(0))));

  }
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.