commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter royal <pro...@apache.org>
Subject Re: [JEXL] Ternary expressions?
Date Fri, 05 Nov 2004 03:33:04 GMT
On Nov 3, 2004, at 12:46 PM, Digby wrote:
> Was just wondering if there's any chance JEXL will support ternary 
> expressions at some point? It would be nice to have some sort of 
> conditional support. (I notice this has been discussed on the dev 
> group.)

since i needed this and didn't feel like hacking jexl, i throw an item 
named Helper in my context which is an instance of a class with a 
method like:

public Object if( boolean state, Object o1, Object o2 )
{
	return state ? o1 : o2;
}

then its just ${Helper.if( a > b, a, b )}

-pete


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


Mime
View raw message