commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dion gillard (JIRA)" <>
Subject [jira] Updated: (JEXL-21) operator overloading / hooks on operator processing
Date Fri, 26 Oct 2007 08:51:50 GMT


dion gillard updated JEXL-21:

    Fix Version/s: 2.0

> operator overloading / hooks on operator processing
> ---------------------------------------------------
>                 Key: JEXL-21
>                 URL:
>             Project: Commons JEXL
>          Issue Type: New Feature
>            Reporter: AC
>             Fix For: 2.0
> I'd like to use JEXL for a website framework. In order to make the scripting code easy
readable it would be nice to let the users add hooks in the expression processing.
> such a hook would allow me to add Date operators for example: Date  and Durations addition/substraction.
> that would've been very easy for me to implement if I had access to the processing done
in let's say ASTAddNode class. 
> An easy way to do it is to add a method in the parser like
> registerHook(Class astNodeClass, SimpleNode hook)
> in ExpressionImpl.evaluate we call node.implValue instead of value. This method can check
if  hooks where registered for the class and call for each hook.value before calling the value
of the node itself. 
> For perfomance reasons the list of these hooks can be stored by the each SimpleNode in
the constructor SimpleNode(Parser p, int i) 
> that's it, thanks

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message