Package org.jboss.dna.graph.property

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


            assert this.parent.childrenByName != cache.NO_CHILDREN;
            if (markParentAsChanged) {
                this.parent.markAsChanged();
                this.markAsChanged();
            }
            Name name = getName();
            List<Node<Payload, PropertyPayload>> childrenWithSameName = this.parent.childrenByName.get(name);
            this.parent = null;
            if (childrenWithSameName.size() == 1) {
                // No same-name-siblings ...
                childrenWithSameName.clear();
View Full Code Here


            load();
            if (properties == cache.NO_PROPERTIES) {
                properties = new HashMap<Name, PropertyInfo<PropertyPayload>>();
            }

            Name name = property.getName();
            PropertyInfo<PropertyPayload> previous = properties.get(name);
            Status status = null;
            if (previous != null) {
                status = previous.getStatus(); // keep NEW or CHANGED status, but UNCHANGED -> CHANGED
                if (status == Status.UNCHANGED) status = Status.CHANGED;
View Full Code Here

        public Create<T> and( String name,
                              Object... values ) {
            ExecutionContext context = getContext();
            PropertyFactory factory = context.getPropertyFactory();
            NameFactory nameFactory = context.getValueFactories().getNameFactory();
            Name propertyName = nameFactory.create(name);
            properties.put(propertyName, factory.create(propertyName, values));
            return this;
        }
View Full Code Here

            this.parent = parent;
        }

        public CreateAction<T> nodeNamed( String name ) {
            NameFactory factory = getContext().getValueFactories().getNameFactory();
            Name nameObj = factory.create(name);
            return createWith(afterConjunction(), parent, nameObj);
        }
View Full Code Here

                else sb.append(",");
                if (value instanceof Path) {
                    Path path = (Path)value;
                    sb.append(path.getString(namespaceRegistry, encoder, delimiterEncoder));
                } else if (value instanceof Name) {
                    Name name = (Name)value;
                    sb.append(name.getString(namespaceRegistry, encoder, delimiterEncoder));
                } else {
                    sb.append(value);
                }
            }
            if (isMultiple()) sb.append("]");
View Full Code Here

        // Look up the new parent, which must exist ...
        Path newParentPath = request.into().getPath();
        PathNode newParent = newWorkspace.getNode(newParentPath);
        Set<Location> removedExistingNodes = new HashSet<Location>();
        Name desiredName = request.desiredName();
        PathNode newNode = newWorkspace.copyNode(getExecutionContext(), node, workspace, newParent, desiredName, true);

        Location oldLocation = Location.create(node.getPath(), node.getUuid());
        Location newLocation = Location.create(newNode.getPath(), newNode.getUuid());
        request.setActualLocations(oldLocation, newLocation);
View Full Code Here

        WritablePathWorkspace newWorkspace = (WritablePathWorkspace)intoWorkspace;

        // Look up the new parent, which must exist ...
        Path newParentPath = request.into().getPath();
        Name desiredName = request.desiredName();
        PathNode newParent = newWorkspace.getNode(newParentPath);
        PathNode newNode = newWorkspace.copyNode(getExecutionContext(), node, workspace, newParent, desiredName, true);
        Location oldLocation = Location.create(node.getPath(), node.getUuid());
        Location newLocation = Location.create(newNode.getPath(), newNode.getUuid());
        request.setActualLocations(oldLocation, newLocation);
View Full Code Here

        assert pathToNewNode != null;
        Path path = context.getValueFactories().getPathFactory().create(pathToNewNode);
        if (path.isRoot()) return getRoot();
        Path parentPath = path.getParent();
        MapNode parentNode = getNode(parentPath);
        Name name = path.getLastSegment().getName();
        return createNode(context, parentNode, name, null, properties);
    }
View Full Code Here

        // Why was this restriction here? -- BRC
        // assert newAbstractMapWorkspace.getRoot().equals(newParent) != true;
        assert this.getRoot().equals(node) != true;
        MapNode oldParent = node.getParent();
        Name oldName = node.getName().getName();

        if (this.equals(newAbstractMapWorkspace) && node.getParent().getUuid().equals(newParent.getUuid())
            && node.equals(beforeNode)) {
            // Trivial move of a node to its parent before itself
            return;
        }

        if (oldParent != null) {
            boolean removed = oldParent.removeChild(node);
            assert removed == true;
            node.setParent(null);
            correctSameNameSiblingIndexes(context, oldParent, oldName);
        }
        node.setParent(newParent);
        Name newName = oldName;
        if (desiredNewName != null) {
            newName = desiredNewName;
            node.setName(context.getValueFactories().getPathFactory().createSegment(desiredNewName, 1));
        }
View Full Code Here

        assert newParent != null;
        assert newWorkspace != null;
        boolean reuseUuids = oldToNewUuids == null;

        // Get or create the new node ...
        Name childName = desiredName != null ? desiredName : original.getName().getName();
        UUID uuidForCopy = reuseUuids ? original.getUuid() : UUID.randomUUID();

        MapNode copy = newWorkspace.createNode(context, newParent, childName, uuidForCopy, original.getProperties().values());

        if (!reuseUuids) {
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.