Package com.helger.jcodemodel

Examples of com.helger.jcodemodel.JInvocation.arg()


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


                invocation.narrow(typeArgument);
            for (JVar param: interfaceMethod1.params()) {
                AbstractJType argumentType = visitorInterface.substituteSpecialType(param.type(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
                JVar argument = visitorMethod1.param(param.mods().getValue(), argumentType, nameSource.get(param.name()));
                if (configuration.isFieldValue(interfaceMethod1, param.name())) {
                    invocation.arg(newValue);
                } else {
                    invocation.arg(argument);
                }
            }
            JVar param = interfaceMethod1.listVarParam();
View Full Code Here

                AbstractJType argumentType = visitorInterface.substituteSpecialType(param.type(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
                JVar argument = visitorMethod1.param(param.mods().getValue(), argumentType, nameSource.get(param.name()));
                if (configuration.isFieldValue(interfaceMethod1, param.name())) {
                    invocation.arg(newValue);
                } else {
                    invocation.arg(argument);
                }
            }
            JVar param = interfaceMethod1.listVarParam();
            if (param != null) {
                AbstractJType argumentType = visitorInterface.substituteSpecialType(param.type().elementType(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
View Full Code Here

            JVar param = interfaceMethod1.listVarParam();
            if (param != null) {
                AbstractJType argumentType = visitorInterface.substituteSpecialType(param.type().elementType(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
                JVar argument = visitorMethod1.varParam(param.mods().getValue(), argumentType, nameSource.get(param.name()));
                if (configuration.isFieldValue(interfaceMethod1, param.name())) {
                    invocation.arg(newValue);
                } else {
                    invocation.arg(argument);
                }
            }
            visitorMethod1.body()._return(invocation);
View Full Code Here

                AbstractJType argumentType = visitorInterface.substituteSpecialType(param.type().elementType(), usedValueClassType, configuration.type().boxify(), types._RuntimeException);
                JVar argument = visitorMethod1.varParam(param.mods().getValue(), argumentType, nameSource.get(param.name()));
                if (configuration.isFieldValue(interfaceMethod1, param.name())) {
                    invocation.arg(newValue);
                } else {
                    invocation.arg(argument);
                }
            }
            visitorMethod1.body()._return(invocation);
        }
    }
View Full Code Here

                    forBody.appendNotNullValue(type.elementType(), value.component(i));
            } else if (!type.isPrimitive()) {
                appendNotNullValue(types._int, value.invoke("hashCode"));
            } else if (type.name().equals("double")) {
                JInvocation invocation = types._Double.staticInvoke("doubleToLongBits");
                invocation.arg(value);
                appendNotNullValue(types._long, invocation);
            } else if (type.name().equals("float")) {
                JInvocation invocation = types._Float.staticInvoke("floatToIntBits");
                invocation.arg(value);
                appendNotNullValue(types._int, invocation);
View Full Code Here

                JInvocation invocation = types._Double.staticInvoke("doubleToLongBits");
                invocation.arg(value);
                appendNotNullValue(types._long, invocation);
            } else if (type.name().equals("float")) {
                JInvocation invocation = types._Float.staticInvoke("floatToIntBits");
                invocation.arg(value);
                appendNotNullValue(types._int, invocation);
            } else if (type.name().equals("boolean")) {
                appendNotNullValue(types._int, JOp.cond(value, JExpr.lit(0), JExpr.lit(1)));
            } else if (type.name().equals("long")) {
                appendNotNullValue(types._int, JExpr.cast(types._int, value.xor(value.shrz(JExpr.lit(32)))));
View Full Code Here

        }

        void appendNotNullValue(AbstractJType type, IJExpression value1, IJExpression value2) {
            if (type.isArray()) {
                JInvocation invocation = types._Math.staticInvoke("min");
                invocation.arg(value1.ref("length"));
                invocation.arg(value2.ref("length"));
                JVar length = body.decl(types._int, nameSource.get("length"), invocation);
                VariableNameSource localNames = nameSource.forBlock();
                JForLoop _for = body._for();
                JVar i = _for.init(types._int, localNames.get("i"), JExpr.lit(0));
View Full Code Here

        void appendNotNullValue(AbstractJType type, IJExpression value1, IJExpression value2) {
            if (type.isArray()) {
                JInvocation invocation = types._Math.staticInvoke("min");
                invocation.arg(value1.ref("length"));
                invocation.arg(value2.ref("length"));
                JVar length = body.decl(types._int, nameSource.get("length"), invocation);
                VariableNameSource localNames = nameSource.forBlock();
                JForLoop _for = body._for();
                JVar i = _for.init(types._int, localNames.get("i"), JExpr.lit(0));
                _for.test(i.lt(length));
View Full Code Here

                body.assign(resultVariable, condition);
                JConditional _if = body._if(resultVariable.ne(JExpr.lit(0)));
                _if._then()._return(resultVariable);
            } else {
                JInvocation invocation = value1.invoke("compareTo");
                invocation.arg(value2);
                body.assign(resultVariable, invocation);
                JConditional _if = body._if(resultVariable.ne(JExpr.lit(0)));
                _if._then()._return(resultVariable);
            }
        }
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.