[stringtemplate-interest] Invoke Java Method

Collin Fagan collin.fagan at gmail.com
Tue Jan 25 04:32:46 PST 2011


Hi  Remi,

I think you should look into writing a custom AttributeRenderer for the
String class. It will allow you a way to format your string before it gets
put into the template.

<entity.name; format="UpperCamelCase">

This link has a more detailed explanation:
http://www.antlr.org/wiki/display/ST/Object+rendering

Collin


On Tue, Jan 25, 2011 at 5:04 AM, Remi Marechal <remi.marechal at gmail.com>wrote:

> Hi,
>
> Can i invoke java method from a template ?
>
> For example i have a static method :
>
> bla.foo.bar.Util.toUpperCamelCase(String name)
>
> And i have <entity.name> on my template.
>
> I want to do something like that : toUpperCamelCase(<entity.name>)
>
> Thank you in advance.
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110125/a1d1c472/attachment.html 


More information about the stringtemplate-interest mailing list