Package com.helger.jcodemodel

Examples of com.helger.jcodemodel.JDefinedClass.field()


            for (JTypeVar visitorTypeParameter: visitorInterface.getValueTypeParameters()) {
                Types.generifyWithBoundsFrom(valueClass, visitorTypeParameter.name(), visitorTypeParameter);
            }
            if (annotation.valueClassIsSerializable()) {
                valueClass._implements(types._Serializable);
                valueClass.field(JMod.PRIVATE | JMod.FINAL | JMod.STATIC, types._long, "serialVersionUID", JExpr.lit(annotation.valueClassSerialVersionUID()));
            }

            if (annotation.valueClassIsComparable()) {
                valueClass._implements(types._Comparable.narrow(valueClass.narrow(valueClass.typeParams())));
            }
View Full Code Here


        AbstractJClass usedAcceptingInterfaceType = acceptingInterface.narrow(proxyClass.typeParams());
        proxyClass._implements(usedAcceptingInterfaceType);

        if (serialization.isSerializable()) {
            proxyClass._implements(types._Serializable);
            proxyClass.field(JMod.PRIVATE | JMod.FINAL | JMod.STATIC, types._long, "serialVersionUID", JExpr.lit(serialization.serialVersionUID()));
        }

        JMethod constructor = proxyClass.constructor(JMod.NONE);
        AbstractJClass usedValueClassType = valueClass.narrow(proxyClass.typeParams());
        proxyClass.field(JMod.PRIVATE | JMod.FINAL, usedValueClassType, "implementation");
View Full Code Here

            proxyClass.field(JMod.PRIVATE | JMod.FINAL | JMod.STATIC, types._long, "serialVersionUID", JExpr.lit(serialization.serialVersionUID()));
        }

        JMethod constructor = proxyClass.constructor(JMod.NONE);
        AbstractJClass usedValueClassType = valueClass.narrow(proxyClass.typeParams());
        proxyClass.field(JMod.PRIVATE | JMod.FINAL, usedValueClassType, "implementation");
        constructor.param(usedValueClassType, "implementation");
        constructor.body().assign(JExpr._this().ref("implementation"), JExpr.ref("implementation"));

        JMethod acceptMethod = proxyClass.method(JMod.PUBLIC, types._void, "accept");
        acceptMethod.annotate(Override.class);
View Full Code Here

        AbstractJClass usedValueClassType = valueClass.narrow(caseClass.typeParams());
        caseClass._implements(usedAcceptingInterfaceType);

        if (serialization.isSerializable()) {
            caseClass._implements(types._Serializable);
            caseClass.field(JMod.PRIVATE | JMod.FINAL | JMod.STATIC, types._long, "serialVersionUID", JExpr.lit(serialization.serialVersionUID()));
        }

        JMethod constructor = caseClass.constructor(JMod.NONE);
        for (JVar param: interfaceMethod.params()) {
            AbstractJType paramType = visitorInterface.substituteSpecialType(param.type(), usedValueClassType, usedValueClassType, types._RuntimeException);
View Full Code Here

        }

        JMethod constructor = caseClass.constructor(JMod.NONE);
        for (JVar param: interfaceMethod.params()) {
            AbstractJType paramType = visitorInterface.substituteSpecialType(param.type(), usedValueClassType, usedValueClassType, types._RuntimeException);
            JFieldVar field = caseClass.field(JMod.PRIVATE | JMod.FINAL, paramType, param.name());
            JVar argument = constructor.param(paramType, param.name());
            constructor.body().assign(JExpr._this().ref(field), argument);
        }
        JVar param = interfaceMethod.listVarParam();
        if (param != null) {
View Full Code Here

            constructor.body().assign(JExpr._this().ref(field), argument);
        }
        JVar param = interfaceMethod.listVarParam();
        if (param != null) {
            AbstractJType paramType = visitorInterface.substituteSpecialType(param.type().elementType(), usedValueClassType, usedValueClassType, types._RuntimeException);
            JFieldVar field = caseClass.field(JMod.PRIVATE | JMod.FINAL, paramType.array(), param.name());
            JVar argument = constructor.varParam(paramType, param.name());
            constructor.body().assign(JExpr._this().ref(field), argument);
        }

        JMethod acceptMethod = caseClass.method(JMod.PUBLIC, types._void, "accept");
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.