Class ParameterManagerConfigDataLocationResolverLoader
java.lang.Object
com.google.cloud.spring.autoconfigure.parametermanager.ParameterManagerConfigDataLocationResolverLoader
- All Implemented Interfaces:
org.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.boot.context.config.ConfigDataResource>
public class ParameterManagerConfigDataLocationResolverLoader
extends Object
implements org.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.boot.context.config.ConfigDataResource>
A safe delegating ConfigDataLocationResolver that loads ParameterManagerConfigDataLocationResolver
only if Parameter Manager dependency is present on the classpath.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isResolvable
(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) Checks if the property can be resolved by the Parameter Manager resolver.List<org.springframework.boot.context.config.ConfigDataResource>
resolve
(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.boot.context.config.ConfigDataLocationResolver
resolveProfileSpecific
-
Constructor Details
-
ParameterManagerConfigDataLocationResolverLoader
public ParameterManagerConfigDataLocationResolverLoader()
-
-
Method Details
-
isResolvable
public boolean isResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) Checks if the property can be resolved by the Parameter Manager resolver. For the check, we rely on the presence of the ParameterManagerSyntaxUtils class, which is an optional dependency. Since optional dependencies may not be present at runtime, we explicitly check for its existence before resolving the property. If it's not present, it means this config resolver is not meant to be used.- Specified by:
isResolvable
in interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.boot.context.config.ConfigDataResource>
- Returns:
- true if the delegate resolver is initialized and the location has the expected
Parameter Manager prefix (e.g.,
pm@
); false otherwise.
-
resolve
public List<org.springframework.boot.context.config.ConfigDataResource> resolve(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) - Specified by:
resolve
in interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.boot.context.config.ConfigDataResource>
-