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 Thu, 02 Aug 2012 05:14:02 GMT


George Scott commented on JEXL-140:

Some additional notes:

The "documentation" that I refer to is this page:
Maybe add a "static method calls" item under "Language Elements".

BTW, that page has two broken external links near the top (to JavaCC and Parser.jjt).

I would be happy to try creating a patch to implement a class() function, but would need some
pointers to get started.

An alternative (more intuitive for Java programmers) syntax for static methods might be allowing
a construct like:

return java.lang.System.getenv("test");
> Improvements for invoking static methods
> ----------------------------------------
>                 Key: JEXL-140
>                 URL:
>             Project: Commons JEXL
>          Issue Type: Improvement
>            Reporter: George Scott
>            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:
> class="".class;
> return class.forName("java.lang.System").getenv("test");
> 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:
> return class("java.lang.System").getenv("test");

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