Extensions to allow introspection of Freemarker template
"Wong, Christopher" <[email protected]> Tue, 27 May 2014 09:58:05 -0400
| Newsgroups | gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <5900C695468EF8469DF7867FD277BA1E959B4A37DF@PMACPWEXCLS01.corp.epsilon.com> |
I work with user-submitted templates, and would like Freemarker support some form of introspection of a template. For example, I might want to know what identifiers the template will request from the model. Freemarker already has something very close to this: the public method Template.getRootTreeNode exposes a DOM-like structure the end user. Unfortunately, the TemplateElement classes that comes back are mostly not visible to the public. Since I'd rather not fork an internal copy of Freemarker, I'd like to explore the possibility of contributing changes to the Freemarker project to enable template introspection. I want to see if there's an approach that the maintainers will find acceptable. 1) The easiest way to accomplish this is to make the TemplateElement hierarchy public and add public getters to these classes. On the other hand, this might expose more than you'd like. 2) You have implemented similar functionality by having this class implement the TreeNode interface to expose this tree as a Swing component. Perhaps a separate interface hierarchy will provide acceptable decoupling? ________________________________ This e-mail and files transmitted with it are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you are not one of the named recipient(s) or otherwise have reason to believe that you received this message in error, please immediately notify sender by e-mail, and destroy the original message. Thank You. ------------------------------------------------------------------------------ The best possible search technologies are now affordable for all companies. Download your FREE open source Enterprise Search Engine today! Our experts will assist you in its installation for $59/mo, no commitment. Test it for FREE on our Cloud platform anytime! http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk _______________________________________________ FreeMarker-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freemarker-devel