You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by um...@comcast.net on 2008/02/28 20:00:25 UTC
[Commons-Configuration]: Nested macro property replacement
I am using the latest commons configuration with JDK1.6.
Could I do the following property replacement using the
PropertyConfigufrator?
propA=value1
propB=value2
propA.value2.custom=111
prop.custom=${propA.${propB}.custom}
Thanks!
/U
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [Commons-Configuration]: Nested macro property replacement
Posted by Oliver Heger <ol...@oliver-heger.de>.
uma_rk@comcast.net schrieb:
> I am using the latest commons configuration with JDK1.6.
>
> Could I do the following property replacement using the
> PropertyConfigufrator?
>
> propA=value1
> propB=value2
> propA.value2.custom=111
> prop.custom=${propA.${propB}.custom}
>
> Thanks!
>
> /U
I think, this is not possible.
Internally configuration uses the StrSubstitutor class from commons lang
[1] for replacing variables. This class does not seem to support nested
variables.
Oliver
[1]
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrSubstitutor.java?view=markup
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org