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

DefaultConfigurationBuilder should provide default provider for environment variables

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.6
    • 1.7
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: