velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Lisken <lis...@Mathematik.Uni-Bielefeld.DE>
Subject Re: request: new event handler to "hook" expression insertion
Date Thu, 05 Aug 2004 16:32:07 GMT
I wrote:
> interface ExpressionInsertionEventHandler {
>   String expressionInsert(expression, result);
> }

I suppose it makes little sense to pass in the original expression
after it's been evaluate. Does one want to re-evaluate it? Maybe
there should be two events, before and after expression evaluation.
The "before" handler would get the original expression and could
stop Velocity from evaluating further. One way of doing this would
be to expose Velocity's own expression handling mechanism through
some method. It would be the event handler's responsibility to call
that, with the original expression or some modified version of it.
Post-processing would be another useful option (the one I'd use in
my example), but without inspecting the original expression perhaps.
That would give us something like

interface PostExpressionEvaluationHandler {
   public String expressionInsert(String velocityResult);

interface PreExpressionEvaluationHandler {
   public Object expressionInsert(String vltExpression);

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message