[
https://issues.apache.org/jira/browse/JEXL-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427117#comment-13427117
]
George Scott edited comment on JEXL-140 at 8/2/12 5:17 AM:
-----------------------------------------------------------
Some additional notes:
The "documentation" that I refer to is this page:
http://commons.apache.org/jexl/reference/syntax.html
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:
{noformat}
return java.lang.System.getenv("test");
{noformat}
was (Author: george scott):
Some additional notes:
The "documentation" that I refer to is this page:
http://commons.apache.org/jexl/reference/syntax.html
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: https://issues.apache.org/jira/browse/JEXL-140
> 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:
> {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:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira