Package liquibase.configuration
Class LiquibaseConfiguration
java.lang.Object
liquibase.configuration.LiquibaseConfiguration
- All Implemented Interfaces:
SingletonObject
Provides unified management of configuration properties within Liquibase core and in extensions.
Because this class focuses on raw/untyped access to what is actually configured, it is usually best to interact with ConfigurationDefinition instances
which provide type safety, standardized key naming, default values, and more.
"Registered" configuration definitions will be available for generated help.
This class will search through the configured ConfigurationValueProviders. Standard value providers are auto-loaded on startup, but more can be added/removed at runtime.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends ConfigurationContainer>
TgetConfiguration(Class<T> type) Deprecated.<DataType> ConfiguredValue<DataType>getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, String... keyAndAliases) Convenience method forgetCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, ConfigurationValueProvider[], String...)with no additional value providers.<DataType> ConfiguredValue<DataType>getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, ConfigurationValueProvider[] additionalValueProviders, String... keyAndAliases) Searches for the given keys in the current providers and applies any applicable modifiers.static LiquibaseConfigurationDeprecated.getProvider(ConfigurationValueProvider provider) getRegisteredDefinitions(boolean includeInternal) Returns all registeredConfigurationDefinitions.voidFinishes configuration of this service.voidregisterDefinition(ConfigurationDefinition<?> definition) Registers aConfigurationDefinitionso it will be returned bygetRegisteredDefinitions(boolean)voidregisterProvider(ConfigurationValueProvider valueProvider) Adds a newConfigurationValueProviderto the active collection of providers.booleanremoveProvider(ConfigurationValueProvider provider) Removes a specificConfigurationValueProviderfrom the active collection of providers.booleanunregisterProvider(ConfigurationValueProvider valueProvider) Removes the givenConfigurationValueProviderfrom the active collection of providers.
-
Field Details
-
REGISTERED_VALUE_PROVIDERS_KEY
- See Also:
-
-
Constructor Details
-
LiquibaseConfiguration
protected LiquibaseConfiguration()
-
-
Method Details
-
getInstance
Deprecated. -
init
Finishes configuration of this service. Called as the root scope is set up, should not be called elsewhere. -
registerProvider
Adds a newConfigurationValueProviderto the active collection of providers. -
unregisterProvider
Removes the givenConfigurationValueProviderfrom the active collection of providers.- Returns:
- true if the given provider was previously registered.
-
removeProvider
Removes a specificConfigurationValueProviderfrom the active collection of providers.- Returns:
- true if the provider was removed.
-
getConfiguration
Deprecated.useConfigurationDefinitioninstances directly -
getProviders
-
getProvider
-
getCurrentConfiguredValue
public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, String... keyAndAliases) Convenience method forgetCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, ConfigurationValueProvider[], String...)with no additional value providers. -
getCurrentConfiguredValue
public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, ConfigurationValueProvider[] additionalValueProviders, String... keyAndAliases) Searches for the given keys in the current providers and applies any applicable modifiers.- Parameters:
keyAndAliases- The first element should be the canonical key name, with later elements being aliases. At least one element must be provided.additionalValueProviders- additionalConfigurationValueProviders to use with higher priority than the ones registered inLiquibaseConfiguration. The higher the array index, the higher the priority. Can be null.- Returns:
- the value for the key, or null if not configured.
-
registerDefinition
Registers aConfigurationDefinitionso it will be returned bygetRegisteredDefinitions(boolean) -
getRegisteredDefinitions
Returns all registeredConfigurationDefinitions. Registered definitions are used for generated help documentation.- Parameters:
includeInternal- if true, includeConfigurationDefinition.isInternal()definitions.
-
getRegisteredDefinition
- Returns:
- the registered
ConfigurationDefinitionassociated with this key. Null if none match.
-
ConfigurationDefinitioninstances directly