Check variable type in FreeMarker

hsz picture hsz · Mar 7, 2012 · Viewed 16k times · Source

I have defined custom macro that contains one argument. It can be a String or List<String>.

Is it possible to check if it is an array or not ?

Answer

hsz picture hsz · Mar 7, 2012

Ok, I found out that there are available a few methods like is_....

Here is reference.

Valid one for my case is following test:

<#if value?is_enumerable></#if>