You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Tim Diggins <su...@red56.co.uk> on 2005/06/08 23:38:47 UTC
A way to (easily) access Velocity parser and get a list of variables/properties/methods
Hi -
I was wondering if there was an easy way of asking velocity to parse a
template and (rather than merge it with a context) extract from its
parse-tree a list of all the variables/properties/methods (as, say,
strings)... I imagine I could do this with a regexp, but would rather
not, if velocity can do this already.
FYI, the context for this, is that I thought it might be helpful to have
some automatically produced information about what calls a particular
template is making.
Thanks
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: A way to (easily) access Velocity parser and get a list of variables/properties/methods
Posted by Tim Diggins <su...@red56.co.uk>.
>>I was wondering if there was an easy way of asking velocity to parse a
>>template and (rather than merge it with a context) extract from its
>>parse-tree a list of all the variables/properties/methods (as, say,
>>strings)... I imagine I could do this with a regexp, but would rather
>>not, if velocity can do this already.
>
>
> Take a look at the TemplateTool.
> http://svn.apache.org/repos/asf/jakarta/velocity/trunk/contrib/temporary/templatetool/
Thanks Shinobu (and Geir) -
I will use this as a starting point. If I come up with anything that
might be mildly useful to others, I'll feed back to the list.
-- Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: A way to (easily) access Velocity parser and get a list of variables/properties/methods
Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Tim,
> I was wondering if there was an easy way of asking velocity to parse a
> template and (rather than merge it with a context) extract from its
> parse-tree a list of all the variables/properties/methods (as, say,
> strings)... I imagine I could do this with a regexp, but would rather
> not, if velocity can do this already.
Take a look at the TemplateTool.
http://svn.apache.org/repos/asf/jakarta/velocity/trunk/contrib/temporary/templatetool/
Best regards,
-- Shinobu
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org