[ 
https://issues.apache.org/jira/browse/VELOCITY-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henning Schmiedehausen closed VELOCITY-31.
------------------------------------------


> Velocity should provide an interface for explicit property retreival
> --------------------------------------------------------------------
>
>                 Key: VELOCITY-31
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-31
>             Project: Velocity
>          Issue Type: Bug
>          Components: Anakia
>    Affects Versions: 1.1-rc2
>         Environment: Operating System: All
> Platform: All
>            Reporter: lev epshteyn
>         Assigned To: Velocity-Dev List
>
> I think that there should be an interface with a method of something like
> Object 
> getVelocityProperty(String key);
> that will provide for a way to manually determine what 
> object to retrieve with a given property name. Currently, there is no good 
> way to access hashtable-
> like structures without resorting to what essentially amounts to putting java 
> code into the 
> template. (i.e. "$hash.get($key)")...
> Velocity should allow developers to implement an 
> interface to get more control of velocity engine rendering, so that when the 
> template calls for 
> $obj.property, a check is made to see if an object is an instance of that 
> interface. If not, the 
> standard algorithm should be used to determine if this object has a 
> getProperty() method. But if 
> the object does implement the interface, Velocity would call 
> getVelocityProperty("property") on it, and it would be up to the programmer 
> to provide proper 
> logic to return the property. (in a Hashtable wrapper, the method would 
> contain one line: 
> return hash.get(key);
> This will not only give the programmer more control and force 
> them to pur less Java code into the template, but would also enable the 
> developer to optimize the 
> most frequently accessed types of objects for performance as it will reduce 
> the need to perform 
> reflection lookups.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to