@Vetoed public class ConfigViewImpl extends Object implements ConfigView
If an explicit properties object is provided (withProperties(Properties), then
the System properties will be completely ignored. If not, then System properties will be
inspected, and any non-property based configuration will be reflect back into the
live and active System properties.
| Constructor and Description |
|---|
ConfigViewImpl()
Construct a new view.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
Stream<ConfigKey> |
allKeysRecursively() |
Properties |
asProperties() |
boolean |
hasKeyOrSubkeys(ConfigKey subPrefix) |
void |
register(String name,
ConfigNode config)
Register a named
ConfigNode. |
Set<String> |
registered()
Return the list of all registered node names.
|
Resolver<String> |
resolve(ConfigKey key) |
Set<SimpleKey> |
simpleSubkeys(ConfigKey prefix) |
Object |
valueOf(ConfigKey key)
Retrieve a configuration value by key.
|
ConfigViewImpl |
withDefaults(ConfigNode defaultConfig)
Define the tail-end, default
ConfigNode. |
void |
withProfile(List<String> names) |
void |
withProfile(String... names)
Activate this view with the given node names.
|
ConfigViewImpl |
withProperties(Properties properties)
Supply explicit properties object for introspection and outrespection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresolvepublic ConfigViewImpl withProperties(Properties properties)
properties - The properties.public ConfigViewImpl withDefaults(ConfigNode defaultConfig)
ConfigNode.defaultConfig - The defaults.public void register(String name, ConfigNode config)
ConfigNode.name - The name to register.config - THe node to register.public Set<String> registered()
public Object valueOf(ConfigKey key)
valueOf in interface ConfigViewkey - The possibly complex key.null.public void withProfile(String... names)
This method should be called only after defaults, properties and all relevant nodes have been registered.
names - The names to activate.public void activate()
public Properties asProperties()
asProperties in interface ConfigViewpublic Set<SimpleKey> simpleSubkeys(ConfigKey prefix)
simpleSubkeys in interface ConfigViewpublic boolean hasKeyOrSubkeys(ConfigKey subPrefix)
hasKeyOrSubkeys in interface ConfigViewpublic Resolver<String> resolve(ConfigKey key)
resolve in interface ConfigViewpublic Stream<ConfigKey> allKeysRecursively()
allKeysRecursively in interface ConfigViewCopyright © 2017 JBoss by Red Hat. All rights reserved.