Package com.helger.jcodemodel

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


                AbstractJType argumentType = visitorInterface.substituteSpecialType(param.type().elementType(), usedValueClassType, types._Integer, types._RuntimeException);
                JVar argument = visitorMethod1.varParam(param.mods().getValue() | JMod.FINAL, argumentType, nameSource.get(param.name()));
                varArgument = argument;
            }

            JVar result = visitorMethod1.body().decl(types._StringBuilder, nameSource.get("result"), JExpr._new(types._StringBuilder));
            JInvocation invocation = visitorMethod1.body().invoke(result, "append");
            invocation.arg(valueClass.name() + "." + capitalize(interfaceMethod1.name()) + "{");
            ToStringMethodBody body = new ToStringMethodBody(visitorMethod1.body(), result);
            if (!arguments.isEmpty() || varArgument != null) {
                JVar argument = arguments.get(0);
View Full Code Here


                JVar argument = visitorMethod1.varParam(param.mods().getValue() | JMod.FINAL, argumentType, nameSource.get(param.name()));
                varArgument = argument;
            }

            JVar result = visitorMethod1.body().decl(types._StringBuilder, nameSource.get("result"), JExpr._new(types._StringBuilder));
            JInvocation invocation = visitorMethod1.body().invoke(result, "append");
            invocation.arg(valueClass.name() + "." + capitalize(interfaceMethod1.name()) + "{");
            ToStringMethodBody body = new ToStringMethodBody(visitorMethod1.body(), result);
            if (!arguments.isEmpty() || varArgument != null) {
                JVar argument = arguments.get(0);
                body.appendParam(argument.type(), interfaceMethod1.params().get(0).name(), argument);
View Full Code Here

            }

            JVar result = visitorMethod1.body().decl(types._StringBuilder, nameSource.get("result"), JExpr._new(types._StringBuilder));
            JInvocation invocation = visitorMethod1.body().invoke(result, "append");
            invocation.arg(valueClass.name() + "." + capitalize(interfaceMethod1.name()) + "{");
            ToStringMethodBody body = new ToStringMethodBody(visitorMethod1.body(), result);
            if (!arguments.isEmpty() || varArgument != null) {
                JVar argument = arguments.get(0);
                body.appendParam(argument.type(), interfaceMethod1.params().get(0).name(), argument);
                for (int i = 1; i < arguments.size(); i++) {
                    invocation = visitorMethod1.body().invoke(result, "append");
View Full Code Here

            ToStringMethodBody body = new ToStringMethodBody(visitorMethod1.body(), result);
            if (!arguments.isEmpty() || varArgument != null) {
                JVar argument = arguments.get(0);
                body.appendParam(argument.type(), interfaceMethod1.params().get(0).name(), argument);
                for (int i = 1; i < arguments.size(); i++) {
                    invocation = visitorMethod1.body().invoke(result, "append");
                    invocation.arg(", ");
                    argument = arguments.get(i);
                    body.appendParam(argument.type(), interfaceMethod1.params().get(i).name(), argument);
                }
                if (varArgument != null) {
View Full Code Here

                    invocation.arg(", ");
                    argument = arguments.get(i);
                    body.appendParam(argument.type(), interfaceMethod1.params().get(i).name(), argument);
                }
                if (varArgument != null) {
                    invocation = visitorMethod1.body().invoke(result, "append");
                    invocation.arg(", ");
                    body.appendParam(varArgument.type(), interfaceMethod1.listVarParam().name(), varArgument);
                }
            }
            invocation = visitorMethod1.body().invoke(result, "append");
View Full Code Here

                    invocation = visitorMethod1.body().invoke(result, "append");
                    invocation.arg(", ");
                    body.appendParam(varArgument.type(), interfaceMethod1.listVarParam().name(), varArgument);
                }
            }
            invocation = visitorMethod1.body().invoke(result, "append");
            invocation.arg("}");
            visitorMethod1.body()._return(result.invoke("toString"));
        }
        JInvocation invocation1 = JExpr._this().invoke("accept");
        invocation1.arg(JExpr._new(anonymousClass1));
View Full Code Here

                    body.appendParam(varArgument.type(), interfaceMethod1.listVarParam().name(), varArgument);
                }
            }
            invocation = visitorMethod1.body().invoke(result, "append");
            invocation.arg("}");
            visitorMethod1.body()._return(result.invoke("toString"));
        }
        JInvocation invocation1 = JExpr._this().invoke("accept");
        invocation1.arg(JExpr._new(anonymousClass1));
        toStringMethod.body()._return(invocation1);
    }
View Full Code Here

        for (JMethod interfaceMethod1: visitorInterface.methods()) {
            body.generateCase(interfaceMethod1);
        }
        JInvocation invocation1 = JExpr._this().invoke("accept");
        invocation1.arg(JExpr._new(anonymousClass1));
        getterMethod.body()._return(invocation1);
    }

    void buildUpdaters() throws SourceException {
        AbstractJClass usedValueClassType = valueClass.narrow(valueClass.typeParams());
        Map<String, FieldConfiguration> updatersMap = new TreeMap<String, FieldConfiguration>();
View Full Code Here

        for (JMethod interfaceMethod1: visitorInterface.methods()) {
            body.generateCase(interfaceMethod1);
        }
        JInvocation invocation1 = JExpr._this().invoke("accept");
        invocation1.arg(JExpr._new(anonymousClass1));
        updaterMethod.body()._return(invocation1);
    }

    void buildPredicates() throws SourceException {
        Set<String> predicates = new TreeSet<String>();
        for (JMethod interfaceMethod: visitorInterface.methods()) {
View Full Code Here

                        result = true;
                        break;
                    }
                }
            }
            visitorMethod1.body()._return(JExpr.lit(result));
        }

        JInvocation invocation1 = JExpr._this().invoke("accept");
        invocation1.arg(JExpr._new(anonymousClass1));
        predicateMethod.body()._return(invocation1);
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.