commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Scott (JIRA)" <>
Subject [jira] [Commented] (JEXL-140) Improvements for invoking static methods
Date Fri, 03 Aug 2012 02:52:02 GMT


George Scott commented on JEXL-140:

I understand wanting to keep Jexl lean, and the need to be able to sandbox for those that
require it.  Both noble goals.

Your sample works perfectly - just what I was looking for.  It also works for accessing static
fields (like java.lang.Integer.MIN_VALUE).
> Improvements for invoking static methods
> ----------------------------------------
>                 Key: JEXL-140
>                 URL:
>             Project: Commons JEXL
>          Issue Type: Improvement
>            Reporter: George Scott
>            Assignee: Henri Biestro
>            Priority: Minor
> Two related suggestions:
> 1. The documentation does not really describe how to call a static method from a JEXL
script.  I believe that it is done this way:
> {noformat}
> class="".class;
> return class.forName("java.lang.System").getenv("test");
> {noformat}
> 2. Implementing a class() function that parallels the existing new() function would make
calling static methods easier, helping to clean up scripts.  The above example would become:
> {noformat}
> return class("java.lang.System").getenv("test");
> {noformat}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message