Package org.andromda.core.metafacade

Examples of org.andromda.core.metafacade.ModelAccessFacade


                    //   template.
                    for (final Iterator iterator = allMetafacades.iterator(); iterator.hasNext();)
                    {
                        final Map templateContext = new LinkedHashMap();
                        final Object metafacade = iterator.next();
                        final ModelAccessFacade model = factory.getModel();
                        for (final Iterator elements = modelElements.getModelElements().iterator(); elements.hasNext();)
                        {
                            final ModelElement modelElement = (ModelElement)elements.next();
                            String variable = modelElement.getVariable();

                            // - if the variable isn't defined on the <modelElement/>, try
                            //   the <modelElements/>
                            if (variable == null || variable.trim().length() == 0)
                            {
                                variable = modelElements.getVariable();
                            }

                            // - only add the metafacade to the template context if the variable
                            //   is defined (which is possible)
                            if (variable != null && variable.trim().length() > 0)
                            {
                                templateContext.put(
                                    variable,
                                    metafacade);
                            }

                            // - now we process any property templates (if any 'variable' attributes are defined on one or
                            //   more type's given properties), otherwise we process the single metafacade as usual
                            if (!this.processPropertyTemplates(
                                    template,
                                    metafacade,
                                    templateContext,
                                    modelElement))
                            {
                                this.processWithTemplate(
                                    template,
                                    templateContext,
                                    model.getName(metafacade),
                                    model.getPackageName(metafacade));
                            }
                        }
                    }
                }
            }
View Full Code Here


        if (this.modelValidation)
        {
            final long startTime = System.currentTimeMillis();
            AndroMDALogger.info("- validating model -");
            final Collection cartridges = ComponentContainer.instance().findComponentsOfType(Cartridge.class);
            final ModelAccessFacade modelAccessFacade =
                this.repositories.getImplementation(repositoryName).getModel();

            // - clear out the factory's caches (such as any previous validation messages, etc.)
            this.factory.clearCaches();
            this.factory.setModel(
View Full Code Here

        throws Exception
    {
        repository.readModel(
            new String[] {modelURL.toString()},
            null);
        final ModelAccessFacade modelFacade = repository.getModel();
        UmlPackage umlPackage = (UmlPackage)modelFacade.getModel();
        ModelManagementPackage modelManagementPackage = umlPackage.getModelManagement();

        // A given XMI file can contain multiptle models.
        // Use the first model in the XMI file
        Model model = (Model)(modelManagementPackage.getModel().refAllOfType().iterator().next());
View Full Code Here

    public void testGetModel()
    {
        repository.readModel(
            new String[] {modelURL.toString()},
            null);
        final ModelAccessFacade model = repository.getModel();
        assertNotNull(model);
        assertNotNull(model.getModel());
        assertTrue(model.getModel() instanceof UmlPackage);
    }
View Full Code Here

    public void testGetModel()
    {
        repository.readModel(
            new String[] {modelUrl.toString()},
            null);
        final ModelAccessFacade modelFacade = repository.getModel();
        assertNotNull(modelFacade);
        assertNotNull(modelFacade.getModel());
        assertTrue(modelFacade.getModel() instanceof UML2Resource);
        Model model = (Model)EcoreUtil.getObjectByType(
            ((UML2Resource)repository.getModel().getModel()).getContents(),
            EcorePackage.eINSTANCE.getEObject());
        assertEquals(
            "Test Model",
View Full Code Here

 
  public void processModelElements(Object aFactory) {

    MetafacadeFactory factory = (MetafacadeFactory)aFactory;
   
    ModelAccessFacade model = factory.getModel();

    init(model);

    Package p = getPackage(targetPackage, model);
    if (p == null) {
View Full Code Here

TOP

Related Classes of org.andromda.core.metafacade.ModelAccessFacade

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.