类 PropertySourcesBinder
- java.lang.Object
- org.springframework.boot.bind.PropertySourcesBinder
public class PropertySourcesBinder extends Object
Helper extracting info fromPropertySources
.- 从以下版本开始:
- 1.4.0
构造器概要
构造器 构造器 说明 PropertySourcesBinder(org.springframework.core.env.ConfigurableEnvironment environment)
Create a new instance using theEnvironment
as the property sources.PropertySourcesBinder(org.springframework.core.env.PropertySource<?> propertySource)
Create a new instance from a singlePropertySource
.PropertySourcesBinder(org.springframework.core.env.PropertySources propertySources)
Create a new instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
bindTo(String prefix, Object target)
Bind the specifiedtarget
from the environment using theprefix
.Map<String,Object>
extractAll(String prefix)
Extract the keys using the specifiedprefix
.org.springframework.core.convert.ConversionService
getConversionService()
org.springframework.core.env.PropertySources
getPropertySources()
void
setConversionService(org.springframework.core.convert.ConversionService conversionService)
void
setPropertySources(org.springframework.core.env.PropertySources propertySources)
构造器详细资料
PropertySourcesBinder
public PropertySourcesBinder(org.springframework.core.env.PropertySources propertySources)
Create a new instance.- 参数:
propertySources
- thePropertySources
to use
PropertySourcesBinder
public PropertySourcesBinder(org.springframework.core.env.PropertySource<?> propertySource)
Create a new instance from a singlePropertySource
.- 参数:
propertySource
- thePropertySource
to use
PropertySourcesBinder
public PropertySourcesBinder(org.springframework.core.env.ConfigurableEnvironment environment)
Create a new instance using theEnvironment
as the property sources.- 参数:
environment
- the environment
方法详细资料
setPropertySources
public void setPropertySources(org.springframework.core.env.PropertySources propertySources)
getPropertySources
public org.springframework.core.env.PropertySources getPropertySources()
setConversionService
public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
getConversionService
public org.springframework.core.convert.ConversionService getConversionService()
extractAll
public Map<String,Object> extractAll(String prefix)
Extract the keys using the specifiedprefix
. The prefix won't be included.Any key that starts with the
prefix
will be included.- 参数:
prefix
- the prefix to use- 返回:
- the keys matching the prefix