You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Dion Gillard <di...@gmail.com> on 2004/08/31 09:32:59 UTC

JEXL and ant like properties

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/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: JEXL and ant like properties

Posted by Brett Porter <br...@apache.org>.
While adding to an RC is usually bad form we've been guilty of a lot recently, I
think this is worthwhile.

To some extent, most people think this to be a bug in how it worked previously
rather than a missing feature.

Since all the tests pass, and the RC was so recent anyway, I say go for it.

- Brett

Quoting Dion Gillard <di...@gmail.com>:

> And it also handles the following:
> 
>         jc.getVars().put("x.a", Boolean.TRUE );
>         jc.getVars().put("x.b", Boolean.FALSE );
> 
>         assertExpression(jc, "x.a", Boolean.TRUE);
>         assertExpression(jc, "!x.a", Boolean.FALSE);
>         assertExpression(jc, "!x.b", Boolean.TRUE);
> 
> The question I meant to ask before was is this something people would
> like for the 1.0 release?
> 
> All the JEXL tests work with this new feature, and it could make
> Jelly's life a little easier as well.
> 
> On Tue, 31 Aug 2004 17:32:59 +1000, Dion Gillard <di...@gmail.com>
> wrote:
> > 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/
> > 
> 
> 
> -- 
> http://www.multitask.com.au/people/dion/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: JEXL and ant like properties

Posted by Dion Gillard <di...@gmail.com>.
And it also handles the following:

        jc.getVars().put("x.a", Boolean.TRUE );
        jc.getVars().put("x.b", Boolean.FALSE );

        assertExpression(jc, "x.a", Boolean.TRUE);
        assertExpression(jc, "!x.a", Boolean.FALSE);
        assertExpression(jc, "!x.b", Boolean.TRUE);

The question I meant to ask before was is this something people would
like for the 1.0 release?

All the JEXL tests work with this new feature, and it could make
Jelly's life a little easier as well.

On Tue, 31 Aug 2004 17:32:59 +1000, Dion Gillard <di...@gmail.com> wrote:
> 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/
> 


-- 
http://www.multitask.com.au/people/dion/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: JEXL and ant like properties

Posted by Dion Gillard <di...@gmail.com>.
And it also handles the following:

        jc.getVars().put("x.a", Boolean.TRUE );
        jc.getVars().put("x.b", Boolean.FALSE );

        assertExpression(jc, "x.a", Boolean.TRUE);
        assertExpression(jc, "!x.a", Boolean.FALSE);
        assertExpression(jc, "!x.b", Boolean.TRUE);

The question I meant to ask before was is this something people would
like for the 1.0 release?

All the JEXL tests work with this new feature, and it could make
Jelly's life a little easier as well.

On Tue, 31 Aug 2004 17:32:59 +1000, Dion Gillard <di...@gmail.com> wrote:
> 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/
> 


-- 
http://www.multitask.com.au/people/dion/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org