Package org.andromda.core.namespace

Examples of org.andromda.core.namespace.NamespaceRegistry


                {
                    final Namespaces namespacesConfiguration = Namespaces.instance();
                    for (final Iterator iterator = namespacesConfiguration.getNamespaceRegistries().iterator();
                        iterator.hasNext();)
                    {
                        final NamespaceRegistry namespaceRegistry = (NamespaceRegistry)iterator.next();
                        final String namespaceRegistryName = namespaceRegistry.getName();
                        if (!modelNamespaces.contains(namespaceRegistryName))
                        {
                            this.registerMetafacadeClasses(
                                metafacadeClasses,
                                namespacesConfiguration,
View Full Code Here


     * @param namespaceName the name of the namespace.
     * @return the list of properties contained in the namespace.
     */
    public PropertyDefinition[] getPropertyDefinitions(final String namespaceName)
    {
        final NamespaceRegistry registry = this.getRegistry(namespaceName);
        return registry == null ? new PropertyDefinition[0] : registry.getPropertyDefinitions();
    }
View Full Code Here

                registry);

            // - if the registry is shared, we add the registry to the default namespace as well
            if (registry.isShared())
            {
                NamespaceRegistry defaultRegistry = this.getRegistry(Namespaces.DEFAULT);
                if (defaultRegistry == null)
                {
                    defaultRegistry = registry;
                }
                else
                {
                    defaultRegistry.addPropertyDefinitions(registry.getPropertyDefinitions());
                }
                this.registries.put(
                    Namespaces.DEFAULT,
                    defaultRegistry);
            }
View Full Code Here

     * @param namespace the namespace to check.
     * @return true/false.
     */
    public boolean isShared(final String namespace)
    {
        final NamespaceRegistry registry = this.getRegistry(namespace);
        return registry != null && registry.isShared();
    }
View Full Code Here

     * @param namespace the namespace of which to retrieve the resource.
     * @return the resource or null if it could not be found.
     */
    public URL[] getResourceRoots(final String namespace)
    {
        final NamespaceRegistry registry = this.getRegistry(namespace);
        if (registry == null)
        {
            throw new NamespacesException("'" + namespace + "' is not a registered namespace");
        }

        final URL[] resourceRoots = registry.getResourceRoots();
        if (resourceRoots == null || resourceRoots.length == 0)
        {
            throw new NamespacesException("No resource root(s) could be retrieved for namespace '" + namespace + "'");
        }
        return resourceRoots;
View Full Code Here

    public boolean isComponentPresent(
        final String namespace,
        final String component)
    {
        boolean present = false;
        final NamespaceRegistry registry = this.getRegistry(namespace);
        if (namespace != null && component != null && registry != null)
        {
            final String[] components = registry.getRegisteredComponents();
            final int numberOfComponents = components.length;
            for (int ctr = 0; ctr < numberOfComponents; ctr++)
            {
                if (component.equals(components[ctr]))
                {
View Full Code Here

     */
    private PropertyDefinition getPropertyDefinition(
        final String namespace,
        final String name)
    {
        final NamespaceRegistry registry = this.getRegistry(namespace);
        PropertyDefinition definition = null;
        if (registry != null)
        {
            definition = registry.getPropertyDefinition(name);
        }
        if (definition == null)
        {
            final NamespaceRegistry defaultRegistry = this.getRegistry(Namespaces.DEFAULT);
            if (defaultRegistry != null)
            {
                definition = defaultRegistry.getPropertyDefinition(name);
            }
        }
        return definition;
    }
View Full Code Here

TOP

Related Classes of org.andromda.core.namespace.NamespaceRegistry

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.