Interface PropertySourceFactory
- All Known Implementing Classes:
DefaultPropertySourceFactory
public interface PropertySourceFactory
Strategy interface for creating resource-based
PropertySource wrappers.- Since:
- 4.3
- Author:
- Juergen Hoeller
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreatePropertySource(@Nullable String name, EncodedResource resource) Create aPropertySourcethat wraps the given resource.
-
Method Details
-
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, for example, 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.- Parameters:
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- Returns:
- the new
PropertySource(nevernull) - Throws:
IOException- if resource resolution failed
-