Examples of NodePointer


Examples of org.apache.commons.jxpath.ri.model.NodePointer

    /**
     * Returns an XPath that maps to this Pointer.
     */
    public String asPath() {
        StringBuffer buffer = new StringBuffer();
        NodePointer parent = getParent();
        if (parent != null) {
            buffer.append(parent.asPath());
            if (index != WHOLE_COLLECTION) {
                // Address the list[1][2] case
                if (parent.getIndex() != WHOLE_COLLECTION) {
                    buffer.append("/.");
                }
                buffer.append("[").append(index + 1).append(']');
            }
        }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

    }

    public NodePointer createChild(JXPathContext context,
                QName name, int index, Object value)
    {
        NodePointer ptr = createChild(context, name, index);
        ptr.setValue(value);
        return ptr;
    }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

        return 0;
    }
   
    public String asPath() {
        StringBuffer buffer = new StringBuffer();
        NodePointer parent = getParent();
        if (parent != null) {
            buffer.append(parent.asPath());
        }
        if (index != WHOLE_COLLECTION) {
            // Address the list[1][2] case
            if (parent != null && parent.getIndex() != WHOLE_COLLECTION) {
                buffer.append("/.");
            }
            else if (
                parent != null
                    && parent.getParent() != null
                    && parent.getParent().getIndex() != WHOLE_COLLECTION) {
                buffer.append("/.");
            }
            buffer.append("[").append(index + 1).append(']');
        }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

    }

    public NodePointer createChild(
            JXPathContext context, QName name, int index, Object value)
    {
        NodePointer ptr = createChild(context, name, index);
        ptr.setValue(value);
        return ptr;
    }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

                }
                reset();
            }
        }
        try {
            NodePointer clone = (NodePointer) propertyNodePointer.clone();
            return clone.getValuePointer();
        }
        catch (Throwable ex) {
            // @todo: should this exception be reported in any way?
            NullPropertyPointer npp =
                new NullPropertyPointer(propertyNodePointer.getParent());
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

    public boolean setPosition(int position) {
        throw new UnsupportedOperationException();
    }

    public EvalContext getConstantContext(Object constant) {
        NodePointer pointer;
        if (constant instanceof NodePointer) {
            pointer = (NodePointer) constant;
        }
        else {
            pointer =
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

        // Each set contains exactly one node: the parent
        if (setStarted) {
            return false;
        }
        setStarted = true;
        NodePointer thisLocation = parentContext.getCurrentNodePointer();
        currentNodePointer = thisLocation.getParent();
        while (currentNodePointer != null
            && currentNodePointer.isContainer()) {
            currentNodePointer = currentNodePointer.getParent();
        }
        if (currentNodePointer != null
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

                prepare();
                if (iterator == null) {
                    return null;
                }
                // See if there is a property there, singular or collection
                NodePointer pointer = iterator.getNodePointer();
                if (pointer != null) {
                    return pointer;
                }
            }
            return null;
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

    /**
     * Allocates a PropertyIterator.
     */
    private void prepare() {
        NodePointer parent = parentContext.getCurrentNodePointer();
        if (parent == null) {
            return;
        }
        if (startFromParentLocation) {
            NodePointer pointer = parent.getParent();
            while (pointer != null && pointer.isContainer()) {
                pointer = pointer.getParent();
            }

            iterator = pointer.childIterator(nodeTest, reverse, parent);
        }
        else {
            iterator = parent.childIterator(nodeTest, reverse, null);
        }
    }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.model.NodePointer

    private boolean setupDynamicPropertyPointer() {
        if (nameTestExpression == null) {
            return false;
        }

        NodePointer parent = parentContext.getCurrentNodePointer();
        if (parent == null) {
            return false;
        }
        parent = parent.getValuePointer();
        if (!(parent instanceof PropertyOwnerPointer)) {
            return false;
        }
        dynamicPropertyPointer =
            ((PropertyOwnerPointer) parent).getPropertyPointer();
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.