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(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.
|
anyMatches, 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(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 metadataCopyright © 2016 Pivotal Software, Inc.. All rights reserved.