L
- the location typepublic interface ConfigDataLocationResolver<L extends ConfigDataLocation>
locations
from a String
based location address. Implementations should be added as a spring.factories
entries. The following constructor parameter types are supported:
Log
- if the resolver needs deferred loggingBinder
- if the resolver needs to obtain values from the initial
Environment
ResourceLoader
- if the resolver needs a resource loaderConfigurableBootstrapContext
- A bootstrap context that can be used to
store objects that may be expensive to create, or need to be shared
(BootstrapContext
or BootstrapRegistry
may also be used).
Resolvers may implement Ordered
or use the @Order
annotation. The
first resolver that supports the given location will be used.
Modifier and Type | Method and Description |
---|---|
boolean |
isResolvable(ConfigDataLocationResolverContext context,
String location)
Returns if the specified location address can be resolved by this resolver.
|
List<L> |
resolve(ConfigDataLocationResolverContext context,
String location,
boolean optional)
Resolve a location string into one or more
ConfigDataLocation instances. |
default List<L> |
resolveProfileSpecific(ConfigDataLocationResolverContext context,
String location,
boolean optional,
Profiles profiles)
Resolve a location string into one or more
ConfigDataLocation instances
based on available profiles. |
boolean isResolvable(ConfigDataLocationResolverContext context, String location)
context
- the location resolver contextlocation
- the location to check.List<L> resolve(ConfigDataLocationResolverContext context, String location, boolean optional) throws ConfigDataLocationNotFoundException
ConfigDataLocation
instances.context
- the location resolver contextlocation
- the location that should be resolvedoptional
- if the location is optionalConfigDataLocationNotFoundException
- on a non-optional location that cannot
be founddefault List<L> resolveProfileSpecific(ConfigDataLocationResolverContext context, String location, boolean optional, Profiles profiles) throws ConfigDataLocationNotFoundException
ConfigDataLocation
instances
based on available profiles. This method is called once profiles have been deduced
from the contributed values. By default this method returns an empty list.context
- the location resolver contextlocation
- the location that should be resolvedoptional
- if the location is optionalprofiles
- profile informationConfigDataLocationNotFoundException
- on a non-optional location that cannot
be found