Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ClassInstanceIdentifier


     * Generates a reference to a class instance, appropriately hyperlinked.
     * @param classInstance the class instance to link to.
     */
    private void generateClassInstanceReference(ClassInstance classInstance) {
        ModuleName definingModuleName = classInstance.getModuleName();
        ClassInstanceIdentifier identifier = classInstance.getIdentifier();
        String classInstanceLabel = labelMaker.getClassInstanceLabel(identifier);
       
        if (!isDocForClassInstanceGenerated(classInstance)) {
            // if the class instance is not documented, no hyperlink can be made.
            generateClassInstanceDeclarationName(classInstance, false);
View Full Code Here


     * @param relativePathToBaseDirectory the relative path to the base directory for documentation generation.
     * @return the href attribute.
     */
    private HTMLBuilder.AttributeList getHrefAttributeForNonLocalClassInstanceReference(ClassInstance classInstance, String relativePathToBaseDirectory) {
        ModuleName definingModuleName = classInstance.getModuleName();
        ClassInstanceIdentifier identifier = classInstance.getIdentifier();
        String classInstanceLabel = labelMaker.getClassInstanceLabel(identifier);
       
        HTMLBuilder.AttributeList hrefAttribute;
        if (config.shouldSeparateInstanceDoc) {
            hrefAttribute = nonLocalHrefAttribute(relativePathToBaseDirectory + SEPARATE_INSTANCE_DOC_SUBDIRECTORY + "/" + getSeparateInstanceDocFileName(definingModuleName), classInstanceLabel);
View Full Code Here

     * @param classInstance the class instance of the instance method.
     * @param methodName the name of the instance method.
     */
    private void generateInstanceMethodReference(ClassInstance classInstance, String methodName) {
        ModuleName definingModuleName = classInstance.getModuleName();
        ClassInstanceIdentifier identifier = classInstance.getIdentifier();
        String instanceMethodLabel = labelMaker.getInstanceMethodLabel(identifier, methodName);
       
        if (!isDocForClassInstanceGenerated(classInstance)) {
            // if the class instance is not documented, no hyperlink can be made.
            generateClassInstanceDeclarationName(classInstance, false);
View Full Code Here

           
        } else if (type == CALFeatureName.MODULE) {
            generateModuleReference(featureName.toModuleName());
       
        } else if (type == CALFeatureName.CLASS_INSTANCE) {
            ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
            ModuleName definingModuleName = featureName.toModuleName();
            generateClassInstanceReference(identifier, definingModuleName);
           
        } else if (type == CALFeatureName.INSTANCE_METHOD) {
            ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
            ModuleName definingModuleName = featureName.toModuleName();
            String methodName = featureName.toInstanceMethodName();
            generateInstanceMethodReference(identifier, definingModuleName, methodName);
           
        } else {
View Full Code Here

                TypeExpr instanceTypeExpr = getTypeChecker().getTypeFromString(instanceTypeString, targetModule, logger);
               
                if (logger.getNErrors() > 0) {
                    dumpCompilerMessages(logger);
                } else if (qualifiedTypeClassName != null) {
                    ClassInstanceIdentifier id;
                    if (instanceTypeExpr instanceof RecordType) {
                       
                        RecordType recordType = (RecordType)instanceTypeExpr;
                        if (recordType.isRecordPolymorphic()) {
                            id = new UniversalRecordInstance(qualifiedTypeClassName);
View Full Code Here

                TypeExpr instanceTypeExpr = getTypeChecker().getTypeFromString(instanceTypeString, targetModule, logger);
               
                if (logger.getNErrors() > 0) {
                    dumpCompilerMessages(logger);
                } else if (qualifiedTypeClassName != null) {
                    ClassInstanceIdentifier id;
                    if (instanceTypeExpr instanceof RecordType) {
                       
                        RecordType recordType = (RecordType)instanceTypeExpr;
                        if (recordType.isRecordPolymorphic()) {
                            id = new UniversalRecordInstance(qualifiedTypeClassName);
View Full Code Here

     * @throws IllegalArgumentException if the feature name is not for a class instance
     */
    public ClassInstance getClassInstance(CALFeatureName featureName) {
       
        ModuleName moduleName = featureName.toModuleName();
        ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
       
        MetaModule metaModule = getMetaModule(moduleName);
       
        if (metaModule == null) {
            return null;
View Full Code Here

               
                return featureName.getName();
               
            } else if (type == CALFeatureName.CLASS_INSTANCE) {
               
                ClassInstanceIdentifier identifier = calFeatureName.toInstanceIdentifier();
               
                return identifier.getTypeClassName().getQualifiedName() +
                       " " +
                       identifier.getTypeIdentifier();
               
            } else if (type == CALFeatureName.INSTANCE_METHOD) {
               
                ClassInstanceIdentifier identifier = calFeatureName.toInstanceIdentifier();
               
                return identifier.getTypeClassName().getQualifiedName() +
                       " " +
                       identifier.getTypeIdentifier() +
                       "@" +
                       calFeatureName.toInstanceMethodName();
               
            }
        }
View Full Code Here

        } else if (type == CALFeatureName.MODULE) {
            return new NavAddress(MODULE_METHOD, featureName.getName(), null, null);
       
        } else if (type == CALFeatureName.CLASS_INSTANCE) {
           
            ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
            ModuleName moduleName = featureName.toModuleName();
           
            Map<String, String> parameters = new HashMap<String, String>();
            parameters.put(INSTANCE_CLASS_PARAMETER, identifier.getTypeClassName().getQualifiedName());
            parameters.put(INSTANCE_TYPE_PARAMETER, identifier.getTypeIdentifier());
            parameters.put(INSTANCE_MODULE_PARAMETER, moduleName.toSourceText());
           
            return new NavAddress(CLASS_INSTANCE_METHOD, null, null, parameters);
           
        } else if (type == CALFeatureName.INSTANCE_METHOD) {
           
            ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
            ModuleName moduleName = featureName.toModuleName();
            String methodName = featureName.toInstanceMethodName();
           
            Map<String, String> parameters = new HashMap<String, String>();
            parameters.put(INSTANCE_CLASS_PARAMETER, identifier.getTypeClassName().getQualifiedName());
            parameters.put(INSTANCE_TYPE_PARAMETER, identifier.getTypeIdentifier());
            parameters.put(INSTANCE_MODULE_PARAMETER, moduleName.toSourceText());
            parameters.put(INSTANCE_METHOD_PARAMETER, methodName);
           
            return new NavAddress(INSTANCE_METHOD_METHOD, null, null, parameters);
        }
View Full Code Here

       
        } else if (method == CLASS_INSTANCE_METHOD) {
            ModuleName moduleName = ModuleName.make(getParameter(INSTANCE_MODULE_PARAMETER));
            QualifiedName className = QualifiedName.makeFromCompoundName(getParameter(INSTANCE_CLASS_PARAMETER));
            String typeIdentifier = getParameter(INSTANCE_TYPE_PARAMETER);
            ClassInstanceIdentifier identifier = ClassInstanceIdentifier.make(className, typeIdentifier);
           
            return CALFeatureName.getClassInstanceFeatureName(identifier, moduleName);
           
        } else if (method == INSTANCE_METHOD_METHOD) {
            ModuleName moduleName = ModuleName.make(getParameter(INSTANCE_MODULE_PARAMETER));
            QualifiedName className = QualifiedName.makeFromCompoundName(getParameter(INSTANCE_CLASS_PARAMETER));
            String typeIdentifier = getParameter(INSTANCE_TYPE_PARAMETER);
            String methodName = getParameter(INSTANCE_METHOD_PARAMETER);
            ClassInstanceIdentifier identifier = ClassInstanceIdentifier.make(className, typeIdentifier);
           
            return CALFeatureName.getInstanceMethodFeatureName(identifier, moduleName, methodName);
        }
       
        throw new UnsupportedOperationException("this type of address cannot be converted to a feature name");
View Full Code Here

TOP

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

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.