[stringtemplate-interest] Finding Attribute Names

Omer Anson oaanson at gmail.com
Mon Dec 13 03:51:23 PST 2010


Hello,

I am writing a tool in Java, in which the user submits a template to
be filled in later. Since I do not trust said user, I cannot trust him
to provide me with all the attributes that appear in the template.

My question is this:
Is it possible, using StringTemplate and Java, to retrieve all the
attribute names in the template?

For instance, if I have the template:
$if (greeting)$ $greeting$ $target$
$else$ No greeting :(
$endif$

Is there a method that will return {greeting, target}? Is there a
workaround to do this without reviewing the ASTExpr objects?

Thank you
Omer Anson.


More information about the stringtemplate-interest mailing list