public class KeyedProperties extends ConcurrentHashMap<String,Object>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected HashSet<String> |
externalPaths
the alternate global property-paths leading to this map
TODO: consider if deterministic ordered list is important
|
protected static ThreadLocal<ArrayList<OverlayContext>> |
threadOverrides
ThreadLocal (contextual) collection of pushed override maps
|
Constructor and Description |
---|
KeyedProperties() |
Modifier and Type | Method and Description |
---|---|
void |
addExternalPath(String path)
Add a path by which the outside world can reach this map
|
static void |
clearAllOverrideContexts() |
static boolean |
clearOverridesFrom(OverlayContext ocontext) |
Object |
get(String key)
Get the given value, checking override maps if appropriate.
|
protected List<String> |
getOverrideKeys(String key)
Compose the complete keys (externalPath + local key name) to use
for checking for contextual overrides.
|
static void |
loadOverridesFrom(OverlayContext ocontext) |
static boolean |
overridesActiveFrom(OverlayContext ocontext) |
static OverlayContext |
popOverridesContext()
Remove last-added override map from the stack
|
static void |
pushOverrideContext(OverlayContext ocontext)
Add an override map to the stack
|
static void |
withOverridesDo(OverlayContext ocontext,
Runnable todo) |
clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values
clone, equals, hashCode, toString
protected HashSet<String> externalPaths
protected static ThreadLocal<ArrayList<OverlayContext>> threadOverrides
public void addExternalPath(String path)
path
- String pathpublic Object get(String key)
key
- protected List<String> getOverrideKeys(String key)
key
- local key to composepublic static void pushOverrideContext(OverlayContext ocontext)
m
- Map to addpublic static OverlayContext popOverridesContext()
public static void clearAllOverrideContexts()
public static void loadOverridesFrom(OverlayContext ocontext)
public static boolean clearOverridesFrom(OverlayContext ocontext)
public static void withOverridesDo(OverlayContext ocontext, Runnable todo)
public static boolean overridesActiveFrom(OverlayContext ocontext)
Copyright © 2003-2014 Internet Archive. All Rights Reserved.