Class DefaultPropertySourceFactory
java.lang.Object
org.springframework.core.io.support.DefaultPropertySourceFactory
- All Implemented Interfaces:
PropertySourceFactory
The default implementation for
PropertySourceFactory
,
wrapping every resource in a ResourcePropertySource
.- Since:
- 4.3
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreatePropertySource
(String name, EncodedResource resource) Create aPropertySource
that wraps the given resource.
-
Constructor Details
-
DefaultPropertySourceFactory
public DefaultPropertySourceFactory()
-
-
Method Details
-
createPropertySource
public PropertySource<?> createPropertySource(@Nullable String name, EncodedResource resource) throws IOException Description copied from interface:PropertySourceFactory
Create aPropertySource
that wraps the given resource.Implementations will typically create
ResourcePropertySource
instances, withPropertySourceProcessor
automatically adapting property source names viaResourcePropertySource.withResourceName()
if necessary, e.g. when combining multiple sources for the same name into aCompositePropertySource
. Custom implementations with customPropertySource
types need to make sure to expose distinct enough names, possibly deriving fromResourcePropertySource
where possible.- Specified by:
createPropertySource
in interfacePropertySourceFactory
- Parameters:
name
- the name of the property source (can benull
in 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
-