Examples of IJExpression


Examples of com.helger.jcodemodel.IJExpression

            Types.generifyWithBoundsFrom(factoryMethod, visitorTypeParameter.name(), visitorTypeParameter);
        }
        AbstractJClass usedValueClassType = valueClass.narrow(factoryMethod.typeParams());
        AbstractJClass usedFactoryType = factory.narrow(factoryMethod.typeParams());
        factoryMethod.type(visitorInterface.narrowed(usedValueClassType, usedValueClassType, types._RuntimeException));
        IJExpression result = JExpr.ref("FACTORY");
        result = usedFactoryType.getTypeParameters().isEmpty() ? result : JExpr.cast(usedFactoryType, result);
        factoryMethod.body()._return(result);
        return factoryMethod;
    }
View Full Code Here

Examples of com.helger.jcodemodel.IJExpression

                paramArray.param("unchecked");
                paramArray.param("rawtypes");

                JAnnotationUse methodAnnotationUse = constructorMethod.annotate(SuppressWarnings.class);
                methodAnnotationUse.param("value", "unchecked");
                IJExpression result = usedValueClassType.getTypeParameters().isEmpty() ? singletonInstanceField : JExpr.cast(usedValueClassType, singletonInstanceField);
                constructorMethod.body()._return(result);
            }
            constructorMethods.put(interfaceMethod.name(), constructorMethod);
        }
        return constructorMethods;
View Full Code Here

Examples of com.helger.jcodemodel.IJExpression

                    forBody.appendNullableValue(type.elementType(), value1.component(i), value2.component(i));
                else
                    forBody.appendNotNullValue(type.elementType(), value1.component(i), value2.component(i));
                appendNotNullValue(types._int, value1.ref("length"), value2.ref("length"));
            } else if (type.isPrimitive()) {
                IJExpression condition = JOp.cond(value1.lt(value2), JExpr.lit(-1),
                                                  JOp.cond(value1.eq(value2), JExpr.lit(0), JExpr.lit(1)));
                body.assign(resultVariable, condition);
                JConditional _if = body._if(resultVariable.ne(JExpr.lit(0)));
                _if._then()._return(resultVariable);
            } else {
View Full Code Here

Examples of com.helger.jcodemodel.IJExpression

    void appendNullableValue(AbstractJType type, IJExpression value1, IJExpression value2) {
        if (!type.isReference()) {
            throw new AssertionError("appendNullableValue called for non-reference type");
        } else {
            JConditional _if = body._if(value1.ne(value2));
            IJExpression isNull = value1.eq(JExpr._null()).cor(value2.eq(JExpr._null()));
            JConditional _if1 = _if._then()._if(isNull);
            _if1._then()._return(JExpr.FALSE);
            EqualsMethod innerBody = new EqualsMethod(types, _if._then(), nameSource);
            innerBody.appendNotNullValue(type, value1, value2);
        }
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.