public class StandardConfigDataLocationResolver extends java.lang.Object implements ConfigDataLocationResolver<StandardConfigDataResource>, org.springframework.core.Ordered
ConfigDataLocationResolver
for standard locations.Constructor and Description |
---|
StandardConfigDataLocationResolver(org.apache.commons.logging.Log logger,
Binder binder,
org.springframework.core.io.ResourceLoader resourceLoader)
Create a new
StandardConfigDataLocationResolver instance. |
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
boolean |
isResolvable(ConfigDataLocationResolverContext context,
ConfigDataLocation location)
Returns if the specified location address can be resolved by this resolver.
|
java.util.List<StandardConfigDataResource> |
resolve(ConfigDataLocationResolverContext context,
ConfigDataLocation location)
Resolve a
ConfigDataLocation into one or more ConfigDataResource
instances. |
java.util.List<StandardConfigDataResource> |
resolveProfileSpecific(ConfigDataLocationResolverContext context,
ConfigDataLocation location,
Profiles profiles)
Resolve a
ConfigDataLocation into one or more ConfigDataResource
instances based on available profiles. |
public StandardConfigDataLocationResolver(org.apache.commons.logging.Log logger, Binder binder, org.springframework.core.io.ResourceLoader resourceLoader)
StandardConfigDataLocationResolver
instance.logger
- the logger to usebinder
- a binder backed by the initial Environment
resourceLoader
- a ResourceLoader
used to load resourcespublic int getOrder()
getOrder
in interface org.springframework.core.Ordered
public boolean isResolvable(ConfigDataLocationResolverContext context, ConfigDataLocation location)
ConfigDataLocationResolver
isResolvable
in interface ConfigDataLocationResolver<StandardConfigDataResource>
context
- the location resolver contextlocation
- the location to check.public java.util.List<StandardConfigDataResource> resolve(ConfigDataLocationResolverContext context, ConfigDataLocation location) throws ConfigDataNotFoundException
ConfigDataLocationResolver
ConfigDataLocation
into one or more ConfigDataResource
instances.resolve
in interface ConfigDataLocationResolver<StandardConfigDataResource>
context
- the location resolver contextlocation
- the location that should be resolvedresources
in ascending priority order.ConfigDataLocationNotFoundException
- on a non-optional location that cannot
be foundConfigDataResourceNotFoundException
- if a resolved resource cannot be foundConfigDataNotFoundException
public java.util.List<StandardConfigDataResource> resolveProfileSpecific(ConfigDataLocationResolverContext context, ConfigDataLocation location, Profiles profiles)
ConfigDataLocationResolver
ConfigDataLocation
into one or more ConfigDataResource
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.resolveProfileSpecific
in interface ConfigDataLocationResolver<StandardConfigDataResource>
context
- the location resolver contextlocation
- the location that should be resolvedprofiles
- profile information