public abstract class ResourceCondition extends SpringBootCondition
SpringBootCondition
used to check if a resource can be found using a
configurable property and optional default location(s).Modifier | Constructor and Description |
---|---|
protected |
ResourceCondition(String name,
String property,
String... resourceLocations)
Create a new condition.
|
Modifier and Type | Method and Description |
---|---|
ConditionOutcome |
getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata)
Determine the outcome of the match along with suitable log output.
|
protected ConditionOutcome |
getResourceOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata)
Check if one of the default resource locations actually exists.
|
protected ConditionMessage.Builder |
startConditionMessage() |
anyMatches, logOutcome, matches, matches
protected ResourceCondition(String name, String property, String... resourceLocations)
name
- the name of the componentproperty
- the configuration propertyresourceLocations
- default location(s) where the configuration file can be
found if the configuration key is not specifiedpublic ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata)
SpringBootCondition
getMatchOutcome
in class SpringBootCondition
context
- the condition contextmetadata
- the annotation metadataprotected ConditionOutcome getResourceOutcome(ConditionContext context, AnnotatedTypeMetadata metadata)
context
- the condition contextmetadata
- the annotation metadataprotected final ConditionMessage.Builder startConditionMessage()
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.