DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5321>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5321 Velocity should provide an interface for explicit property retreival Summary: Velocity should provide an interface for explicit property retreival Product: Velocity Version: 1.1-rc2 Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Anakia AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] 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. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
