List all macros defined in an ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

List all macros defined in an ftl

Albert Kam
This might sound strange, but i need a mechanism to list all macro names available in an ftl file.

I wonder whether this is possible to avoid having to list it manually somewhere and have duplication of maintenance for the list of macro names and the actual macros.

--
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

------------------------------------------------------------------------------

_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: List all macros defined in an ftl

Daniel Dekany
You could use Template.getMacros().keys() for that. Yeah, it's
deprecated, but that's because of the Map values it exposes, not the
keys, and because it doesn't block modifying that map... you just need
the keys. And it's still there in 2.4.


Sunday, August 23, 2015, 5:31:52 AM, Albert Kam wrote:

> This might sound strange, but i need a mechanism to list all macro names available in an ftl file.
>
> I wonder whether this is possible to avoid having to list it
> manually somewhere and have duplication of maintenance for the list
> of macro names and the actual macros.
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Loading...