JEXL and ant like properties

Dion Gillard <[email protected]>
Newsgroups gmane.comp.jakarta.commons.user,gmane.text.xml.commons.devel
Message-ID <[email protected]>
I know this is an issue for Maven and Jelly, specifically 
http://issues.apache.org/jira/browse/JELLY-87

I've got a solution that allows JEXL to handle the following:

        JexlContext jc = JexlHelper.createContext();
        String value = "Stinky Cheese";
        jc.getVars().put("maven.bob.food", value);
        // ant property maven.bob.food executing the length method
        assertExpression(jc, "maven.bob.food.length()", new
Integer(value.length()));
        // using empty on maven.bob.food
        assertExpression(jc, "empty(maven.bob.food)", Boolean.FALSE);

        assertExpression(jc, "size(maven.bob.food)", new
Integer(value.length()));
        assertExpression(jc, "maven.bob.food + ' is good'", value + " is good");


-- 
http://www.multitask.com.au/people/dion/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.