commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [configuration] setDelimiterParsingDisabled doesn't work withd DefaultConfigurationBuilder
Date Fri, 28 Sep 2007 20:05:34 GMT
Sabine Schwanitz wrote:
> Hi,
> 
> when I'm trying to disableListDelimiter in DefaultConfigurationBuilder, 
> this is ignored.
> I just started working with apache.commons.configuration so maybe I did 
> something wrong?
> 
> So far I declared in my config.xml
> ..
> <properties filename="test.properties"/>
> <properties filename="test_en_US.properties" config-at="en_US"/>
> ..
> 
> So far localization works fine using config-at and prepending the local 
> prefix to the key.
> But I do also have messages with the default List Delimiter: ','
> I don't need any list delimiter in the application and would like to  
> avoid future conflicts by setting a different delimiter.
> 
> Here my code:
> 
> public static Configuration getConfigurationFor(String filename){
>  DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
>  builder.setDelimiterParsingDisabled(true);
>  builder.load("config.xml")
>  return builder.getConfiguration();
> }
> 
> I also tried already a few things like not to reload Configuration with 
> "builder.getConfiguration(false)" or to setting the flag directyl to 
> configuration.
> 
> How do i get this work without setting a different delimiter?
> 
> Thanks for help
> 
Sabine,

setting the delimiter parsing disabled flag on the 
DefaultConfigurationBuilder does not affect the loaded configurations, 
but only the builder itself. You can disable this mode for the sub 
configurations in the configuration definition file for each single 
configuration, e.g.:

<properties filename="test.properties" delimiterParsingDisabled="true"/>

HTH
Oliver

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


Mime
View raw message