commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: [text] Adapt the Log4j 2 Interpolator to [text]
Date Thu, 14 Dec 2017 15:41:20 GMT
Yes, the Interpolator was borrowed from Commons Configuration.

Ralph

> On Dec 14, 2017, at 5:20 AM, Jörg Schaible <joerg.schaible@bpm-inspire.com> wrote:
> 
> Hi Gary,
> 
> Am Wed, 13 Dec 2017 15:17:56 -0700 schrieb Gary Gregory:
> 
>> Hi All,
>> 
>> Log4j 2 provides it's own copy of our StrSubstitutor/StrLookup framework
>> enhanced for Log4j's needs. In addition it provides a custom StrLookup
>> called Interpolator which allows for lookups like:
>> 
>> ${sys:java.version} and ${env:MY_VAR} to look up system properties and
>> environment variables respectively as well as other sub maps.
> 
> You will find this also in commons-configurations.
> 
>> I would like to borrow this concept of a composite and keyed StrLookup
>> and make it a first class citizen in [text].
>> 
>> This would look like this:
>> 
>> Interpolator interpolator = new o.a.c.t.Interpolator();
>> interpolator.put("gary", StrLookup.mapLookup(new HashMap()));
>> interpolator.put("alice", StrLookup.mapLookup(new HashMap()));
>> StrSubstitutor strSubstitutor = new StrSubstitutor(interpolator);
>> 
>> Thoughts?
> 
> Cheers,
> Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message