Package org.modeshape.jcr.value

Examples of org.modeshape.jcr.value.NameFactory.create()


                                            SingleColumnIndexOperations operations ) {
        assert indexDefinition.hasSingleColumn();
        String processKey = context.getProcessId();
        NameFactory names = context.getValueFactories().getNameFactory();
        Name nodeTypeName = names.create(indexDefinition.getNodeTypeName());
        Name propName = names.create(indexDefinition.getColumnDefinition(0).getPropertyName());
        return new SinglePropertyIndexChangeSetListener(processKey, nodeTypesSupplier, nodeTypeName, propName, operations);
    }

    /**
     * Create a new ChangeSetListener implementation that can update multi-column indexes. The listener will correctly determine
View Full Code Here


                                            IndexDefinition indexDefinition,
                                            MultiColumnIndexOperations operations ) {
        assert indexDefinition.hasSingleColumn();
        String processKey = context.getProcessId();
        NameFactory names = context.getValueFactories().getNameFactory();
        Name nodeTypeName = names.create(indexDefinition.getNodeTypeName());
        Name[] propNames = new Name[indexDefinition.size()];
        for (int i = 0; i != indexDefinition.size(); ++i) {
            propNames[i] = names.create(indexDefinition.getColumnDefinition(i).getPropertyName());
        }
        return new MultiPropertyIndexChangeSetListener(processKey, nodeTypesSupplier, nodeTypeName, propNames, operations);
View Full Code Here

        String processKey = context.getProcessId();
        NameFactory names = context.getValueFactories().getNameFactory();
        Name nodeTypeName = names.create(indexDefinition.getNodeTypeName());
        Name[] propNames = new Name[indexDefinition.size()];
        for (int i = 0; i != indexDefinition.size(); ++i) {
            propNames[i] = names.create(indexDefinition.getColumnDefinition(i).getPropertyName());
        }
        return new MultiPropertyIndexChangeSetListener(processKey, nodeTypesSupplier, nodeTypeName, propNames, operations);
    }

    /**
 
View Full Code Here

    @Override
    public Name getPrimaryType( NodeCache cache ) {
        AbstractSessionCache session = session(cache);
        Property prop = getProperty(JcrLexicon.PRIMARY_TYPE, session);
        NameFactory nameFactory = session.nameFactory();
        return prop != null ? nameFactory.create(prop.getFirstValue()) : nameFactory.create((Object)null);
    }

    @Override
    public boolean hasChangedPrimaryType() {
        return changedProperties.containsKey(JcrLexicon.PRIMARY_TYPE);
View Full Code Here

    @Override
    public Name getPrimaryType( NodeCache cache ) {
        AbstractSessionCache session = session(cache);
        Property prop = getProperty(JcrLexicon.PRIMARY_TYPE, session);
        NameFactory nameFactory = session.nameFactory();
        return prop != null ? nameFactory.create(prop.getFirstValue()) : nameFactory.create((Object)null);
    }

    @Override
    public boolean hasChangedPrimaryType() {
        return changedProperties.containsKey(JcrLexicon.PRIMARY_TYPE);
View Full Code Here

            return changes != null ? changes.getAdded() : Collections.<Name>emptySet();
        }

        final NameFactory nameFactory = session.nameFactory();
        if (prop.size() == 1) {
            Name name = nameFactory.create(prop.getFirstValue());
            if (changes == null) return Collections.singleton(name);
            Set<Name> all = new HashSet<Name>(changes.getAdded());
            all.add(name);
            all.removeAll(changes.getRemoved());
            return all;
View Full Code Here

            all.removeAll(changes.getRemoved());
            return all;
        }
        Set<Name> names = new HashSet<Name>();
        for (Object value : prop) {
            Name name = nameFactory.create(value);
            if (changes == null || !changes.getRemoved().contains(name)) names.add(name);
        }
        if (changes != null) names.addAll(changes.getAdded());
        return names;
    }
View Full Code Here

            return Collections.emptySet();
        }
        final NameFactory nameFactory = session(cache).nameFactory();
        Set<Name> names = new HashSet<Name>();
        for (Object value : prop) {
            Name name = nameFactory.create(value);
            names.add(name);
        }
        return names;
    }
View Full Code Here

        //go through the new map of permissions and update/create the internal nodes
        NameFactory nameFactory = cache.getContext().getValueFactories().getNameFactory();

        for (String principal : privilegesByPrincipalName.keySet()) {
            Name principalName = nameFactory.create(principal);
            ChildReference permissionRef = permissionsReferences.getChild(principalName);
            if (permissionRef == null) {
                //this is a new principal
                permissionChanges().principalAdded(principal);
                org.modeshape.jcr.value.Property primaryType = propertyFactory.create(
View Full Code Here

            };
        }
        if (constraint instanceof PropertyExistence) {
            PropertyExistence propertyExistance = (PropertyExistence)constraint;
            NameFactory names = context.getExecutionContext().getValueFactories().getNameFactory();
            final Name propertyName = names.create(propertyExistance.getPropertyName());
            final String selectorName = propertyExistance.selectorName().name();
            final int index = columns.getSelectorIndex(selectorName);
            final NodeCache cache = context.getNodeCache(sources.getWorkspaceName());
            assert index >= 0;
            return new RowFilter() {
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.