Package com.helger.jcodemodel

Examples of com.helger.jcodemodel.JMethod.body()


                    varArgument2 = argument2;
                }

                if (!interfaceMethod1.name().equals(interfaceMethod2.name())) {
                    int result = (interfaceMethodIndex1 < interfaceMethodIndex2 ? -1 : (interfaceMethodIndex1 == interfaceMethodIndex2 ? 0 : 1));
                    visitorMethod2.body()._return(JExpr.lit(result));
                } else {
                    if (!interfaceMethod1.params().isEmpty() || interfaceMethod1.hasVarArgs()) {
                        CompareToMethod compareToMethodModel = new CompareToMethod(types, visitorMethod2.body(), nameSource2);
                        CompareToMethod.Body body = compareToMethodModel.createBody();
                        for (int i = 0; i < interfaceMethod1.params().size(); i++) {
View Full Code Here


                if (!interfaceMethod1.name().equals(interfaceMethod2.name())) {
                    int result = (interfaceMethodIndex1 < interfaceMethodIndex2 ? -1 : (interfaceMethodIndex1 == interfaceMethodIndex2 ? 0 : 1));
                    visitorMethod2.body()._return(JExpr.lit(result));
                } else {
                    if (!interfaceMethod1.params().isEmpty() || interfaceMethod1.hasVarArgs()) {
                        CompareToMethod compareToMethodModel = new CompareToMethod(types, visitorMethod2.body(), nameSource2);
                        CompareToMethod.Body body = compareToMethodModel.createBody();
                        for (int i = 0; i < interfaceMethod1.params().size(); i++) {
                            JVar argument1 = arguments1.get(i);
                            JVar argument2 = arguments2.get(i);
                            JVar param = interfaceMethod1.params().get(i);
View Full Code Here

                                body.appendNullableValue(varArgument1.type(), varArgument1, varArgument2);
                            else
                                body.appendNotNullValue(varArgument1.type(), varArgument1, varArgument2);
                        }
                    }
                    visitorMethod2.body()._return(JExpr.lit(0));
                }
            }

            JInvocation invocation2 = that.invoke("accept");
            invocation2.arg(JExpr._new(anonymousClass2));
View Full Code Here

            boolean isGettable = false;
            for (JVar param: interfaceMethod1.params()) {
                AbstractJType paramType = visitorInterface.substituteSpecialType(param.type(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
                JVar argument = visitorMethod1.param(param.mods().getValue(), paramType, param.name());
                if (configuration.isFieldValue(interfaceMethod1, param.name())) {
                    visitorMethod1.body()._return(argument);
                    isGettable = true;
                }
            }
            JVar param = interfaceMethod1.listVarParam();
            if (param != null) {
View Full Code Here

            JVar param = interfaceMethod1.listVarParam();
            if (param != null) {
                AbstractJType paramType = visitorInterface.substituteSpecialType(param.type().elementType(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
                JVar argument = visitorMethod1.varParam(param.mods().getValue(), paramType, param.name());
                if (configuration.isFieldValue(interfaceMethod1, param.name())) {
                    visitorMethod1.body()._return(argument);
                    isGettable = true;
                }
            }
            if (!isGettable) {
                JInvocation exceptionInvocation = JExpr._new(types._IllegalStateException);
View Full Code Here

                }
            }
            if (!isGettable) {
                JInvocation exceptionInvocation = JExpr._new(types._IllegalStateException);
                exceptionInvocation.arg(configuration.name() + " is not accessible in this case: " + interfaceMethod1.name());
                visitorMethod1.body()._throw(exceptionInvocation);
            }
        }
    }

    private class UpdaterBody {
View Full Code Here

                    invocation.arg(newValue);
                } else {
                    invocation.arg(argument);
                }
            }
            visitorMethod1.body()._return(invocation);
        }
    }


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.