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 prefix,
String propertyName,
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 prefix, String propertyName, String... resourceLocations)
name
- the name of the componentprefix
- the prefix of the configuration keypropertyName
- the name of the configuration keyresourceLocations
- 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 © 2018 Pivotal Software, Inc.. All rights reserved.