Class ResourceCondition
java.lang.Object
org.springframework.boot.autoconfigure.condition.SpringBootCondition
org.springframework.boot.autoconfigure.condition.ResourceCondition
- All Implemented Interfaces:
Condition
- Direct Known Subclasses:
HazelcastConfigResourceCondition
SpringBootCondition
used to check if a resource can be found using a
configurable property and optional default location(s).- Since:
- 1.3.0
- Author:
- Stephane Nicoll, Phillip Webb, Madhura Bhave
-
Constructor Summary
ModifierConstructorDescriptionprotected
ResourceCondition
(String name, String property, String... resourceLocations) Create a new condition. -
Method Summary
Modifier and TypeMethodDescriptiongetMatchOutcome
(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 final ConditionMessage.Builder
Methods inherited from class org.springframework.boot.autoconfigure.condition.SpringBootCondition
anyMatches, logOutcome, matches, matches
-
Constructor Details
-
ResourceCondition
Create a new condition.- Parameters:
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 specified- Since:
- 2.0.0
-
-
Method Details
-
getMatchOutcome
Description copied from class:SpringBootCondition
Determine the outcome of the match along with suitable log output.- Specified by:
getMatchOutcome
in classSpringBootCondition
- Parameters:
context
- the condition contextmetadata
- the annotation metadata- Returns:
- the condition outcome
-
getResourceOutcome
protected ConditionOutcome getResourceOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) Check if one of the default resource locations actually exists.- Parameters:
context
- the condition contextmetadata
- the annotation metadata- Returns:
- the condition outcome
-
startConditionMessage
-