Class ApplicationConfigHelper

java.lang.Object
org.nuiton.config.ApplicationConfigHelper

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

    • ApplicationConfigHelper

      protected ApplicationConfigHelper()
  • Method Details

    • 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
    • getProvider

      public static ApplicationConfigProvider getProvider(ClassLoader classLoader, String name)
    • 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
    • getTransientOptions

      public static Set<ConfigOptionDef> getTransientOptions(Set<ApplicationConfigProvider> providers)
      Gets all transient options from the given providers.
      Parameters:
      providers - providers to inspect
      Returns:
      the set of all options that are transient
      Since:
      2.6.7
      See Also:
    • getFinalOptions

      public static Set<ConfigOptionDef> getFinalOptions(Set<ApplicationConfigProvider> providers)
      Gets all final options from the given providers.
      Parameters:
      providers - providers to inspect
      Returns:
      the set of all options that are final
      Since:
      2.6.7
      See Also:
    • 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:
    • 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:
    • getFinalOptionKeys

      public static Set<String> getFinalOptionKeys(Set<ApplicationConfigProvider> providers)
      Gets all final options keys from the given providers.
      Parameters:
      providers - providers to inspect
      Returns:
      the set of all options keys that are final
      Since:
      2.6.7
      See Also: