public class PropertySourcesLoader extends Object
MutablePropertySources
using
PropertySourceLoader
s.Constructor and Description |
---|
PropertySourcesLoader()
Create a new
PropertySourceLoader instance backed by a new
MutablePropertySources . |
PropertySourcesLoader(org.springframework.core.env.MutablePropertySources propertySources)
Create a new
PropertySourceLoader instance backed by the specified
MutablePropertySources . |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAllFileExtensions()
Returns all file extensions that could be loaded.
|
org.springframework.core.env.MutablePropertySources |
getPropertySources()
Return the
MutablePropertySources being loaded. |
org.springframework.core.env.PropertySource<?> |
load(org.springframework.core.io.Resource resource)
Load the specified resource (if possible) and add it as the first source.
|
org.springframework.core.env.PropertySource<?> |
load(org.springframework.core.io.Resource resource,
String profile)
Load the profile-specific properties from the specified resource (if any) and add
it as the first source.
|
org.springframework.core.env.PropertySource<?> |
load(org.springframework.core.io.Resource resource,
String name,
String profile)
Load the profile-specific properties from the specified resource (if any), give the
name provided and add it as the first source.
|
org.springframework.core.env.PropertySource<?> |
load(org.springframework.core.io.Resource resource,
String group,
String name,
String profile)
Load the profile-specific properties from the specified resource (if any), give the
name provided and add it to a group of property sources identified by the group
name.
|
public PropertySourcesLoader()
PropertySourceLoader
instance backed by a new
MutablePropertySources
.public PropertySourcesLoader(org.springframework.core.env.MutablePropertySources propertySources)
PropertySourceLoader
instance backed by the specified
MutablePropertySources
.propertySources
- the destination property sourcespublic org.springframework.core.env.PropertySource<?> load(org.springframework.core.io.Resource resource) throws IOException
resource
- the source resource (may be null
).null
IOException
public org.springframework.core.env.PropertySource<?> load(org.springframework.core.io.Resource resource, String profile) throws IOException
resource
- the source resource (may be null
).profile
- a specific profile to load or null
to load the default.null
IOException
public org.springframework.core.env.PropertySource<?> load(org.springframework.core.io.Resource resource, String name, String profile) throws IOException
resource
- the source resource (may be null
).name
- the root property name (may be null
).profile
- a specific profile to load or null
to load the default.null
IOException
public org.springframework.core.env.PropertySource<?> load(org.springframework.core.io.Resource resource, String group, String name, String profile) throws IOException
resource
- the source resource (may be null
).group
- an identifier for the group that this source belongs toname
- the root property name (may be null
).profile
- a specific profile to load or null
to load the default.null
IOException
public org.springframework.core.env.MutablePropertySources getPropertySources()
MutablePropertySources
being loaded.Copyright © 2014 Pivotal Software, Inc.. All rights reserved.