Top Description Constructors Methods
org.springframework.core.io.support

public Class DefaultPropertySourceFactory

extends Object
implements PropertySourceFactory
Class Inheritance
All Implemented Interfaces
org.springframework.core.io.support.PropertySourceFactory
Imports
java.io.IOException, org.springframework.core.env.PropertySource, org.springframework.lang.Nullable

The default implementation for PropertySourceFactory, wrapping every resource in a ResourcePropertySource.
Author
Juergen Hoeller
Since
4.3
See Also
PropertySourceFactory, ResourcePropertySource

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PropertySource<?>
createPropertySource(String
the name of the property source (can be null in which case the factory implementation will have to generate a name based on the given resource)
name
,
EncodedResource
the resource (potentially encoded) to wrap
resource
)

Implements org.springframework.core.io.support.PropertySourceFactory.createPropertySource.

Create a PropertySource that wraps the given resource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultPropertySourceFactoryback to summary
public DefaultPropertySourceFactory()

Method Detail

createPropertySourceback to summary
public PropertySource<?> createPropertySource(String name, EncodedResource resource) throws IOException

Implements org.springframework.core.io.support.PropertySourceFactory.createPropertySource.

Doc from org.springframework.core.io.support.PropertySourceFactory.createPropertySource.

Create a PropertySource that wraps the given resource.

Implementations will typically create ResourcePropertySource instances, with PropertySourceProcessor automatically adapting property source names via ResourcePropertySource#withResourceName() if necessary, e.g. when combining multiple sources for the same name into a org.springframework.core.env.CompositePropertySource. Custom implementations with custom PropertySource types need to make sure to expose distinct enough names, possibly deriving from ResourcePropertySource where possible.

Parameters
name:String

the name of the property source (can be null in which case the factory implementation will have to generate a name based on the given resource)

resource:EncodedResource

the resource (potentially encoded) to wrap

Returns:PropertySource<?>

the new PropertySource (never null)

Annotations
@Override
Exceptions
IOException:
if resource resolution failed