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(org.springframework.context.annotation.ConditionContext context,
org.springframework.core.type.AnnotatedTypeMetadata metadata)
Determine the outcome of the match along with suitable log output.
|
protected ConditionOutcome |
getResourceOutcome(org.springframework.context.annotation.ConditionContext context,
org.springframework.core.type.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(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
SpringBootCondition
getMatchOutcome
in class SpringBootCondition
context
- the condition contextmetadata
- the annotation metadataprotected ConditionOutcome getResourceOutcome(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
context
- the condition contextmetadata
- the annotation metadataprotected final ConditionMessage.Builder startConditionMessage()
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.