Class StandardConfigDataLocationResolver
java.lang.Object
org.springframework.boot.context.config.StandardConfigDataLocationResolver
- All Implemented Interfaces:
ConfigDataLocationResolver<StandardConfigDataResource>
,Ordered
public class StandardConfigDataLocationResolver
extends Object
implements ConfigDataLocationResolver<StandardConfigDataResource>, Ordered
ConfigDataLocationResolver
for standard locations.- Since:
- 2.4.0
- Author:
- Madhura Bhave, Phillip Webb, Scott Frederick
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionStandardConfigDataLocationResolver
(DeferredLogFactory logFactory, Binder binder, ResourceLoader resourceLoader) Create a newStandardConfigDataLocationResolver
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
boolean
isResolvable
(ConfigDataLocationResolverContext context, ConfigDataLocation location) Returns if the specified location address can be resolved by this resolver.resolve
(ConfigDataLocationResolverContext context, ConfigDataLocation location) Resolve aConfigDataLocation
into one or moreConfigDataResource
instances.resolveProfileSpecific
(ConfigDataLocationResolverContext context, ConfigDataLocation location, Profiles profiles) Resolve aConfigDataLocation
into one or moreConfigDataResource
instances based on available profiles.
-
Constructor Details
-
StandardConfigDataLocationResolver
public StandardConfigDataLocationResolver(DeferredLogFactory logFactory, Binder binder, ResourceLoader resourceLoader) Create a newStandardConfigDataLocationResolver
instance.- Parameters:
logFactory
- the factory for loggers to usebinder
- a binder backed by the initialEnvironment
resourceLoader
- aResourceLoader
used to load resources
-
-
Method Details
-
getOrder
public int getOrder() -
isResolvable
Description copied from interface:ConfigDataLocationResolver
Returns if the specified location address can be resolved by this resolver.- Specified by:
isResolvable
in interfaceConfigDataLocationResolver<StandardConfigDataResource>
- Parameters:
context
- the location resolver contextlocation
- the location to check.- Returns:
- if the location is supported by this resolver
-
resolve
public List<StandardConfigDataResource> resolve(ConfigDataLocationResolverContext context, ConfigDataLocation location) throws ConfigDataNotFoundException Description copied from interface:ConfigDataLocationResolver
Resolve aConfigDataLocation
into one or moreConfigDataResource
instances.- Specified by:
resolve
in interfaceConfigDataLocationResolver<StandardConfigDataResource>
- Parameters:
context
- the location resolver contextlocation
- the location that should be resolved- Returns:
- a list of
resources
in ascending priority order. - Throws:
ConfigDataLocationNotFoundException
- on a non-optional location that cannot be foundConfigDataResourceNotFoundException
- if a resolved resource cannot be foundConfigDataNotFoundException
-
resolveProfileSpecific
public List<StandardConfigDataResource> resolveProfileSpecific(ConfigDataLocationResolverContext context, ConfigDataLocation location, Profiles profiles) Description copied from interface:ConfigDataLocationResolver
Resolve aConfigDataLocation
into one or moreConfigDataResource
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.- Specified by:
resolveProfileSpecific
in interfaceConfigDataLocationResolver<StandardConfigDataResource>
- Parameters:
context
- the location resolver contextlocation
- the location that should be resolvedprofiles
- profile information- Returns:
- a list of resolved locations in ascending priority order.
-