Class ApplicationConfigHelper


  • public class ApplicationConfigHelper
    extends Object
    Helper about ApplicationConfig.
    Since:
    2.4.8
    Author:
    Tony Chemit - dev@tchemit.fr
    • Constructor Detail

      • ApplicationConfigHelper

        protected ApplicationConfigHelper()
    • Method Detail

      • getProviders

        public static Set<ApplicationConfigProvider> getProviders​(ClassLoader classLoader,
                                                                  Set<String> includes,
                                                                  Set<String> excludes,
                                                                  boolean verbose)
        Obtain all providers on class-path.
        Parameters:
        classLoader - optional classLoader used to seek for providers
        includes - optional includes providers to use (if none then accept all providers)
        excludes - optional excludes providers (if none the no reject)
        verbose - verbose flag
        Returns:
        sets of providers
      • loadAllDefaultOption

        public static void loadAllDefaultOption​(ApplicationConfig config,
                                                Set<ApplicationConfigProvider> providers)
        Load default options from all given config providers.
        Parameters:
        config - config where to add default options.
        providers - providers to use
        Since:
        2.6.7
      • loadAllActions

        public static void loadAllActions​(ApplicationConfig applicationConfig,
                                          Set<ApplicationConfigProvider> providers)
        Load all actions from all given config providers.
        Parameters:
        applicationConfig - config where to add actions.
        providers - providers to use
        Since:
        3.0
      • getTransientOrFinalOptionKey

        public static Set<String> getTransientOrFinalOptionKey​(Set<ApplicationConfigProvider> providers)
        Get all option keys that should not be saved in the user config file from the given options providers. Such options are transient or final.
        Parameters:
        providers - providers to inspect
        Returns:
        the set of options key not to store in the config file
        Since:
        2.6.11
        See Also:
        ConfigOptionDef.isFinal(), ConfigOptionDef.isTransient()
      • getTransientOptionKeys

        public static Set<String> getTransientOptionKeys​(Set<ApplicationConfigProvider> providers)
        Gets all transient options keys from the given providers.
        Parameters:
        providers - providers to inspect
        Returns:
        the set of all options key that are transient
        Since:
        2.6.11
        See Also:
        ConfigOptionDef.isTransient()