Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ClassMethod


                TypeClass nthTypeClass = moduleTypeInfo.getNthTypeClass(i);
                int nClassMethods = nthTypeClass.getNClassMethods();
                totalClassMethods += nClassMethods;
               
                for (int j = 0; j < nClassMethods; j++) {
                    ClassMethod nthClassMethod = nthTypeClass.getNthClassMethod(j);
                    if (nthClassMethod.hasDefaultClassMethod()) {
                        totalDefaultClassMethods++;
                    }
                }
            }
           
View Full Code Here


        }
       
        /// If the entity is a class method, then display whether it is required or optional
        //
        if (envEntity instanceof ClassMethod) {
            final ClassMethod method = (ClassMethod)envEntity;
           
            buffer.append("\n");
            if (method.getDefaultClassMethodName() == null) {
                // no default - required
                buffer.append(CALDocMessages.getString("requiredMethodIndicator"));
            } else {
                // has default - optional
                buffer.append(CALDocMessages.getString("optionalMethodIndicator"));
View Full Code Here

           
            if (parent.isDocForTypeClassGenerated(typeClass.getName().getModuleName(), typeClass.getName().getUnqualifiedName())) {
                labels.add(labelMaker.getLabel(typeClass));
               
                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    ClassMethod method = typeClass.getNthClassMethod(j);
                    if (parent.isDocForFunctionOrClassMethodGenerated(method.getName().getModuleName(), method.getName().getUnqualifiedName())) {
                        labels.add(labelMaker.getLabel(method));
                    }
                }
            }
        }
       
        for (int i = 0, n = moduleInfo.getNClassInstances(); i < n; i++) {
            ClassInstance instance = moduleInfo.getNthClassInstance(i);
            TypeClass typeClass = instance.getTypeClass();
           
            if (parent.isDocForClassInstanceGenerated(instance)) {
                labels.add(labelMaker.getLabel(instance));
               
                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    ClassMethod method = typeClass.getNthClassMethod(j);
                    labels.add(labelMaker.getLabel(instance, method.getName().getUnqualifiedName()));
                }
            }
        }
       
        // Now loop through the generated HTML looking for the pattern id='{label}'
View Full Code Here

     * @param entity the functional agent entity, which may or may not be a class method.
     */
    private void maybeGenerateClassMethodIndicator(FunctionalAgent entity) {
       
        if (entity instanceof ClassMethod) {
            ClassMethod method = (ClassMethod)entity;
           
            final String text;
           
            if (method.getDefaultClassMethodName() == null) {
                // no default - required
                text = LocalizableUserVisibleString.REQUIRED_METHOD_INDICATOR.toResourceString();
            } else {
                // has default - optional
                text = LocalizableUserVisibleString.OPTIONAL_METHOD_INDICATOR.toResourceString();
View Full Code Here

                           
                            TypeExpr instanceMethodTypeExpr = instance.getInstanceMethodType(methodName);
                           
                            iceLogger.log(Level.INFO, methodName + " :: " + instanceMethodTypeExpr.toString(scopedEntityNamingPolicy) + "\n");
                           
                            ClassMethod classMethod = instance.getTypeClass().getClassMethod(methodName);
                           
                            try {
                                CALDocComment comment = instance.getMethodCALDocComment(methodName);
                                if (comment != null) {
                                    iceLogger.log(Level.INFO, "CALDoc for the " + methodName + " method in the " + id + " instance:\n" + CALDocToTextUtilities.getTextFromCALDocComment(comment, classMethod, instanceMethodTypeExpr, scopedEntityNamingPolicy));
                                } else {
                                    CALDocComment classMethodCALDoc = classMethod.getCALDocComment();
                                    String classMethodDoc;
                                    if (classMethodCALDoc != null) {
                                        classMethodDoc = CALDocToTextUtilities.getTextFromCALDocComment(classMethodCALDoc, classMethod, instanceMethodTypeExpr, scopedEntityNamingPolicy);
                                    } else {
                                        classMethodDoc = CALDocToTextUtilities.getTextForArgumentsAndReturnValue(classMethodCALDoc, classMethod, instanceMethodTypeExpr, scopedEntityNamingPolicy);
                                    }
                                    iceLogger.log(Level.INFO, "There is no CALDoc for the " + methodName + " method in the " + id +" instance.\n\nDocumentation for the class method " + classMethod.getName() + ":\n" + classMethodDoc);
                                }
                            } catch (IllegalArgumentException e) {
                                iceLogger.log(Level.INFO, "The instance " + id + " does not have a method named " + methodName + ".");
                            }
                        }
View Full Code Here

        for (int i = 0, n = moduleTypeInfo.getNTypeClasses(); i < n; ++i) {
            TypeClass tc = moduleTypeInfo.getNthTypeClass(i);

           
            for (int j = 0, k = tc.getNClassMethods(); j < k; ++j) {
                ClassMethod cm = tc.getNthClassMethod(j);
                if (cm.getScope().isPublic() == publicEntities) {
                    nameToFuncInfo.put(cm.getName().getUnqualifiedName(), cm);
                }
            }
        }

        if (nameToFuncInfo.size() == 0) {
View Full Code Here

        /// Create a list of the class methods to be documented, applying the user-specified filters along the way.
        //
        int nClassMethods = typeClass.getNClassMethods();
        List<ClassMethod> classMethodsList = new ArrayList<ClassMethod>(nClassMethods);
        for (int i = 0; i < nClassMethods; i++) {
            ClassMethod entity = typeClass.getNthClassMethod(i);
            if (filter.shouldGenerateScopedEntity(entity)) {
                classMethodsList.add(entity);
            }
        }
       
View Full Code Here

        /// Create a list of the type classes to be documented, applying the user-specified filters along the way.
        //
        int nClassMethods = typeClass.getNClassMethods();
        List<ClassMethod> classMethodsList = new ArrayList<ClassMethod>(nClassMethods);
        for (int i = 0; i < nClassMethods; i++) {
            ClassMethod entity = typeClass.getNthClassMethod(i);
            if (filter.shouldGenerateScopedEntity(entity)) {
                classMethodsList.add(entity);
            }
        }
       
        ModuleName moduleName = typeClass.getName().getModuleName();
       
        ////
        /// Generate documentation for each method of this class, and add each to the main index
        /// and the argument type and return type indices.
        //
        List<IndexEntry> perModuleFunctionalAgentIndex = getPerModuleFunctionalAgentIndex(moduleName);
       
        int nClassMethodsToGenerate = classMethodsList.size();
        beginClassMethodDocList(nClassMethodsToGenerate);
        for (int i = 0; i < nClassMethodsToGenerate; i++) {
           
            ClassMethod classMethod = classMethodsList.get(i);
            QualifiedName classMethodName = classMethod.getName();
            perModuleFunctionalAgentIndex.add(new IndexEntry(classMethodName.getUnqualifiedName(), labelMaker.getLabel(classMethod), classMethod.getScope(), IndexEntry.Kind.FUNCTIONAL_AGENT));
           
            processEnvEntityForArgAndReturnTypeIndices(classMethod);
           
            generateClassMethodDoc(classMethod, i);
        }
View Full Code Here

        int nInstanceMethods = classInstance.getNInstanceMethods();
        beginInstanceMethodDocList(nInstanceMethods);
        TypeClass typeClass = classInstance.getTypeClass();
        for (int i = 0; i < nInstanceMethods; i++) {
            // no index entries for instance method definitions
            ClassMethod classMethod = typeClass.getNthClassMethod(i);
            generateInstanceMethodDoc(classInstance, classMethod.getName().getUnqualifiedName(), classMethod, i);
        }
        endInstanceMethodDocList(nInstanceMethods);
       
        generateClassInstanceDocFooter(classInstance, index);
    }
View Full Code Here

            for (int i = 0, n = moduleInfo.getNTypeClasses(); i < n; i++) {
                final TypeClass typeClass = moduleInfo.getNthTypeClass(i);
                caldocComments.put("class " + typeClass.getName().getQualifiedName(), typeClass.getCALDocComment());

                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    final ClassMethod method = typeClass.getNthClassMethod(j);
                    caldocComments.put("class method " + method.getName().getQualifiedName(), method.getCALDocComment());
                }
            }
           
            for (int i = 0, n = moduleInfo.getNClassInstances(); i < n; i++) {
                final ClassInstance instance = moduleInfo.getNthClassInstance(i);
                final TypeClass typeClass = instance.getTypeClass();
               
                caldocComments.put("instance " + instance.getNameWithContext(), instance.getCALDocComment());

                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    final ClassMethod method = typeClass.getNthClassMethod(j);
                    caldocComments.put(
                        "instance method " + instance.getNameWithContext() + " " + method.getName().getQualifiedName(),
                        method.getCALDocComment());
                }
            }
           
            // Then visit each comment verifying the validity of unchecked references
           
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.ClassMethod

Copyright © 2018 www.massapicom. 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.