Package org.jboss.dna.graph.property

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


     * @return the node type name
     * @throws ParsingException if there is a problem parsing the content
     */
    protected Name parseNodeTypeName( TokenStream tokens ) {
        tokens.consume('[');
        Name name = parseName(tokens);
        tokens.consume(']');
        return name;
    }
View Full Code Here


        // Set up the defaults ...
        boolean isOrderable = false;
        boolean isMixin = false;
        boolean isAbstract = false;
        boolean isQueryable = true;
        Name primaryItem = null;
        String onParentVersion = "COPY";
        while (true) {
            // Keep reading while we see a valid option ...
            if (tokens.canConsumeAnyOf("ORDERABLE", "ORD", "O")) {
                tokens.canConsume('?');
View Full Code Here

     * @throws ParsingException if there is a problem parsing the content
     */
    protected void parsePropertyDefinition( TokenStream tokens,
                                            Path nodeTypePath ) {
        tokens.consume('-');
        Name name = parseName(tokens);
        Path path = pathFactory.create(nodeTypePath, JcrLexicon.PROPERTY_DEFINITION);
        List<Property> properties = new ArrayList<Property>();
        properties.add(propertyFactory.create(JcrLexicon.NAME, name));

        // Parse the (optional) required type ...
View Full Code Here

     * @throws ParsingException if there is a problem parsing the content
     */
    protected void parseChildNodeDefinition( TokenStream tokens,
                                             Path nodeTypePath ) {
        tokens.consume('+');
        Name name = parseName(tokens);
        Path path = pathFactory.create(nodeTypePath, JcrLexicon.CHILD_NODE_DEFINITION);
        List<Property> properties = new ArrayList<Property>();
        properties.add(propertyFactory.create(JcrLexicon.NAME, name));

        parseRequiredPrimaryTypes(tokens, properties);
View Full Code Here

     */
    protected void parseDefaultType( TokenStream tokens,
                                     List<Property> properties ) {
        if (tokens.canConsume('=')) {
            if (!tokens.canConsume('?')) {
                Name defaultType = parseName(tokens);
                properties.add(propertyFactory.create(JcrLexicon.DEFAULT_PRIMARY_TYPE, defaultType));
            }
        }
    }
View Full Code Here

        public void materialize( org.jboss.dna.graph.Node persistentNode,
                                 Node<Payload, PropertyPayload> node ) {
            // Create the map of property info objects ...
            Map<Name, PropertyInfo<PropertyPayload>> properties = new HashMap<Name, PropertyInfo<PropertyPayload>>();
            for (Property property : persistentNode.getProperties()) {
                Name propertyName = property.getName();
                PropertyInfo<PropertyPayload> info = new PropertyInfo<PropertyPayload>(property, property.isMultiple(),
                                                                                       Status.UNCHANGED, null);
                properties.put(propertyName, info);
            }
            // Set only the children ...
View Full Code Here

                // Now, clear the children ...
                childrenByName.clear();

                // And add the persistent children ...
                for (Location location : persistentNode.getChildren()) {
                    Name childName = location.getPath().getLastSegment().getName();
                    List<Node<Payload, PropertyPayload>> currentChildren = childrenByName.get(childName);
                    // Find if there was an existing child that is supposed to stay ...
                    Node<Payload, PropertyPayload> existingChild = childrenToKeep.get(location);
                    if (existingChild != null) {
                        // The existing child is supposed to stay, since it has changes ...
View Full Code Here

                childrenByName = cache.NO_CHILDREN;
            } else {
                childrenByName = Multimaps.newLinkedListMultimap();
                for (Location location : children) {
                    NodeId id = cache.idFactory.create();
                    Name childName = location.getPath().getLastSegment().getName();
                    Node<Payload, PropertyPayload> child = cache.createNode(this, id, location);
                    cache.nodes.put(child.getNodeId(), child);
                    List<Node<Payload, PropertyPayload>> currentChildren = childrenByName.get(childName);
                    currentChildren.add(child);
                    child.parent = this;
View Full Code Here

            }

            if (isLoaded() && childrenByName != cache.NO_CHILDREN) {
                // Update all of the children ...
                for (Map.Entry<Name, Collection<Node<Payload, PropertyPayload>>> entry : childrenByName.asMap().entrySet()) {
                    Name childName = entry.getKey();
                    int sns = 1;
                    for (Node<Payload, PropertyPayload> child : entry.getValue()) {
                        Path.Segment childSegment = cache.pathFactory.createSegment(childName, sns++);
                        child.updateLocation(childSegment);
                    }
View Full Code Here

         * @param newChild the new child that was added
         */
        protected void synchronizeWithNewlyPersistedNode( Location newChild ) {
            if (!this.isLoaded()) return;
            Path childPath = newChild.getPath();
            Name childName = childPath.getLastSegment().getName();
            if (this.childrenByName.isEmpty()) {
                // Just have to add the child ...
                this.childrenByName = Multimaps.newLinkedListMultimap();
                if (childPath.getLastSegment().hasIndex()) {
                    // The child has a SNS index, but this is an only child ...
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.