Alexander Hars created FREEMARKER-45:
----------------------------------------

             Summary: Support properties of classes that extend collections
                 Key: FREEMARKER-45
                 URL: https://issues.apache.org/jira/browse/FREEMARKER-45
             Project: Apache Freemarker
          Issue Type: Improvement
            Reporter: Alexander Hars


Currently Freemarker wraps classes that extend a collection using specialized 
adapters (for example if MyClass extends java.util.List then this class is 
wrapped using the DefaultListAdapter). This has the effect that all non-list 
properties of MyClass are inaccessible for use in the template. 

Assume that MyClass has a method getMyProperty and a MyClass instance is added 
to the data model using the hash ''myinstance', then the template
${myinstance.MyProperty} leads to the following error message: 

FreeMarker template error:
For "." left-hand operand: Expected a hash, but this has evaluated to a 
sequence (MyClass wrapped into f.t.DefaultListAdapter):

Freemarker needs to expose the non collection-related properties in the same 
way as it would on a simple object that does not extend a collection. Support 
for collections should not come at the expense of features that are already 
available for plain objects.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to