Package org.andromda.core.configuration

Examples of org.andromda.core.configuration.Model


                        {
                            final Model[] models = repository.getModels();
                            final int modelCount = models.length;
                            for (int ctr2 = 0; ctr2 < modelCount; ctr2++)
                            {
                                final Model model = models[ctr2];
                                execute = ResourceUtils.modifiedAfter(
                                        model.getLastModified(),
                                        directory);
                                if (execute)
                                {
                                    break;
                                }
View Full Code Here


            final ResourceWriter writer = ResourceWriter.instance();

            // - get the time from the model that has the latest modified time
            for (int ctr = 0; ctr < models.length; ctr++)
            {
                final Model model = models[ctr];
                writer.resetHistory(model.getUris()[0]);
                lastModifiedCheck = model.isLastModifiedCheck() && lastModifiedCheck;

                // - we go off the model that was most recently modified.
                if (model.getLastModified() > lastModified)
                {
                    lastModified = model.getLastModified();
                }
            }

            if (!lastModifiedCheck || writer.isHistoryBefore(lastModified))
            {
                final Collection cartridges = ComponentContainer.instance().findComponentsOfType(Cartridge.class);
                if (cartridges.isEmpty())
                {
                    AndroMDALogger.warn("WARNING! No cartridges found, check your classpath!");
                }
               
                final Map cartridgesByNamespace = this.loadCartridgesByNamespace(cartridges);
               
                // - we want to process by namespace so that the order within the configuration is kept
                final Collection namespaces = this.namespaces.getNamespaces();

                // - pre-load the models
                messages = this.loadIfNecessary(models);
                for (final Iterator iterator = namespaces.iterator(); iterator.hasNext();)
                {
                    final Namespace namespace = (Namespace)iterator.next();
                    final Cartridge cartridge = (Cartridge)cartridgesByNamespace.get(namespace.getName());
                    if (cartridge != null)
                    {
                        cartridgeName = cartridge.getNamespace();
                        if (this.shouldProcess(cartridgeName))
                        {
                            // - set the active namespace on the shared factory and profile instances
                            this.factory.setNamespace(cartridgeName);
                            cartridge.initialize();
   
                            // - process each model with the cartridge
                            for (int ctr = 0; ctr < models.length; ctr++)
                            {
                                final Model model = models[ctr];
   
                                // - set the namespace on the metafacades instance so we know the
                                //   correct facades to use
                                this.factory.setModel(
                                    this.repositories.getImplementation(repositoryName).getModel(),
                                    model.getType());
                                cartridge.processModelElements(this.factory);
                                writer.writeHistory();
                            }
                            cartridge.shutdown();
                        }
View Full Code Here

    private Model[] filterInvalidModels(final Model[] models)
    {
        final Collection validModels = new ArrayList(Arrays.asList(models));
        for (final Iterator iterator = validModels.iterator(); iterator.hasNext();)
        {
            final Model model = (Model)iterator.next();
            if (!(model != null && model.getUris() != null && model.getUris().length > 0))
            {
                iterator.remove();
            }
        }
        return (Model[])validModels.toArray(new Model[0]);
View Full Code Here

                        {
                            final Model[] models = repository.getModels();
                            final int modelCount = models.length;
                            for (int ctr2 = 0; ctr2 < modelCount; ctr2++)
                            {
                                final Model model = models[ctr2];
                                execute = ResourceUtils.modifiedAfter(
                                        model.getLastModified(),
                                        directory);
                                if (execute)
                                {
                                    break;
                                }
View Full Code Here

                {
                    final Model[] models = repository.getModels();
                    final int modelCount = models.length;
                    for (int ctr2 = 0; ctr2 < modelCount; ctr2++)
                    {
                        final Model model = models[ctr2];
                if ("emf-uml2".equals(model.getType()))
                {
              String[] uris = model.getUris();
              for (int u = 0; u < uris.length; u++)
              {
                exportFile(uris[u]);
              }           
                }
View Full Code Here

                    if (models != null)
                    {
                        // - we just load only the first model (since it doesn't
                        // make sense
                        // to test with more than one model)
                        final Model model = models[0];
                        repositoriesContainer.loadModel(model);
                        final RepositoryFacade repositoryImplementation =
                            repositoriesContainer.getImplementation(repository.getName());
                        this.model = repositoryImplementation.getModel();

                        // - make sure the factory has access to the model
                        factory.setModel(this.model, model.getType());
                    }
                }
            }
        }
        this.getSuite().run(this.testResult);
View Full Code Here

TOP

Related Classes of org.andromda.core.configuration.Model

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.