public interface ConfigurationContext
PropertySource
s,
managing PropertyConverter
s, ConfigFilters, etc.Modifier and Type | Method and Description |
---|---|
Map<TypeLiteral<?>,List<PropertyConverter<?>>> |
getPropertyConverters()
This method returns the Map of registered PropertyConverters
per type.
|
<T> List<PropertyConverter<T>> |
getPropertyConverters(TypeLiteral<T> type)
This method returns the registered PropertyConverters for a given type.
|
List<PropertyFilter> |
getPropertyFilters()
Access the current PropertyFilter instances.
|
List<PropertySource> |
getPropertySources()
This method returns the current list of registered PropertySources ordered via their ordinal.
|
default Collection<PropertySource> |
getPropertySources(java.util.function.Predicate<PropertySource> selector)
This method returns a subset ot the currently registered PropertySources.
|
PropertyValueCombinationPolicy |
getPropertyValueCombinationPolicy()
Access the
PropertyValueCombinationPolicy used to evaluate the final
property values. |
ConfigurationContextBuilder |
toBuilder()
Creates a new updates instance for changing the current ConfigurationContext.
|
List<PropertySource> getPropertySources()
default Collection<PropertySource> getPropertySources(java.util.function.Predicate<PropertySource> selector)
selector
- the selector query, not null.Map<TypeLiteral<?>,List<PropertyConverter<?>>> getPropertyConverters()
This method returns the Map of registered PropertyConverters
per type.
The List for each type is ordered via their Priority
and
class name.
A simplified scenario could be like:
{ Date.class -> {StandardDateConverter, TimezoneDateConverter, MyCustomDateConverter } Boolean.class -> {StandardBooleanConverter, FrenchBooleanConverter} Integer.class -> {DynamicDefaultConverter} }
<T> List<PropertyConverter<T>> getPropertyConverters(TypeLiteral<T> type)
This method returns the registered PropertyConverters for a given type.
The List for each type is ordered via their Priority
.
PropertyConverters with a higher Priority come first. The PropertyConverter with the lowest Priority comes last. If two PropertyConverter have the same ordinal number they will get sorted using their class name just to ensure the user at least gets the same ordering after a JVM restart.
Additionally if a PropertyProvider is accessed, which is not registered the implementation should try to figure out, if there could be a default implementation as follows:
of(String), valueOf(String), getInstance(String),
instanceOf(String), fomr(String)
T(String)
.
The scenario could be like:
{ Date.class -> {MyCustomDateConverter,StandardDateConverter, TimezoneDateConverter} Boolean.class -> {StandardBooleanConverter, FrenchBooleanConverter} Integer.class -> {DynamicDefaultConverter} }
The converters returned for a type should be used as a chain, whereas the result of the first converter that is able to convert the configured value, is taken as the chain's result. No more converters are called after a converter has successfully converted the input into the required target type.
List<PropertyFilter> getPropertyFilters()
PropertyValueCombinationPolicy getPropertyValueCombinationPolicy()
PropertyValueCombinationPolicy
used to evaluate the final
property values.PropertyValueCombinationPolicy
used, never null.ConfigurationContextBuilder toBuilder()
UnsupportedOperationException
- if this ConfigurationContext is not updateable.Copyright © 2014–2015 Apache Software Foundation. All rights reserved.