Package org.apache.commons.jxpath.ri.compiler

Examples of org.apache.commons.jxpath.ri.compiler.NodeNameTest


                node,
                name.toString(),
                index);
        if (success) {
            NodeIterator it =
                childIterator(new NodeNameTest(name), false, null);
            if (it != null && it.setPosition(index + 1)) {
                return it.getNodePointer();
            }
        }
        throw new JXPathException(
View Full Code Here


                node,
                name.toString(),
                index);
        if (success) {
            NodeIterator it =
                childIterator(new NodeNameTest(name), false, null);
            if (it != null && it.setPosition(index + 1)) {
                return it.getNodePointer();
            }
        }
        throw new JXPathException(
View Full Code Here

                relativeProperty(start, relativePropertyIndex));
            start.setIndex(offset);
        }
        it =
            root.childIterator(
                new NodeNameTest(new QName(null, "integers")),
                reverse,
                start);

        int size = 0;
        while (it.setPosition(it.getPosition() + 1)) {
View Full Code Here

            if ( StringUtils.isEmpty( nodeName ) )
            {
                return false;
            }

            NodeNameTest nodeNameTest = (NodeNameTest) test;
            String namespaceURI = nodeNameTest.getNamespaceURI();
            boolean wildcard = nodeNameTest.isWildcard();
            String testName = nodeNameTest.getNodeName().getName();
            String testPrefix = nodeNameTest.getNodeName().getPrefix();
            if ( wildcard && testPrefix == null )
            {
                return true;
            }
            if ( wildcard || testName.equals( nodeName ) )
View Full Code Here

    /**
     * Tests using a node test with a wildcard name.
     */
    public void testIterateWithWildcardTest()
    {
        NodeNameTest test = new NodeNameTest(new QName(null, "*"));
        ConfigurationNodeIteratorChildren it = new ConfigurationNodeIteratorChildren(
                rootPointer, test, false, null);
        assertEquals("Wrong number of elements", CHILD_COUNT, iteratorSize(it));
    }
View Full Code Here

     * Tests using a node test that defines a namespace prefix. Because
     * namespaces are not supported, no elements should be in the iteration.
     */
    public void testIterateWithPrefixTest()
    {
        NodeNameTest test = new NodeNameTest(new QName("prefix", "*"));
        ConfigurationNodeIteratorChildren it = new ConfigurationNodeIteratorChildren(
                rootPointer, test, false, null);
        assertNull("Undefined node pointer not returned", it.getNodePointer());
        assertEquals("Prefix was not evaluated", 0, iteratorSize(it));
    }
View Full Code Here

    /**
     * Tests using a node test that selects a certain sub node name.
     */
    public void testIterateWithNameTest()
    {
        NodeNameTest test = new NodeNameTest(new QName(null, CHILD_NAME2));
        ConfigurationNodeIteratorChildren it = new ConfigurationNodeIteratorChildren(
                rootPointer, test, false, null);
        assertTrue("No children found", iteratorSize(it) > 0);
        for (Iterator elemIt = iterationElements(it).iterator(); elemIt
                .hasNext();)
View Full Code Here

        }
        else
        {
            if (test instanceof NodeNameTest)
            {
                NodeNameTest nameTest = (NodeNameTest) test;
                QName name = nameTest.getNodeName();
                return nameTest.isWildcard() ? createSubNodeListForWildcardName(
                        node, name) : createSubNodeListForName(node, name);
            }

            else if (test instanceof NodeTypeTest)
            {
View Full Code Here

     * Tests using a node test with a wildcard name.
     */
    @Test
    public void testIterateWithWildcardTest()
    {
        NodeNameTest test = new NodeNameTest(new QName(null, "*"));
        ConfigurationNodeIteratorChildren<ImmutableNode> it =
                new ConfigurationNodeIteratorChildren<ImmutableNode>(
                        rootPointer, test, false, null);
        assertEquals("Wrong number of elements", CHILD_COUNT, iteratorSize(it));
    }
View Full Code Here

     * namespaces are not supported, no elements should be in the iteration.
     */
    @Test
    public void testIterateWithPrefixTest()
    {
        NodeNameTest test = new NodeNameTest(new QName("prefix", "*"));
        ConfigurationNodeIteratorChildren<ImmutableNode> it =
                new ConfigurationNodeIteratorChildren<ImmutableNode>(
                        rootPointer, test, false, null);
        assertNull("Undefined node pointer not returned", it.getNodePointer());
        assertEquals("Prefix was not evaluated", 0, iteratorSize(it));
View Full Code Here

TOP

Related Classes of org.apache.commons.jxpath.ri.compiler.NodeNameTest

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.