Package org.andromda.core.configuration

Examples of org.andromda.core.configuration.Property


     */
    public void testTemplateMerging()
        throws Exception
    {
        final String packagePath = this.getClass().getPackage().getName().replace('.', '/');
        Property mergeMappings = new Property();
        URL mergeMappingsUri = VelocityTemplateEngineTest.class.getResource(
            "/" + packagePath + "/merge-mappings.xml");
        assertNotNull(mergeMappingsUri);
        mergeMappings.setName(NamespaceProperties.MERGE_MAPPINGS_URI);
        mergeMappings.setValue(mergeMappingsUri.toString());
        final String namespaceName = "test-namespace";
        final Namespace namespace = new Namespace();
        namespace.setName(namespaceName);
        namespace.addProperty(mergeMappings);
        Namespaces.instance().addNamespace(namespace);
View Full Code Here


        throws Exception
    {
        // set the template engine merge location (this needs to be
        // set before the template engine is initialized) so that the
        // merge property can be set once on the template engine.
        final Property mergeProperty =
            Namespaces.instance().getProperty(
                this.getNamespace(),
                NamespaceProperties.MERGE_LOCATION,
                false);
        this.mergeLocation = mergeProperty != null ? new File(mergeProperty.getValue()).toURI().toURL() : null;
        if (this.mergeLocation != null)
        {
            this.getTemplateEngine().setMergeLocation(this.getMergeLocation().getFile());
        }
        this.getTemplateEngine().initialize(this.getNamespace());
View Full Code Here

     *
     * @return Returns the overwrite.
     */
    public boolean isOverwrite()
    {
        final Property property =
            Namespaces.instance().getProperty(
                this.getCartridge().getNamespace(),
                NamespaceProperties.OVERWRITE,
                false);
        if (property != null)
        {
            this.overwrite = Boolean.valueOf(property.getValue()).booleanValue();
        }
        return this.overwrite;
    }
View Full Code Here

            final Property[] properties = configuration.getProperties();
            final int propertyNumber = properties.length;
            final Introspector introspector = Introspector.instance();
            for (int ctr = 0; ctr < propertyNumber; ctr++)
            {
                final Property property = properties[ctr];
                try
                {
                    introspector.setProperty(
                        this,
                        property.getName(),
                        property.getValue());
                }
                catch (final Throwable throwable)
                {
                    AndroMDALogger.warn(
                        "Could not set model processor property '" + property.getName() + "' with a value of '" +
                        property.getValue() + "'");
                }
            }
            this.currentConfiguration = configuration;
        }
    }
View Full Code Here

    {
        // - clear out the instance's elements
        this.elements.clear();
        try
        {
            final Property mappingsUri =
                Namespaces.instance().getProperty(
                    Namespaces.DEFAULT,
                    NamespaceProperties.PROFILE_MAPPINGS_URI,
                    false);
            final String mappingsUriValue = mappingsUri != null ? mappingsUri.getValue() : null;
            if (mappingsUriValue != null)
            {
                final XmlObjectFactory factory = XmlObjectFactory.getInstance(Profile.class);
                final Profile profile = (Profile)factory.getObject(new URL(mappingsUriValue.trim()));
                this.elements.putAll(profile.elements);
View Full Code Here

        Namespace namespace = new Namespace();
        namespace.setName(Namespaces.DEFAULT);
        Namespaces.instance().addNamespace(namespace);
        URL profileOverrideResource = ProfileTest.class.getResource("/META-INF/profile/andromda-profile-override.xml");
        assertNotNull(profileOverrideResource);
        Property property = new Property();
        property.setName(NamespaceProperties.PROFILE_MAPPINGS_URI);
        property.setValue(profileOverrideResource.toString());
        namespace.addProperty(property);
        Profile.instance().refresh();
        assertEquals(
            "New Entity",
            Profile.instance().get("ENTITY"));
View Full Code Here

    public void testAddAndFindNamespaceProperty()
    {
        Namespace namespace = new Namespace();
        namespace.setName(TEST_NAMESPACE);
        Property outletLocation = new Property();
        outletLocation.setName(TEST_OUTLET);
        outletLocation.setValue(TEST_LOCATION);
        namespace.addProperty(outletLocation);
        Namespaces.instance().addNamespace(namespace);

        assertEquals(
            outletLocation,
View Full Code Here

TOP

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

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.