Top Description Fields Constructors Methods
liquibase.configuration

public abstract Class AbstractMapConfigurationValueProvider

extends AbstractConfigurationValueProvider
Class Inheritance
Known Direct Subclasses
liquibase.configuration.core.DefaultsFileValueProvider, liquibase.configuration.core.DeprecatedConfigurationValueProvider, liquibase.configuration.core.EnvironmentValueProvider, liquibase.configuration.core.SystemPropertyValueProvider, liquibase.integration.commandline.CommandLineArgumentValueProvider, liquibase.command.CommandScope.CommandScopeValueProvider
Imports
liquibase.util.StringUtil, java.util.HashMap, .Map, java.util.concurrent.locks.Lock, .ReentrantLock

Convenience class for ConfigurationValueProviders that can collect the possible values into a Map. By default, it will follow standardized fuzzy-matching rules including being case insensitive, checking camelCase and kabob-case, etc.
See Also
keyMatches(String, String)

Field Summary

Modifier and TypeField and Description
private final Map<String, ProvidedValue>
private int
private final Lock

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract Map<?, ?>
protected int
getMapHash()

Used by getProvidedValue(String...) to determine if the underlying data has changed vs. the cached results.

public ProvidedValue
getProvidedValue(String...
an array of keys to check, where the first element is the canonical key name, any aliases for that key as later elements.
keyAndAliases
)

Implements liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

Default implementation stores a cache of found known values, falling back to lookupProvidedValue(String...) when it is asked about a new key.

protected abstract String
protected boolean
isValueSet(Object value)

Used by ConfigurationValueProvider#getProvidedValue(String[]) to determine if the given value is a "real" value.

protected boolean
keyMatches(String
the configuration key requested
wantedKey
,
String
the key stored in the map
storedKey
)

Used by ConfigurationValueProvider#getProvidedValue(String[]) to determine of a given map entry matches the wanted key.

protected ProvidedValue
lookupProvidedValue(String... keyAndAliases)

Finds the given key in the result of getMap() using keyMatches(String, String) to determine key equality.

Inherited from liquibase.configuration.AbstractConfigurationValueProvider:
validate

Field Detail

knownValuesback to summary
private final Map<String, ProvidedValue> knownValues
knownValuesForHashback to summary
private int knownValuesForHash
knownValuesLockback to summary
private final Lock knownValuesLock

Constructor Detail

AbstractMapConfigurationValueProviderback to summary
public AbstractMapConfigurationValueProvider()

Method Detail

getMapback to summary
protected abstract Map<?, ?> getMap()
getMapHashback to summary
protected int getMapHash()

Used by getProvidedValue(String...) to determine if the underlying data has changed vs. the cached results.

getProvidedValueback to summary
public ProvidedValue getProvidedValue(String... keyAndAliases)

Implements liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

Default implementation stores a cache of found known values, falling back to lookupProvidedValue(String...) when it is asked about a new key. Uses getMapHash() to determine if the underlying map has changed.

Parameters
keyAndAliases:String[]

Doc from liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

an array of keys to check, where the first element is the canonical key name, any aliases for that key as later elements.

Returns:ProvidedValue

Doc from liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

null if the key is not defined in this provider.

Annotations
@Override
getSourceDescriptionback to summary
protected abstract String getSourceDescription()
isValueSetback to summary
protected boolean isValueSet(Object value)

Used by ConfigurationValueProvider#getProvidedValue(String[]) to determine if the given value is a "real" value. This implementation returns false if value is null or if it is an empty string

keyMatchesback to summary
protected boolean keyMatches(String wantedKey, String storedKey)

Used by ConfigurationValueProvider#getProvidedValue(String[]) to determine of a given map entry matches the wanted key. This implementation compares the values case-insensitively, and will replace camelCase words with kabob-case

Parameters
wantedKey:String

the configuration key requested

storedKey:String

the key stored in the map

lookupProvidedValueback to summary
protected ProvidedValue lookupProvidedValue(String... keyAndAliases)

Finds the given key in the result of getMap() using keyMatches(String, String) to determine key equality. Subclasses should usually override this method rather than getProvidedValue(String...) so the caching functionality is not lost.