List in speed macro, cannot find contains method

I put the list lines as validTypes in speed. When I do this:

 #if (${validTypes}.contains("aaa")) // do something #end 

he gives an error. But when I do this:

 #foreach (${validType} in ${validTypes}) ${validType} #end 

It works great. Do I need to use speed tools for this? How to use it in eclipse plugin? Is there any work without using speed tools?

+7
eclipse velocity
source share
2 answers

The problem here is in braces. Just use

 #if (${validTypes.contains("aaa")}) 

or

 #if ($validTypes.contains("aaa")) 

instead.

+17
source share

For those who relate to this, here's how to write, if not,

 #if (!$validTypes.contains("aaa")) 
0
source share

All Articles