commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hao Chen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONFIGURATION-734) Inconsistent/strange configuration keys for attributes
Date Mon, 07 Jan 2019 07:41:00 GMT
Hao Chen created CONFIGURATION-734:
--------------------------------------

             Summary: Inconsistent/strange configuration keys for attributes
                 Key: CONFIGURATION-734
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-734
             Project: Commons Configuration
          Issue Type: Bug
            Reporter: Hao Chen


Given the following configuration-1.xml:

<configuration>
    <node type="test" types="a,b,c"/>
</configuration>

If you get the configuration using something like:

            Parameters params = new Parameters();
            ReloadingFileBasedConfigurationBuilder<XMLConfiguration> builder
= new ReloadingFileBasedConfigurationBuilder<XMLConfiguration>(XMLConfiguration.class);
            builder.configure(params.xml().setFile("configuration-1.xml ").setListDelimiterHandler(new
DefaultListDelimiterHandler(',')));
            XMLConfiguration configuration = builder.getConfiguration();

Then you print the keys using configuration.getKeys(), you will get something like: node[@type],
node[@types]

However, if you use a combined configuration.xml like:

<configuration>
  <override>
    <xml fileName="configuration-1.xml" reloadingRefreshDelay="10000" config-name="config3"
config-optional="false" throwExceptionOnMissing="false"/>
  </override>
</configuration>

And you get the configuration using:

            Parameters params = new Parameters();
            ReloadingCombinedConfigurationBuilder builder = new ReloadingCombinedConfigurationBuilder();
            builder.configure(params.fileBased().setFile(new File("configuration.xml
")).setListDelimiterHandler(new DefaultListDelimiterHandler(',')));
            CombinedConfiguration configuration = builder.getConfiguration();

Then when you print the configuration keys, you will get something like: node/@type, node/@types
- this format seems to be the standard one and keys in the above example look very strange.


 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message