Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.Pointer.asPath()


    {
        Pointer pointer = context.getPointer(path);
        assertNotNull("Null path exists: " + path,
                    pointer);
        assertEquals("Null path as path: " + path,
                    expectedPath, pointer.asPath());
        assertEquals("Checking Signature: " + path,
                    expectedSignature, pointerSignature(pointer));
               
        Pointer vPointer = ((NodePointer) pointer).getValuePointer();
        assertTrue("Null path is null: " + path,
View Full Code Here


        Iterator it = context.iteratePointers("foo");
        List actual = new ArrayList();
        while (it.hasNext()) {
            Pointer ptr = (Pointer) it.next();
            actual.add(context.getValue(ptr.asPath()));
        }
        assertEquals(
            "Iterating pointers <" + "foo" + ">",
            list("a", "b", "c"),
            actual);
View Full Code Here

        context.getVariables().declareVariable("x", new Integer(2));
        Iterator it = context.iteratePointers("foo[$x]");
        List actual = new ArrayList();
        while (it.hasNext()) {
            Pointer ptr = (Pointer) it.next();
            actual.add(context.getValue(ptr.asPath()));
        }
        assertEquals("Iterating pointers <" + "foo" + ">", list("b"), actual);
    }

    public void testIterateVector() {
View Full Code Here

            assertEquals("pointer.getValue", s, pointer.getValue());
            // fails right here, the value isn't getting set in the bean.
            assertEquals(
                "context.getValue",
                s,
                context.getValue(pointer.asPath()));
        }
        assertEquals("Iteration count", 2, iterCount);

        assertXPathValue(context, "/beans[1]/name", "Name 1suffix");
        assertXPathValue(context, "/beans[2]/name", "Name 2suffix");
View Full Code Here

        Pointer ptr = getContextNodePointer();
        if (ptr == null) {
            return "Empty expression context";
        }
        else {
            return "Expression context [" + getPosition() + "] " + ptr.asPath();
        }
    }

    /**
     * Returns the root context of the path, which provides easy
View Full Code Here

            Pointer ptr = (Pointer) pointerIter.next();

            // prepare result Rule
            Rule nextFailedRule = new Rule();

            nextFailedRule.setContext(ptr.asPath());

            // switch to the context of the rule
            JXPathContext localJxpContext = JXPathContext.newContext(jxpContext,
                                                ptr.getValue());
View Full Code Here

        List nodeset = new LinkedList();
        Iterator iter = jxcontext_.iteratePointers(xpathSelector);

        while (iter.hasNext()) {
            Pointer nextPointer = (Pointer) iter.next();
            String path = nextPointer.asPath();

            nodeset.add(path);
        }
        return nodeset;
    }
View Full Code Here

        List nodeset = new LinkedList();
        Iterator iter = jxcontext_.iteratePointers(xpathSelector);

        while (iter.hasNext()) {
            Pointer nextPointer = (Pointer) iter.next();
            String path = nextPointer.asPath();

            nodeset.add(path);
        }
        return nodeset;
    }
View Full Code Here

            Pointer ptr = (Pointer) pointerIter.next();

            // prepare result Rule
            Rule nextFailedRule = new Rule();

            nextFailedRule.setContext(ptr.asPath());

            // switch to the context of the rule
            JXPathContext localJxpContext = JXPathContext.newContext(jxpContext,
                                                ptr.getValue());
View Full Code Here

                        jxpathContextFactory.newContext(null, value);
                    String path = "";
                    if (contextPath != null) {
                        path = contextPath + "/.";
                    }
                    path += ptr.asPath();
                    execute(consumer,
                            form,
                            currentView,
                            path,
                            localJXPathContext,
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.