commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@apache.org>
Subject Re: [configuration] Property Substitution Policy
Date Tue, 23 Aug 2005 12:49:03 GMT
Hi Moran,

Moran Ben-David wrote:

> I was actually trying to get the substitution to only use the 1st value in a
> multi-valued property.  For example, a file like
> 
> 	V1 = value1
> 	V1 = value2
> 	Myprop = ${V1}
> 
> Would result in a configuration having
> 
> 	Myprop = value1
> 
> This way, when I do config.getString("Myprop") I'd get "value1" and not
> "[value1, value2]".

I tend to agree on this, the interpolated value should be a scalar, this 
would be consistent with the getString() method called on a multi-valued 
property.

However regarding your use case I agree with Oliver, using a 
CompositeConfiguration is the right solution. You can build it 
programatically, or use the ConfigurationFactory with a configuration 
descriptor.

Emmanuel Bourg

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


Mime
View raw message