public class DefaultConfiguration extends Object implements Configuration
ConfigurationContext
to evaluate the
chain of PropertySource
and PropertyFilter
instance to evaluate the current Configuration.Constructor and Description |
---|
DefaultConfiguration(ConfigurationContext configurationContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
get(String key)
This method evaluates the given configuration key.
|
<T> T |
get(String key,
Class<T> type)
Accesses the current String value for the given key and tries to convert it
using the
PropertyConverter instances provided by the current
ConfigurationContext . |
<T> T |
get(String key,
TypeLiteral<T> type)
Accesses the current String value for the given key and tries to convert it
using the
PropertyConverter instances provided by the current
ConfigurationContext . |
Map<String,String> |
getProperties()
Get the current properties, composed by the loaded
PropertySource and filtered
by registered PropertyFilter . |
<T> T |
query(ConfigQuery<T> query) |
Configuration |
with(ConfigOperator operator) |
public DefaultConfiguration(ConfigurationContext configurationContext)
configurationContext
- The configuration Context to be used.public String get(String key)
ConfigurationContext
. The first non-null-value returned
is taken as an intermediate value. Finally the value is filtered through the
PropertyFilter
instances installed, before it is returned as the final result of
this method.get
in interface Configuration
key
- the property's key, not null.public Map<String,String> getProperties()
PropertySource
and filtered
by registered PropertyFilter
.getProperties
in interface Configuration
public <T> T get(String key, Class<T> type)
PropertyConverter
instances provided by the current
ConfigurationContext
.get
in interface Configuration
T
- the value typekey
- the property's absolute, or relative path, e.g. @code
a/b/c/d.myProperty}.type
- The target type required, not null.public <T> T get(String key, TypeLiteral<T> type)
PropertyConverter
instances provided by the current
ConfigurationContext
.get
in interface Configuration
T
- the value typekey
- the property's absolute, or relative path, e.g. @code
a/b/c/d.myProperty}.type
- The target type required, not null.public Configuration with(ConfigOperator operator)
with
in interface Configuration
public <T> T query(ConfigQuery<T> query)
query
in interface Configuration
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.