[
https://issues.apache.org/jira/browse/JEXL-21?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rahul Akolkar resolved JEXL-21.
-------------------------------
Resolution: Fixed
This is a conceptual solution in the rearchitected 2.0 branch in SVN. Please
try it out (by building the branch) and if further work is needed, reopen this
issue (with a complete JUnit test that fails, if possible).
> operator overloading / hooks on operator processing
> ---------------------------------------------------
>
> Key: JEXL-21
> URL: https://issues.apache.org/jira/browse/JEXL-21
> 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.