I’m using Freemarker to generate an XHTML page from a POJO which contains a List of Objects, all of which are instances of subclasses of the same parent class. I’d like to generate different information for each object based on its class. How do you test for that in the Freemarker language? For example, if I had a List, how would I determine if a particular Shape was a Rectangle or a Circle?
Share
Though I suggest you consider using a method from each class to generate the unique behavior for each subclass. Polymorphism is a wonderful thing. 🙂