commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: [Configuration] Property interpolation & subsets
Date Thu, 02 Dec 2004 14:51:58 GMT
Emmanuel Bourg wrote on Thursday, December 02, 2004 2:38 PM:

> Hello Jörg, good point I didn't think about this issue I'll
> investigate it. Translating the key in the interpolation method might
> be another solution, I'm not sure how to do this though.

Then you would have to parse the value also like the interpolateHelper for the keys and you
would still have to try both variants. So I would change from:

 SubsetConfiguration config = new SubsetConfiguration(parent, "");
 return config.interpolate(base);

to:

 SubsetConfiguration config = new SubsetConfiguration(parent, "");
 String value = config.interpolate(base);
 return value.indexOf(START_TOKEN)>0 ? parent.interpolate(value) : value;

==> try the parent if there is still a variable left in the sting after the interpolation.
With this solution the variables from the subset have precedence and the fallback is available.

[snip]

- Jörg

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


Mime
View raw message