Interface ConfigDataLoader<R extends ConfigDataResource>
- Type Parameters:
- R- the resource type
- All Known Implementing Classes:
- ConfigTreeConfigDataLoader,- StandardConfigDataLoader
public interface ConfigDataLoader<R extends ConfigDataResource>
Strategy class that can be used to load 
ConfigData for a given
 ConfigDataResource. Implementations should be added as spring.factories
 entries. The following constructor parameter types are supported:
 - DeferredLogFactory- if the loader needs deferred logging
- ConfigurableBootstrapContext- A bootstrap context that can be used to store objects that may be expensive to create, or need to be shared (- BootstrapContextor- BootstrapRegistrymay also be used).
Multiple loaders cannot claim the same resource.
- Since:
- 2.4.0
- Author:
- Phillip Webb, Madhura Bhave
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleanisLoadable(ConfigDataLoaderContext context, R resource) Returns if the specified resource can be loaded by this instance.load(ConfigDataLoaderContext context, R resource) LoadConfigDatafor the given resource.
- 
Method Details- 
isLoadableReturns if the specified resource can be loaded by this instance.- Parameters:
- context- the loader context
- resource- the resource to check.
- Returns:
- if the resource is supported by this loader
 
- 
loadConfigData load(ConfigDataLoaderContext context, R resource) throws IOException, ConfigDataResourceNotFoundException LoadConfigDatafor the given resource.- Parameters:
- context- the loader context
- resource- the resource to load
- Returns:
- the loaded config data or nullif the location should be skipped
- Throws:
- IOException- on IO error
- ConfigDataResourceNotFoundException- if the resource cannot be found
 
 
-