接口 PropertySourceFactory
- 所有已知实现类:
DefaultPropertySourceFactory
public interface PropertySourceFactory
Strategy interface for creating resource-based
PropertySource wrappers.- 从以下版本开始:
- 4.0 2021/10/28 17:34
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明createPropertySource(String name, EncodedResource resource) Create aPropertySourcethat wraps the given resource.
-
方法详细资料
-
createPropertySource
PropertySource<?> createPropertySource(@Nullable String name, EncodedResource resource) throws IOException Create aPropertySourcethat wraps the given resource.Implementations will typically create
ResourcePropertySourceinstances, withPropertySourceProcessorautomatically adapting property source names viaResourcePropertySource.withResourceName()if necessary, e.g. when combining multiple sources for the same name into aCompositePropertySource. Custom implementations with customPropertySourcetypes need to make sure to expose distinct enough names, possibly deriving fromResourcePropertySourcewhere possible.- 参数:
name- the name of the property source (can benullin which case the factory implementation will have to generate a name based on the given resource)resource- the resource (potentially encoded) to wrap- 返回:
- the new
PropertySource(nevernull) - 抛出:
IOException- if resource resolution failed
-