Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathContext.iteratePointers()


        int initialSize = repeater.getSize();

        // build a jxpath iterator for pointers
        JXPathContext repeaterContext =
            jxpc.getRelativeContext(jxpc.getPointer(this.repeaterPath));
        Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
        //iterate through it
        while (rowPointers.hasNext()) {
            // create a new row, take that as the frmModelSubContext
            Repeater.RepeaterRow thisRow;
            if (initialSize > 0) {
View Full Code Here


            // Get the key values
            List rowIdValues = getUniqueRowValues(thisRow);

            if (isAnyListElementNotNull(rowIdValues)) {
                // iterate nodes to find match
                Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
                boolean found = false;
                while (rowPointers.hasNext()) {
                    Pointer jxp = (Pointer) rowPointers.next();
                    JXPathContext rowContext = repeaterContext.getRelativeContext(jxp);
                    List matchIds = getMatchIds(rowContext);
View Full Code Here

            // Move to the list location
            ctx = JXPathContext.newContext(flowData);

            // Iterate on all elements of the list
            iter = ctx.iteratePointers(this.listPath);
        } else {
            // Move to the list location
            ctx = JXPathContext.newContext(model);

            // Iterate on all elements of the list
View Full Code Here

        } else {
            // Move to the list location
            ctx = JXPathContext.newContext(model);

            // Iterate on all elements of the list
            iter = ctx.iteratePointers(".");
        }

        // Start the selection-list
        contentHandler.startElement(Constants.WI_NS, SELECTION_LIST_EL, Constants.WI_PREFIX_COLON + SELECTION_LIST_EL, Constants.EMPTY_ATTRS);
View Full Code Here

        if (ptr.getNode() != null) {
            // There are some nodes to load from

            JXPathContext repeaterContext = jctx.getRelativeContext(ptr);
            // build a jxpath iterator for pointers
            Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);

            //iterate through it
            int rowNum = 0;
            while (rowPointers.hasNext()) {
                // Get a row. It is created if needed (depends on clearOnLoad)
View Full Code Here

        assertEquals("Explicit Request Scope", "request", context.getValue("$request/request"));
        assertEquals("Explicit Session Scope", "session", context.getValue("$session/session"));
        assertEquals("Explicit Application Scope", "app", context.getValue("$application/app"));

        // iterate through the elements of page context only (two elements expected, 'page' and the context)
        Iterator it = context.iteratePointers("$page/*");
        assertTrue("element not found", it.hasNext());
        it.next();
        it.next();
        assertFalse("too many elements", it.hasNext());

View Full Code Here

        return -1;
    }

    public void testIteratePropertyArrayWithHasNext() {
        JXPathContext context = JXPathContext.newContext(createContextBean());
        Iterator it = context.iteratePointers("/integers");
        List actual = new ArrayList();
        while (it.hasNext()) {
            actual.add(((Pointer) it.next()).asPath());
        }
        assertEquals(
View Full Code Here

            actual);
    }

    public void testIteratePropertyArrayWithoutHasNext() {
        JXPathContext context = JXPathContext.newContext(createContextBean());
        Iterator it = context.iteratePointers("/integers");
        List actual = new ArrayList();
        for (int i = 0; i < 4; i++) {
            actual.add(it.next().toString());
        }
        assertEquals(
View Full Code Here

    }

    public void testIterateAndSet() {
        JXPathContext context = JXPathContext.newContext(createContextBean());

        Iterator it = context.iteratePointers("beans/int");
        int i = 5;
        while (it.hasNext()) {
            NodePointer pointer = (NodePointer) it.next();
            pointer.setValue(new Integer(i++));
        }
View Full Code Here

        while (it.hasNext()) {
            NodePointer pointer = (NodePointer) it.next();
            pointer.setValue(new Integer(i++));
        }

        it = context.iteratePointers("beans/int");
        List actual = new ArrayList();
        while (it.hasNext()) {
            actual.add(((Pointer) it.next()).getValue());
        }
        assertEquals(
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.