Package org.jaxen.javabean

Examples of org.jaxen.javabean.JavaBeanXPath


        return xpath;
    }
   
    protected JavaBeanXPath getJavaBeanXPath() throws JaxenException
    {
        JavaBeanXPath xpath = new JavaBeanXPath(pattern);
        setupNamespaces(xpath);
        return xpath;
    }
View Full Code Here


    public static final String NAME = "bean";

    protected XPath createXPath(String expression, Object object) throws JaxenException
    {
        expression = expression.replaceAll("[.]", "/");
        return new JavaBeanXPath(expression);
    }
View Full Code Here

    public static final String NAME = "bean";

    protected XPath createXPath(String expression, Object object) throws JaxenException
    {
        expression = expression.replaceAll("[.]", "/");
        return new JavaBeanXPath(expression);
    }
View Full Code Here

        return xpath;
    }

    protected JavaBeanXPath getJavaBeanXPath() throws JaxenException
    {
        JavaBeanXPath xpath = new JavaBeanXPath(pattern);
        setupNamespaces(xpath);
        return xpath;
    }
View Full Code Here

    public void testSomething() throws JaxenException {
       
        // The position() function does not really have any meaning
        // for JavaBeans, but we know three of them will come before the fourth,
        // even if we don't know which ones.
        JavaBeanXPath xpath = new JavaBeanXPath( "brother[position()<4]/name" );

        Person bob = new Person( "bob", 30 );

        bob.addBrother( new Person( "billy", 34 ) );
        bob.addBrother( new Person( "seth", 29 ) );
        bob.addBrother( new Person( "dave", 32 ) );
        bob.addBrother( new Person( "jim", 29 ) );
        bob.addBrother( new Person( "larry", 42 ) );
        bob.addBrother( new Person( "ted", 22 ) );

        List result = (List) xpath.evaluate( bob );
        assertEquals(3, result.size());
       
    }
View Full Code Here

TOP

Related Classes of org.jaxen.javabean.JavaBeanXPath

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.