public abstract class BaseFormatPropertySourceProvider extends Object implements PropertySourceProvider
PropertySourceProvider
that reads configuration from some given resource paths
and using the given formats. The resource path are resolved using the current
ResourceResolver
active. For each resource found the configuration formats
passed get a chance to read the resource, if they succeed the result is taken as the providers PropertySources
to be exposed.Constructor and Description |
---|
BaseFormatPropertySourceProvider(List<ConfigurationFormat> formats,
ClassLoader classLoader,
String... paths)
Creates a new instance.
|
BaseFormatPropertySourceProvider(List<ConfigurationFormat> formats,
String... paths)
Creates a new instance, hereby using the current thread context classloader, or if not available the classloader
that loaded this class.
|
BaseFormatPropertySourceProvider(List<ConfigurationFormat> formats,
URL... paths)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
Collection<PropertySource> |
getPropertySources()
This method does dynamically resolve the paths using the current ClassLoader set.
|
protected abstract Collection<PropertySource> |
getPropertySources(ConfigurationData data)
Method to create a
PropertySource based on the given entries read. |
public BaseFormatPropertySourceProvider(List<ConfigurationFormat> formats, URL... paths)
formats
- the formats to be used, not null, not empty.paths
- the paths to be resolved, not null, not empty.public BaseFormatPropertySourceProvider(List<ConfigurationFormat> formats, String... paths)
formats
- the formats to be used, not null, not empty.paths
- the paths to be resolved, not null, not empty.public BaseFormatPropertySourceProvider(List<ConfigurationFormat> formats, ClassLoader classLoader, String... paths)
classLoader
- the ClassLoader to be used, not null, not empty.formats
- the formats to be used, not null, not empty.paths
- the paths to be resolved, not null, not empty.protected abstract Collection<PropertySource> getPropertySources(ConfigurationData data)
PropertySource
based on the given entries read.data
- the configuration data, not null.PropertySource
instance ready to be registered.public Collection<PropertySource> getPropertySources()
getPropertySources
in interface PropertySourceProvider
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.