Examples of NamespaceRegistry


Examples of org.andromda.core.namespace.NamespaceRegistry

                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

Examples of org.andromda.core.namespace.NamespaceRegistry

     * @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

Examples of org.andromda.core.namespace.NamespaceRegistry

     * @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

Examples of org.andromda.core.namespace.NamespaceRegistry

    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

Examples of org.andromda.core.namespace.NamespaceRegistry

     */
    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

Examples of org.jboss.dna.graph.property.NamespaceRegistry

        }
    }

    @Test
    public void shouldOnlyHaveOneDnaNamespacesNode() throws Exception {
        NamespaceRegistry registry = context.getNamespaceRegistry();

        Node rootNode = session.getRootNode();
        assertThat(rootNode, is(notNullValue()));

        Node systemNode = rootNode.getNode(JcrLexicon.SYSTEM.getString(registry));
View Full Code Here

Examples of org.jboss.dna.graph.property.NamespaceRegistry

        assertEquals(namespacesNodes.getSize(), 1);
    }

    @Test
    public void shouldOnlyHaveOneNodeTypesNode() throws Exception {
        NamespaceRegistry registry = context.getNamespaceRegistry();

        Node rootNode = session.getRootNode();
        assertThat(rootNode, is(notNullValue()));

        Node systemNode = rootNode.getNode(JcrLexicon.SYSTEM.getString(registry));
View Full Code Here

Examples of org.jboss.dna.graph.property.NamespaceRegistry

        assertEquals(1, nodeTypesNodes.getSize());
    }

    @Test
    public void shouldAllowMultipleSiblingsDefinitionIfOneSibling() throws Exception {
        NamespaceRegistry registry = context.getNamespaceRegistry();

        // There's no definition for this node or for a * child node that does not allow SNS
        JcrNodeDefinition def = repoTypeManager.findChildNodeDefinition(JcrNtLexicon.NODE_TYPE,
                                                                        Collections.<Name>emptyList(),
                                                                        JcrLexicon.PROPERTY_DEFINITION,
View Full Code Here

Examples of org.jboss.dna.graph.property.NamespaceRegistry

        assertEquals(def.getName(), JcrLexicon.PROPERTY_DEFINITION.getString(registry));
    }

    public void shouldProjectOntoWorkspaceGraph() throws Exception {
        // projectOnto is called in the JcrWorkspace constructor... just test that the nodes show up
        NamespaceRegistry registry = context.getNamespaceRegistry();

        Node rootNode = session.getRootNode();
        assertThat(rootNode, is(notNullValue()));

        Node systemNode = rootNode.getNode(JcrLexicon.SYSTEM.getString(registry));
View Full Code Here

Examples of org.jboss.dna.graph.property.NamespaceRegistry

            throw new IllegalStateException("Unexpected constraints for property: " + property);
        }
    }

    private NodeType validateTypeDefinition() throws Exception {
        NamespaceRegistry nsr = context.getNamespaceRegistry();

        NodeType constrainedType = nodeTypeManager.getNodeType(TestLexicon.CONSTRAINED_TYPE.getString(nsr));
        assertThat(constrainedType, notNullValue());
        assertThat(propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_BINARY), notNullValue());
        assertThat(propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_DATE), notNullValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.