Examples of JavaFieldDeclaration


Examples of org.openquark.cal.internal.javamodel.JavaFieldDeclaration

        // Code fragment:
        //
        // private static final boolean isCompatibleWithCurrentConfiguration = __checkConfig();
        //
        final JavaFieldDeclaration isCompatibleWithCurrentConfigurationField = new JavaFieldDeclaration(
            Modifier.PRIVATE|Modifier.STATIC|Modifier.FINAL,
            JavaTypeName.BOOLEAN,
            "isCompatibleWithCurrentConfiguration",
            new JavaExpression.MethodInvocation.Static(
                libClassName, checkConfigMethod.getMethodName(), new JavaExpression[0], new JavaTypeName[0], JavaTypeName.BOOLEAN));
View Full Code Here

Examples of org.openquark.cal.internal.javamodel.JavaFieldDeclaration

        public void addFieldDeclarations (JavaClassRep classRep) {
            String literalName = getSymbol();
            if (literal instanceof BigInteger) {
                if (unboxedUseCount > 0) {
                    JavaFieldDeclaration unboxedDeclaration = new JavaFieldDeclaration(Modifier.STATIC | Modifier.PRIVATE | Modifier.FINAL, JavaTypeName.make(literal.getClass()), literalName + "$U", constructorExpression);
                    classRep.addFieldDeclaration(unboxedDeclaration);
                    if (boxedUseCount > 0) {
                        JavaExpression initializer = SCJavaDefn.createPrimitiveMakeInvocation(getKernelTypeClass(), new JavaField.Static(classRep.getClassName(), literalName + "$U", JavaTypeName.make(literal.getClass())));
                        JavaFieldDeclaration boxedDeclaration = new JavaFieldDeclaration(Modifier.STATIC | Modifier.PRIVATE | Modifier.FINAL, JavaTypeName.make(getKernelTypeClass()), literalName, initializer);
                        classRep.addFieldDeclaration(boxedDeclaration);
                    }
                } else
                if (boxedUseCount > 0) {
                    JavaExpression initializer = SCJavaDefn.createPrimitiveMakeInvocation(getKernelTypeClass(), constructorExpression);
                    JavaFieldDeclaration boxedDeclaration = new JavaFieldDeclaration(Modifier.STATIC | Modifier.PRIVATE | Modifier.FINAL, JavaTypeName.make(getKernelTypeClass()), literalName, initializer);
                    classRep.addFieldDeclaration(boxedDeclaration);
                }
            } else if (boxedUseCount > 0) {
                // kernel type class: something like: "org.openquark.cal.internal.runtime.lecc.RTData$CAL_Integer";
                JavaExpression initializer = SCJavaDefn.createPrimitiveMakeInvocation(getKernelTypeClass(), constructorExpression);

                JavaFieldDeclaration instanceDeclaration = new JavaFieldDeclaration(Modifier.STATIC | Modifier.PRIVATE | Modifier.FINAL, JavaTypeName.make(getKernelTypeClass()), literalName, initializer);
                classRep.addFieldDeclaration(instanceDeclaration);
            }
        }
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.