Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleName


     * @param moduleNameToWorkspaceDeclInfoMap a map containing the names of the modules included by the workspace declaration and
     *         their associated entries in all the workspace declarations in the tree. This will be populated by this method.
     * @param status the tracking status object.
     */
    private static void addStoredModuleToMapHelper(StoredVaultElement.Module storedModule, String workspaceDeclarationName, Set<ModuleName> moduleNamesInCurrentDeclaration, Map<ModuleName, StoredVaultElement.Module> nameToStoredModuleMap, Map<ModuleName, LinkedHashSet<Pair<String, VaultElementInfo>>> moduleNameToWorkspaceDeclInfoMap, Status status) {
        ModuleName moduleName = ModuleName.maybeMake(storedModule.getName());
        if (moduleName == null) {
            status.add(new Status(Status.Severity.ERROR, "The name " + storedModule.getName() + " is not a valid module name", null));
        }
       
        // Add to the stored module map if a stored module by that name doesn't already exist in the map.
View Full Code Here


        }
       
        List<ModuleName> moduleNameList = new ArrayList<ModuleName>();
        for (final File file : files) {
            String fileName = file.getName();
            ModuleName moduleName = ProgramResourceLocator.createModuleNameFromPackageNameSegment(fileName);
            if (moduleName != null) {
                moduleNameList.add(moduleName);
            }
        }
       
View Full Code Here

       
        // Just attach the component module descriptions to the top-level document root.
        ModuleName[] moduleNames = workspace.getModuleNames();
        int nModules = moduleNames.length;
        for (int i = 0; i < nModules; i++) {
            ModuleName moduleName = moduleNames[i];
            saveWorkspaceModuleDescription(resultElement, moduleName, resourceInfo);
        }
       
       
        // Attach namespace and schema info.
View Full Code Here

        if (moduleNameString.equals("")) {
            String errorString = "Could not obtain module from workspace description.";
            throw new BadXMLDocumentException(moduleDescriptionElement, errorString);
        }
       
        ModuleName moduleName = ModuleName.make(moduleNameString);
       
        List<Element> childElems = XMLPersistenceHelper.getChildElements(moduleDescriptionElement);
        int nChildElems = childElems.size();

        // Get the vault info element.
        Element vaultElement = (nChildElems < 1) ? null : childElems.get(0);
        XMLPersistenceHelper.checkIsElement(vaultElement);

        // Get the module revision.
        Element moduleRevisionElement = (nChildElems < 2) ? null : childElems.get(1);
        XMLPersistenceHelper.checkTag(moduleRevisionElement, WorkspacePersistenceConstants.MODULE_REVISION_TAG);
        Integer moduleRevisionNum = XMLPersistenceHelper.getElementIntegerValue(moduleRevisionElement);
       
        if (moduleRevisionNum == null) {
            throw new BadXMLDocumentException(moduleRevisionElement, "No module revision found.");
        }
       
        // Get resource info.
        Element revisionInfoElement = (nChildElems < 3) ? null : childElems.get(2);
        XMLPersistenceHelper.checkIsElement(revisionInfoElement);
        CALWorkspace.ResourceInfo resourceInfo = loadResourceInfo(revisionInfoElement);
       
        // Update the resource info.
        workspace.updateResourceInfo(resourceInfo);

        // Get the module location.
        VaultLocation storedModuleLocation = getVaultLocation(vaultElement);
       
        // Create the vault info.
        VaultElementInfo vaultInfo = VaultElementInfo.makeBasic(storedModuleLocation.getVaultDescriptor(),
                                                          moduleName.toSourceText(),
                                                          storedModuleLocation.getLocationString(),
                                                          moduleRevisionNum.intValue());
       
        // Update the info map.
        workspace.updateVaultInfo(moduleName, vaultInfo);
View Full Code Here

       
        /**
         * {@inheritDoc}
         */
        public InputStream getInputStream(ResourceName resourceName) {
            ModuleName moduleName = checkModuleName(resourceName);
           
            if (calSourceFile == null || !this.moduleName.equals(moduleName)) {
                return null;
            }

View Full Code Here

        /**
         * {@inheritDoc}
         */
        public OutputStream getOutputStream(ResourceName resourceName, Status status) {
            ModuleName moduleName = checkModuleName(resourceName);
           
            if (calSourceFile == null || !this.moduleName.equals(moduleName)) {
                return null;
            }
            try {
View Full Code Here

       
        /**
         * {@inheritDoc}
         */
        public String getDebugInfo(ResourceName resourceName) {
            ModuleName moduleName = checkModuleName(resourceName);
           
            if (calSourceFile == null || !this.moduleName.equals(moduleName)) {
                return null;
            }

View Full Code Here

        /**
         * {@inheritDoc}
         */
        public boolean hasFeature(ResourceName resourceName) {
            ModuleName moduleName = checkModuleName(resourceName);
            return calSourceFile != null && calSourceFile.exists() && this.moduleName.equals(moduleName);
        }
View Full Code Here

        /**
         * {@inheritDoc}
         */
        public long getTimeStamp(ResourceName resourceName) {
            ModuleName moduleName = checkModuleName(resourceName);
           
            if (calSourceFile != null && this.moduleName.equals(moduleName)) {
                return calSourceFile.lastModified();
            }
           
View Full Code Here

        /**
         * {@inheritDoc}
         */
        public boolean isWriteable(ResourceName resourceName) {
            ModuleName moduleName = checkModuleName(resourceName);
           
            if (calSourceFile != null && this.moduleName.equals(moduleName)) {
                return calSourceFile.canWrite();
            }
            return false;
View Full Code Here

TOP

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

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.