commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Biestro (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JEXL-224) The ability to overload call() operator in customized JexlArithmetic implementation
Date Thu, 06 Jul 2017 09:48:00 GMT

     [ https://issues.apache.org/jira/browse/JEXL-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Henri Biestro updated JEXL-224:
-------------------------------
    Assignee: Henri Biestro

> The ability to overload call() operator in customized JexlArithmetic implementation
> -----------------------------------------------------------------------------------
>
>                 Key: JEXL-224
>                 URL: https://issues.apache.org/jira/browse/JEXL-224
>             Project: Commons JEXL
>          Issue Type: Improvement
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Minor
>             Fix For: 3.2
>
>
> As of now there is a possibility to overload some operators and property accessors in
JexlArithmetic, such as {{[]}}, {{.}} and {{~=}}, which is great extension point of Jexl.
Suppose I want to implement index-based access to a {{j.u.Collection}} instance in a manner
that {{a(0)}} would return the first element of collection, {{a(1)}} would return the second
and so forth. This is different from using common access operator {{[]}} in a way that I specify
not the index key of for example ArrayList, but an ordered index of the element. Of course,
the is a possibility to introduce some function to this, but for the sake of the scripting
simplicity I'm looking for the short version, like the call operator {{()}}. As of now I can
only implement this behavior for the classes that are written by me, via adding a call() method
to class declaration.But in the case of java.util.Collection this is not possible. So it would
be great if Jexl could allow to overload a call() method in JexlArithmetic class in a way
the propertyGet/arrayGet methods are now can be overloaded.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message