public abstract class BaseFormatPropertySourceProvider extends Object implements org.apache.tamaya.spi.PropertySourceProvider
PropertySourceProvider
that reads configuration from some given resource paths
and using the given formats. The resource path are resolved as classpath resources. This can be changed by
overriding getPropertySources()
.
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<org.apache.tamaya.spi.PropertySource> |
getPropertySources()
This method does dynamically resolve the paths using the current ClassLoader set.
|
protected abstract Collection<org.apache.tamaya.spi.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<org.apache.tamaya.spi.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<org.apache.tamaya.spi.PropertySource> getPropertySources()
getPropertySources
in interface org.apache.tamaya.spi.PropertySourceProvider
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.