public class PropertySourcesPropertyResolver extends AbstractPropertyResolver
log| 构造器和说明 |
|---|
PropertySourcesPropertyResolver(PropertySourceIterable propertySources) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
containsProperty(String key)
Whether the given property key is available.
|
Optional<String> |
getProperty(String key)
Find the property value associated with the given key.
|
<R,T> Optional<T> |
getProperty(String key,
Function<R,T> mappingFunction)
Find the property value associated with the given key.
|
protected <R,T> T |
getProperty(String key,
Function<R,T> mappingFunction,
boolean resolveNestedPlaceholders) |
protected Optional<String> |
getPropertyAsRawString(String key)
Retrieve the specified property as a raw String,
i.e. without resolution of nested placeholders.
|
protected void |
logKeyFound(String key,
PropertySource<?> propertySource,
Object value)
Log the given key as found in the given
PropertySource, resulting in
the given value. |
getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolveNestedPlaceholders, resolvePlaceholders, resolveRequiredPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setValueSeparatorpublic PropertySourcesPropertyResolver(PropertySourceIterable propertySources)
public boolean containsProperty(String key)
PropertyResolvercontainsProperty 在接口中 PropertyResolvercontainsProperty 在类中 AbstractPropertyResolverpublic Optional<String> getProperty(String key)
PropertyResolverOptional.empty() will be returned if the key cannot be resolved.key - the property name to resolvePropertyResolver.getProperty(String, String),
PropertyResolver.getProperty(String, Function),
PropertyResolver.getRequiredProperty(String)public <R,T> Optional<T> getProperty(String key, Function<R,T> mappingFunction)
PropertyResolverOptional.empty() will be returned if the key cannot be resolved.key - the property name to resolvemappingFunction - the mapping function convert original object to target objet.PropertyResolver.getRequiredProperty(String, Function)protected Optional<String> getPropertyAsRawString(String key)
AbstractPropertyResolvergetPropertyAsRawString 在类中 AbstractPropertyResolverkey - the property name to resolveOptional.empty() if none foundprotected <R,T> T getProperty(String key, Function<R,T> mappingFunction, boolean resolveNestedPlaceholders)
protected void logKeyFound(String key, PropertySource<?> propertySource, Object value)
PropertySource, resulting in
the given value.Copyright © 2021. All rights reserved.