velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <antonio.petre...@gmail.com>
Subject Re: How to list Velocity template variables ?
Date Wed, 22 Dec 2010 18:55:24 GMT
2010/12/22 Jean-Baptiste BRIAUD -- Novlog <j-b.briaud@novlog.com>:
>
> On 22 déc. 2010, at 09:08, Antonio Petrelli wrote:
>> So, I think that you might create a tool, or a custom directive, to
>> say that you "require" a particular special object and put it in your
>> template context.
>
> Unfortunately, I can't do that because I can't force a user not to forget one #require.
> Also to validate the #require are all there, I'll need to get the list of all variables
:-)

This is not what I meant. The client will notice that he forgot one
#require when he runs the template, not at upload time.
Anyway, just to help, the starting point is RuntimeInstance.parse
method, that will return the root SimpleNode. All the nodes can be one
in AST* classes.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message