Try doing a .class?
#foreach($item in $arrayList)
#set($classType = $item.class)
#if ($classType == "com.domain.classname")
do something
#else
don't do it!
#end
#end
(this code isn't tested... just in my head!)
rjain wrote:
> I have a ArrayList which can contain either items of TypeA or TypeB
>
> #foreach($item in $arrayList)
> #if ($item <isoftype> TypeA)
> Do something
> #else ($item <isoftype> TypeB)
> Do something else
> #end
> #end
>
> How do I get the Type of Item in the Arraylist?
>
> Thanks!!
>
--
*Paul Loy
Software Developer*
Peoples Archive Ltd.
Middlesex House
34-42 Cleveland Street
London, W1T 4LB
Tel: +44 (0) 20 7323 0323
Fax: +44 (0) 20 7580 1938
paul.loy@peop...
opensubscriber is not affiliated with the authors of this message nor responsible for its content.