public class DefaultConfiguration extends Object implements org.apache.tamaya.Configuration
ConfigurationContext to evaluate the
chain of PropertySource and PropertyFilter
instance to evaluate the current Configuration.| Constructor and Description |
|---|
DefaultConfiguration(org.apache.tamaya.spi.ConfigurationContext configurationContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
convertValue(String key,
String value,
org.apache.tamaya.TypeLiteral<T> type) |
protected org.apache.tamaya.spi.PropertyValue |
evaluteRawValue(String key)
Evaluates the raw value using the context's PropertyValueCombinationPolicy.
|
String |
get(String key)
Get a given value, filtered with the context's filters as needed.
|
<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,
org.apache.tamaya.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. |
org.apache.tamaya.spi.ConfigurationContext |
getContext() |
<T> T |
getOrDefault(String key,
Class<T> type,
T defaultValue) |
String |
getOrDefault(String key,
String defaultValue) |
<T> T |
getOrDefault(String key,
org.apache.tamaya.TypeLiteral<T> type,
T defaultValue) |
Map<String,String> |
getProperties()
Get the current properties, composed by the loaded
PropertySource and filtered
by registered PropertyFilter. |
<T> T |
query(org.apache.tamaya.ConfigQuery<T> query) |
String |
toString() |
org.apache.tamaya.Configuration |
with(org.apache.tamaya.ConfigOperator operator) |
public DefaultConfiguration(org.apache.tamaya.spi.ConfigurationContext configurationContext)
configurationContext - The configuration Context to be used.public String get(String key)
get in interface org.apache.tamaya.Configurationkey - the property's key, not null.protected org.apache.tamaya.spi.PropertyValue evaluteRawValue(String key)
key - the key, not null.public String getOrDefault(String key, String defaultValue)
getOrDefault in interface org.apache.tamaya.Configurationpublic <T> T getOrDefault(String key, Class<T> type, T defaultValue)
getOrDefault in interface org.apache.tamaya.Configurationpublic Map<String,String> getProperties()
PropertySource and filtered
by registered PropertyFilter.getProperties in interface org.apache.tamaya.Configurationpublic <T> T get(String key, Class<T> type)
PropertyConverter instances provided by the current
ConfigurationContext.get in interface org.apache.tamaya.ConfigurationT - 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, org.apache.tamaya.TypeLiteral<T> type)
PropertyConverter instances provided by the current
ConfigurationContext.get in interface org.apache.tamaya.ConfigurationT - 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.protected <T> T convertValue(String key, String value, org.apache.tamaya.TypeLiteral<T> type)
public <T> T getOrDefault(String key, org.apache.tamaya.TypeLiteral<T> type, T defaultValue)
getOrDefault in interface org.apache.tamaya.Configurationpublic org.apache.tamaya.Configuration with(org.apache.tamaya.ConfigOperator operator)
with in interface org.apache.tamaya.Configurationpublic <T> T query(org.apache.tamaya.ConfigQuery<T> query)
query in interface org.apache.tamaya.Configurationpublic org.apache.tamaya.spi.ConfigurationContext getContext()
getContext in interface org.apache.tamaya.ConfigurationCopyright © 2016–2017 Apache Software Foundation. All rights reserved.