public class Scope extends Object
child(Map, ScopedRunner)
or child(String, Object, ScopedRunner)
methods.
Values set in parent scopes are visible in child scopes, but values in child scopes are not visible to parent scopes.
Values with the same key in different scopes "mask" each other with the value furthest down the scope chain being returned.Modifier and Type | Class and Description |
---|---|
static class |
Scope.Attr
Enumeration containing standard attributes.
|
static interface |
Scope.ScopedRunner |
Modifier | Constructor and Description |
---|---|
protected |
Scope(Scope parent,
Map<String,Object> scopeValues) |
Modifier and Type | Method and Description |
---|---|
void |
child(Enum newValueKey,
Object newValue,
Scope.ScopedRunner runner) |
static void |
child(LiquibaseListener listener,
Map<String,Object> scopeValues,
Scope.ScopedRunner runner) |
static void |
child(LiquibaseListener listener,
Scope.ScopedRunner runner)
Creates a new child scope that includes the given
LiquibaseListener . |
static void |
child(Map<String,Object> scopeValues,
Scope.ScopedRunner runner)
Creates a new scope that is a child of this scope.
|
void |
child(String newValueKey,
Object newValue,
Scope.ScopedRunner runner)
Creates a new scope that is a child of this scope.
|
String |
describe() |
<T> T |
get(Enum key,
Class<T> type) |
<T> T |
get(Enum key,
T defaultValue) |
<T> T |
get(String key,
Class<T> type)
Return the value associated with the given key in this scope or any parent scope.
|
<T> T |
get(String key,
T defaultValue)
Return the value associated with the given key in this scope or any parent scope.
|
ClassLoader |
getClassLoader() |
ClassLoader |
getClassLoader(boolean fallbackToContextClassLoader) |
static Scope |
getCurrentScope() |
Database |
getDatabase() |
String |
getLineSeparator() |
<T extends LiquibaseListener> |
getListeners(Class<T> type)
Returns
LiquibaseListener s defined in this scope and/or all its parents that are of the given type. |
Logger |
getLog(Class clazz) |
Scope |
getParent()
Returns the parent scope to this scope.
|
ResourceAccessor |
getResourceAccessor() |
<T extends SingletonObject> |
getSingleton(Class<T> type)
Looks up the singleton object of the given type.
|
boolean |
has(Enum key)
Return true if the given key is defined.
|
boolean |
has(String key)
Return true if the given key is defined.
|
String |
toString() |
public static Scope getCurrentScope()
public Scope getParent()
public static void child(Map<String,Object> scopeValues, Scope.ScopedRunner runner)
public static void child(LiquibaseListener listener, Scope.ScopedRunner runner)
LiquibaseListener
.
You cannot unassign a listener, they simply fall out of scope when the Scope does.getListeners(Class)
public static void child(LiquibaseListener listener, Map<String,Object> scopeValues, Scope.ScopedRunner runner)
public void child(String newValueKey, Object newValue, Scope.ScopedRunner runner)
public void child(Enum newValueKey, Object newValue, Scope.ScopedRunner runner)
public boolean has(String key)
public boolean has(Enum key)
public <T> T get(Enum key, T defaultValue)
public <T> T get(String key, Class<T> type)
ObjectUtil.convert(Object, Class)
.
Returns null if key is not defined in this or any parent scopes.public <T> T get(String key, T defaultValue)
ObjectUtil.convert(Object, Class)
.public <T extends SingletonObject> T getSingleton(Class<T> type)
public Database getDatabase()
public ClassLoader getClassLoader()
public ClassLoader getClassLoader(boolean fallbackToContextClassLoader)
public ResourceAccessor getResourceAccessor()
public String getLineSeparator()
public <T extends LiquibaseListener> Collection<T> getListeners(Class<T> type)
LiquibaseListener
s defined in this scope and/or all its parents that are of the given type.public String describe()
Copyright © 2020 Liquibase.org. All rights reserved.