Package org.jboss.dna.graph.property

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


        CheckArg.isNotNull(propertyName, "propertyName");
        if (values == null || values.length == 0) {
            return canRemoveProperty(propertyName);
        }

        Name name = context.getValueFactories().getNameFactory().create(propertyName);
        // Reuse the logic in RepositoryNodeTypeManager ...
        return nodeTypeManager().findPropertyDefinition(this.name, null, name, values, true) != null;
    }
View Full Code Here


        return nodeTypeManager().findPropertyDefinition(this.name, null, name, values, true) != null;
    }

    public boolean canRemoveProperty( String propertyName ) {
        CheckArg.isNotNull(propertyName, "propertyName");
        Name name = context.getValueFactories().getNameFactory().create(propertyName);

        // Reuse the logic in RepositoryNodeTypeManager ...
        return nodeTypeManager().canRemoveProperty(this.name, null, name, true);
    }
View Full Code Here

     *
     * @see javax.jcr.nodetype.NodeType#isNodeType(java.lang.String)
     */
    public boolean isNodeType( String nodeTypeName ) {
        if (nodeTypeName == null) return false;
        Name name = context.getValueFactories().getNameFactory().create(nodeTypeName);
        return this.thisAndAllSupertypesNames.contains(name);
    }
View Full Code Here

                                 NodeType[] mixinNodeTypes ) {
        Map<PropertyDefinitionId, JcrPropertyDefinition> props = new HashMap<PropertyDefinitionId, JcrPropertyDefinition>();
        /*
         * Need to have the same parent name for all PropertyDefinitionIds and NodeDefinitionIds as we're checking for conflicts on the definition name
         */
        final Name DEFAULT_NAME = this.name;

        for (JcrPropertyDefinition property : propertyDefinitions()) {
            /*
             * I'm trying really hard to reuse existing code, but it's a stretch in this case.  I don't care about the property
             * types or where they were declared... if more than one definition with the given name exists (not counting definitions
View Full Code Here

     * {@inheritDoc}
     *
     * @see javax.jcr.nodetype.NodeTypeManager#getNodeType(java.lang.String)
     */
    public JcrNodeType getNodeType( String nodeTypeName ) throws NoSuchNodeTypeException, RepositoryException {
        Name ntName = context().getValueFactories().getNameFactory().create(nodeTypeName);
        JcrNodeType type = repositoryTypeManager.getNodeType(ntName);
        if (type != null) {
            type = type.with(context());
            return type;
        }
View Full Code Here

            nodeTypeManagerLock.writeLock().lock();
            for (Location location : nodeTypeLocations) {
                Node nodeTypeNode = nodeTypeSubgraph.getNode(location);
                assert location.getPath() != null;

                Name internalName = location.getPath().getLastSegment().getName();
                if (internalName == null || internalName.getLocalName().length() == 0) {
                    throw new InvalidNodeTypeDefinitionException(JcrI18n.invalidNodeTypeName.text());
                }

                if (nodeTypes.containsKey(internalName)) {
                    throw new NodeTypeExistsException(internalName,
                                                      JcrI18n.nodeTypeAlreadyExists.text(internalName.getString(namespaces)));
                }

                List<JcrNodeType> supertypes = supertypesFor(nodeTypeNode, typesPendingRegistration);
                // No need to re-parse the supertypes
                JcrNodeType nodeType = nodeTypeFrom(nodeTypeSubgraph, location, supertypes);
View Full Code Here

        ValueFactories valueFactories = context.getValueFactories();
        NameFactory nameFactory = valueFactories.getNameFactory();
        ValueFactory<Boolean> booleanFactory = valueFactories.getBooleanFactory();

        Name name = nameFactory.create(getFirstPropertyValue(nodeProperties.get(JcrLexicon.NODE_TYPE_NAME)));
        Name primaryItemName = nameFactory.create(getFirstPropertyValue(nodeProperties.get(JcrLexicon.PRIMARY_ITEM_NAME)));
        boolean mixin = booleanFactory.create(getFirstPropertyValue(nodeProperties.get(JcrLexicon.IS_MIXIN)));
        boolean orderableChildNodes = booleanFactory.create(getFirstPropertyValue(nodeProperties.get(JcrLexicon.HAS_ORDERABLE_CHILD_NODES)));

        return new JcrNodeType(this.context, this, name, supertypes, primaryItemName, childNodes, properties, mixin,
                               orderableChildNodes);
View Full Code Here

        ValueFactories valueFactories = context.getValueFactories();
        NameFactory nameFactory = valueFactories.getNameFactory();
        ValueFactory<Boolean> booleanFactory = valueFactories.getBooleanFactory();

        Name propertyName = nameFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.NAME)));
        int onParentVersionBehavior = OnParentVersionAction.valueFromName((String)getFirstPropertyValue(properties.get(JcrLexicon.ON_PARENT_VERSION)));
        int requiredType = PROPERTY_TYPE_VALUES_FROM_NAME.get(getFirstPropertyValue(properties.get(JcrLexicon.REQUIRED_TYPE)));

        boolean mandatory = booleanFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.MANDATORY)));
        boolean multiple = booleanFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.MULTIPLE)));
View Full Code Here

        ValueFactories valueFactories = context.getValueFactories();
        NameFactory nameFactory = valueFactories.getNameFactory();
        ValueFactory<Boolean> booleanFactory = valueFactories.getBooleanFactory();

        Name childNodeName = nameFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.NAME)));
        Name defaultPrimaryTypeName = nameFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.DEFAULT_PRIMARY_TYPE)));
        int onParentVersion = OnParentVersionAction.valueFromName((String)getFirstPropertyValue(properties.get(JcrLexicon.ON_PARENT_VERSION)));

        boolean mandatory = booleanFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.MANDATORY)));
        boolean allowsSns = booleanFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.SAME_NAME_SIBLINGS)));
        boolean autoCreated = booleanFactory.create(getFirstPropertyValue(properties.get(JcrLexicon.AUTO_CREATED)));
View Full Code Here

        for (int i = 0; i < supertypesArray.length; i++) {
            supertypes.add(findTypeInMapOrList((Name)supertypesArray[i], pendingTypes));

            if (supertypes.get(i) == null) {
                Name nodeTypeName = nodeType.getLocation().getPath().getLastSegment().getName();
                throw new InvalidNodeTypeDefinitionException(JcrI18n.invalidSupertypeName.text(supertypesArray[i], nodeTypeName));
            }
        }

        return supertypes;
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.property.Name

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.