Package io.ultreia.java4all.config
Class ApplicationConfigHelper
- java.lang.Object
-
- io.ultreia.java4all.config.ApplicationConfigHelper
-
public class ApplicationConfigHelper extends Object
Helper aboutApplicationConfig.- Since:
- 2.4.8
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedApplicationConfigHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>getFinalOptionKeys(Set<ApplicationConfigProvider> providers)Gets all final options keys from the given providers.static Set<ConfigOptionDef>getFinalOptions(Set<ApplicationConfigProvider> providers)Gets all final options from the given providers.static ApplicationConfigProvidergetProvider(ClassLoader classLoader, String name)static Set<ApplicationConfigProvider>getProviders(ClassLoader classLoader, Set<String> includes, Set<String> excludes, boolean verbose)Obtain all providers on class-path.static Set<String>getTransientOptionKeys(Set<ApplicationConfigProvider> providers)Gets all transient options keys from the given providers.static Set<ConfigOptionDef>getTransientOptions(Set<ApplicationConfigProvider> providers)Gets all transient options from the given providers.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.static voidloadAllActions(ApplicationConfig applicationConfig, Set<ApplicationConfigProvider> providers)Load all actions from all given config providers.static voidloadAllDefaultOption(ApplicationConfig config, Set<ApplicationConfigProvider> providers)Load default options from all given config providers.
-
-
-
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 providersincludes- 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:
ConfigOptionDef.isTransient()
-
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:
ConfigOptionDef.isFinal()
-
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 aretransientorfinal.- 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()
-
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:
ConfigOptionDef.isTransient()
-
-