[
https://issues.apache.org/jira/browse/JEXL-177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14709006#comment-14709006
]
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
{code}
funcs.put("fn177", fn177.class);
{code}
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: https://issues.apache.org/jira/browse/JEXL-177
> 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 s;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)