commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Blinov (JIRA)" <>
Subject [jira] [Commented] (JEXL-177) Unified expressions to be used in String literals in Jexl scripts
Date Mon, 24 Aug 2015 09:22:45 GMT


Dmitri Blinov commented on JEXL-177:

Oh, thanks a lot, I have completely overlooked the possibility to use Classes instead of Objects
for functors, though as is comes out it was documented even in 2.0

        funcs.put("fn177", fn177.class);

Nevertheless one problem keeps me unsatisfied, a *multiline* string literal, in the moment
I'm using clumsy concatenations where string literals are intermixed with special *newline*
variable, (which keeps string "\r" since we have none to insert it directly to literal), and
the whole thing becomes a mess for relatively small XML fragment I'm trying to populate values
with. It kind of works but in other languages like groovy, perl etc there is a notion of *String
interpolation* syntax, and I believe its quite popular and in demand among users, so I thought
if we have already had such a wonderful implementation of unified expressions it would be
logical to have scripting and interpolation joined together in basic syntax.

Anyway, thanks for your effort.

> Unified expressions to be used in String literals in Jexl scripts
> -----------------------------------------------------------------
>                 Key: JEXL-177
>                 URL:
>             Project: Commons JEXL
>          Issue Type: New Feature
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
>            Priority: Minor
> Introduce new string literals to jexl script that allow unified expressions to be used,
string literals could use for example triple quoted (single or double) syntax for delimiters,
may include newlines and should not escape single quotes
> {code}
> user = "Bob"; server = "Test"; s = """Hello ${user}, welcome to ${server}"""; return
> {code}

This message was sent by Atlassian JIRA

View raw message