commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narendran Chakkaravarthy <nare...@gmail.com>
Subject [Jexl] Return statement
Date Thu, 16 Feb 2012 01:22:30 GMT
Hello Jexl Users,

Is 'return' statement supported? The
documentation<http://commons.apache.org/jexl/reference/syntax.html#Functions>claims
to, but I get the error - "Ambiguous statement... missing ; ".
Without 'return' or 'break' it seems difficult to write even a simple
routine. Curious about how others are managing this.
Here is the use case:

Return true if my name is one of the element in the list

for(x : items) {
 if(x.equals(myname)) {
   return true;
 }
}
return false;

items and mynames are variables in the context.

Thanks for any pointers.

-- 
~Naren

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message