You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2016/03/24 21:13:26 UTC

[jira] [Updated] (CONFIGURATION-395) groovy for interpolation and expression engine

     [ https://issues.apache.org/jira/browse/CONFIGURATION-395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger updated CONFIGURATION-395:
---------------------------------------
    Fix Version/s:     (was: 2.0)
                   2.x

> groovy for interpolation and expression engine
> ----------------------------------------------
>
>                 Key: CONFIGURATION-395
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-395
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Expression engine, Interpolation
>            Reporter: ron
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: AbstractConfiguration.patch, ConfigurationBinding.java, GInterpolator.java, Interpolator.java
>
>
> Currently the expression engine can be set but not the interpolation.
> This patch proposes the ability to set a user specified interpolation engine.
> It includes a groovy interpolation engine. Groovy comes naturally as an expressions and interpolation language in the java environment
> API usage:
> 		AbstractConfiguration c = new PropertiesConfiguration("conf/test.conf");
> 		c.setInterpolator(new GInterpolator(c));
> 		System.out.println(c.getString("test"));
> Configuration examples:
> library.path.1=${ if  ("${System.getProperty{('os.name')}".toLowerCase().startsWith("windows")) "libw.dll"; else "libl" }
> password=${println 'enter password'; readln}
> I think that this is more feature rich than JEXL and is easier to use for java programmers.
> - Ron



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)