velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Defining velocimacro in java class
Date Mon, 31 Jul 2006 15:24:19 GMT
Is there some particular reason you want to attach the macro to a
specific context?  If you are just wanting to define a "Velocimacro"
in a java class, than you can create a custom directive.  But those
must be associated with a VelocityEngine before initialization.

Your other option would be to "Use A Tool".   This could be a tool
that takes advantage of the VelocityTools support or just any old
POJO.  Have it take the parameters you want and generate the output
you want.  Then you just put it in your context and use it.

Other than these alternatives, no, i don't believe it is possible to
define a Velocimacro in a java class and attach it to a specific
context.

On 7/30/06, Maxim Gordienko <mgordienko@gmail.com> wrote:
> Hello!
>
> Is it possible to define Velocimacro in java class (implementing some
> interface, extending some base class etc.), somehow register it in
> context and use it just like macro defined inline or in macros
> library?
>
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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


Mime
View raw message