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, Sijun Yang
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionStandardConfigDataLocationResolver(DeferredLogFactory logFactory, Binder binder, ResourceLoader resourceLoader) Create a newStandardConfigDataLocationResolverinstance. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()booleanisResolvable(ConfigDataLocationResolverContext context, ConfigDataLocation location) Returns if the specified location address can be resolved by this resolver.resolve(ConfigDataLocationResolverContext context, ConfigDataLocation location) Resolve aConfigDataLocationinto one or moreConfigDataResourceinstances.resolveProfileSpecific(ConfigDataLocationResolverContext context, ConfigDataLocation location, Profiles profiles) Resolve aConfigDataLocationinto one or moreConfigDataResourceinstances based on available profiles.
-
Constructor Details
-
StandardConfigDataLocationResolver
public StandardConfigDataLocationResolver(DeferredLogFactory logFactory, Binder binder, ResourceLoader resourceLoader) Create a newStandardConfigDataLocationResolverinstance.- Parameters:
logFactory- the factory for loggers to usebinder- a binder backed by the initialEnvironmentresourceLoader- aResourceLoaderused to load resources
-
-
Method Details
-
getOrder
public int getOrder() -
isResolvable
Description copied from interface:ConfigDataLocationResolverReturns if the specified location address can be resolved by this resolver.- Specified by:
isResolvablein 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:ConfigDataLocationResolverResolve aConfigDataLocationinto one or moreConfigDataResourceinstances.- Specified by:
resolvein interfaceConfigDataLocationResolver<StandardConfigDataResource>- Parameters:
context- the location resolver contextlocation- the location that should be resolved- Returns:
- a list of
resourcesin 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:ConfigDataLocationResolverResolve aConfigDataLocationinto one or moreConfigDataResourceinstances 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:
resolveProfileSpecificin 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.
-