Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-447

DefaultConfigurationBuilder should provide default provider for environment variables

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None

      Description

      DefaultConfigurationBuilder does not provide a way to merge environment variable into the configuration

      eg:

      <configuration>
        <env/>
        ...
      </configuration>
      

      I think this could be implemented by adding the following code into the DefaultConfigurationBuilder class

      DefaultConfigurationBuilder.java
      //Constant for the provider for environment variables.
      private static final ConfigurationProvider ENV_PROVIDER = new ConfigurationProvider(
                  EnvironmentConfiguration.class);
      
      //An array with the names of the default tags.
       private static final String[] DEFAULT_TAGS =
           {"properties", "xml", "hierarchicalXml", "jndi", "system", "plist", "configuration","env"};
      
          
      //An array with the providers for the default tags.
       
           private static final ConfigurationProvider[] DEFAULT_PROVIDERS =
           {PROPERTIES_PROVIDER, XML_PROVIDER, XML_PROVIDER, JNDI_PROVIDER,
                   SYSTEM_PROVIDER, PLIST_PROVIDER, BUILDER_PROVIDER,ENV_PROVIDER};
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fabien_nisol Fabien Nisol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: