Package org.nuiton.config
Class ApplicationConfigHelper
java.lang.Object
org.nuiton.config.ApplicationConfigHelper
public class ApplicationConfigHelper
extends java.lang.Object
Helper about
ApplicationConfig.- Since:
- 2.4.8
- Author:
- Tony Chemit - dev@tchemit.fr
-
Constructor Summary
Constructors Modifier Constructor Description protectedApplicationConfigHelper() -
Method Summary
Modifier and Type Method Description static java.util.Set<java.lang.String>getFinalOptionKeys(java.util.Set<ApplicationConfigProvider> providers)Gets all final options keys from the given providers.static java.util.Set<ConfigOptionDef>getFinalOptions(java.util.Set<ApplicationConfigProvider> providers)Gets all final options from the given providers.static ApplicationConfigProvidergetProvider(java.lang.ClassLoader classLoader, java.lang.String name)static java.util.Set<ApplicationConfigProvider>getProviders(java.lang.ClassLoader classLoader, java.util.Set<java.lang.String> includes, java.util.Set<java.lang.String> excludes, boolean verbose)Obtain all providers on class-path.static java.util.Set<java.lang.String>getTransientOptionKeys(java.util.Set<ApplicationConfigProvider> providers)Gets all transient options keys from the given providers.static java.util.Set<ConfigOptionDef>getTransientOptions(java.util.Set<ApplicationConfigProvider> providers)Gets all transient options from the given providers.static java.util.Set<java.lang.String>getTransientOrFinalOptionKey(java.util.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, java.util.Set<ApplicationConfigProvider> providers)Load all actions from all given config providers.static voidloadAllDefaultOption(ApplicationConfig config, java.util.Set<ApplicationConfigProvider> providers)Load default options from all given config providers.
-
Constructor Details
-
ApplicationConfigHelper
protected ApplicationConfigHelper()
-
-
Method Details
-
getProviders
public static java.util.Set<ApplicationConfigProvider> getProviders(java.lang.ClassLoader classLoader, java.util.Set<java.lang.String> includes, java.util.Set<java.lang.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(java.lang.ClassLoader classLoader, java.lang.String name) -
loadAllDefaultOption
public static void loadAllDefaultOption(ApplicationConfig config, java.util.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, java.util.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 java.util.Set<ConfigOptionDef> getTransientOptions(java.util.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 java.util.Set<ConfigOptionDef> getFinalOptions(java.util.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 java.util.Set<java.lang.String> getTransientOrFinalOptionKey(java.util.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 java.util.Set<java.lang.String> getTransientOptionKeys(java.util.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 java.util.Set<java.lang.String> getFinalOptionKeys(java.util.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()
-