public class LiquibaseConfiguration extends Object implements SingletonObject
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 ConfigurationValueProvider
s. Standard value providers are auto-loaded on startup, but more can be added/removed at runtime.
Modifier and Type | Field and Description |
---|---|
static String |
REGISTERED_VALUE_PROVIDERS_KEY |
Modifier | Constructor and Description |
---|---|
protected |
LiquibaseConfiguration() |
public static final String REGISTERED_VALUE_PROVIDERS_KEY
public static LiquibaseConfiguration getInstance()
Scope.getSingleton(Class)
public void init(Scope scope)
public void registerProvider(ConfigurationValueProvider valueProvider)
ConfigurationValueProvider
to the active collection of providers.public boolean unregisterProvider(ConfigurationValueProvider valueProvider)
ConfigurationValueProvider
from the active collection of providers.public boolean removeProvider(ConfigurationValueProvider provider)
ConfigurationValueProvider
from the active collection of providers.public <T extends ConfigurationContainer> T getConfiguration(Class<T> type)
ConfigurationDefinition
instances directlypublic SortedSet<ConfigurationValueProvider> getProviders()
public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, String... keyAndAliases)
getCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, ConfigurationValueProvider[], String...)
with no additional value providers.public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, ConfigurationValueProvider[] additionalValueProviders, String... keyAndAliases)
keyAndAliases
- The first element should be the canonical key name, with later elements being aliases. At least one element must be provided.additionalValueProviders
- additional ConfigurationValueProvider
s to use with higher priority than the ones registered in LiquibaseConfiguration
. The higher the array index, the higher the priority. Can be null.public void registerDefinition(ConfigurationDefinition<?> definition)
ConfigurationDefinition
so it will be returned by getRegisteredDefinitions(boolean)
public SortedSet<ConfigurationDefinition<?>> getRegisteredDefinitions(boolean includeInternal)
ConfigurationDefinition
s. Registered definitions are used for generated help documentation.includeInternal
- if true, include ConfigurationDefinition.isInternal()
definitions.public ConfigurationDefinition<?> getRegisteredDefinition(String key)
ConfigurationDefinition
associated with this key. Null if none match.Copyright © 2023 Liquibase.org. All rights reserved.