Package org.exist.memtree

Examples of org.exist.memtree.NodeImpl


                        if (newDoc != null) {
                            NodeId rootId = newDoc.getBrokerPool().getNodeFactory().createInstance();
                            for (int j = i; j < count; j++) {
                                v = (NodeValue) items[j].item;
                                if(v.getImplementationType() != NodeValue.PERSISTENT_NODE) {
                                    NodeImpl node = (NodeImpl) v;
                                    if (node.getDocument() == doc) {
                                        node = expandedDoc.getNode(node.getNodeNumber());
                                        NodeId nodeId = node.getNodeId();
                                        if (nodeId == null)
                                            {throw new XPathException("Internal error: nodeId == null");}
                                        if (node.getNodeType() == Node.DOCUMENT_NODE)
                                            {nodeId = rootId;}
                                        else
                                            {nodeId = rootId.append(nodeId);}
                                        NodeProxy p = new NodeProxy(newDoc, nodeId, node.getNodeType());
                                        if (p != null) {
                                            // replace the node by the NodeProxy
                                            items[j].item = p;
                                        }
                                    }
View Full Code Here


        }

        if (newDocumentContext)
            {context.pushDocumentContext();}
       
        NodeImpl node;
        try {
            final MemTreeBuilder builder = context.getDocumentBuilder();
            builder.setReplaceAttributeFlag(replaceAttribute);
            context.proceed(this, builder);
View Full Code Here

        if (newDocumentContext)
            {context.pushDocumentContext();}
        try {
            final MemTreeBuilder builder = context.getDocumentBuilder();
            final int nodeNr = builder.processingInstruction(target, data);
            final NodeImpl node = builder.getDocument().getNode(nodeNr);
            return node;
        } finally {
            if (newDocumentContext)
                {context.popDocumentContext();}
        }
View Full Code Here

                    if (newDoc != null) {
                        NodeId rootId = newDoc.getBrokerPool().getNodeFactory().createInstance();
                        for (int j = i; j <= size; j++) {
                            v = (NodeValue) values[j];
                            if(v.getImplementationType() != NodeValue.PERSISTENT_NODE) {
                                NodeImpl node = (NodeImpl) v;
                                if (node.getDocument() == doc) {
                                    if (node.getNodeType() == Node.ATTRIBUTE_NODE)
                                        {node = expandedDoc.getAttribute(node.getNodeNumber());}
                                    else
                                        {node = expandedDoc.getNode(node.getNodeNumber());}
                                    NodeId nodeId = node.getNodeId();
                                    if (nodeId == null)
                                        {throw new XPathException("Internal error: nodeId == null");}
                                    if (node.getNodeType() == Node.DOCUMENT_NODE)
                                        {nodeId = rootId;}
                                    else
                                        {nodeId = rootId.append(nodeId);}
                                    NodeProxy p = new NodeProxy(newDoc, nodeId, node.getNodeType());
                                    if (p != null) {
                                        // replace the node by the NodeProxy
                                        values[j] = p;
                                    }
                                }
View Full Code Here

     * Expand those references to get a pure in-memory DOM tree.
     */
    private void expand() {
        final Set<DocumentImpl> docs = new HashSet<DocumentImpl>();
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            if (node.getDocument().hasReferenceNodes())
                {docs.add(node.getDocument());}
        }
        for (final DocumentImpl doc : docs) {
            doc.expand();
        }
    }
View Full Code Here

    public Sequence getAttributes(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectAttributes(test, nodes);
        }
        return nodes;
    }
View Full Code Here

    public Sequence getDescendantAttributes(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectDescendantAttributes(test, nodes);
        }
        return nodes;
    }
View Full Code Here

    public Sequence getChildren(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectChildren(test, nodes);
        }
        return nodes;
    }
View Full Code Here

    public Sequence getChildrenForParent(NodeImpl parent) {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            if (node.getNodeId().isChildOf(parent.getNodeId()))
                {nodes.add(node);}
        }
        return nodes;
    }
View Full Code Here

    public Sequence getDescendants(boolean includeSelf, NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectDescendants(includeSelf, test, nodes);
        }
        return nodes;
    }
View Full Code Here

TOP

Related Classes of org.exist.memtree.NodeImpl

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.