类 ResourceCondition
- java.lang.Object
- org.springframework.boot.autoconfigure.condition.SpringBootCondition
- org.springframework.boot.autoconfigure.condition.ResourceCondition
- 所有已实现的接口:
org.springframework.context.annotation.Condition
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).- 从以下版本开始:
- 1.3.0
构造器概要
构造器 限定符 构造器 说明 protected
ResourceCondition(String name, String prefix, String propertyName, String... resourceLocations)
Create a new condition.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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()
从类继承的方法 org.springframework.boot.autoconfigure.condition.SpringBootCondition
anyMatches, logOutcome, matches, matches
构造器详细资料
ResourceCondition
protected ResourceCondition(String name, String prefix, String propertyName, String... resourceLocations)
Create a new condition.- 参数:
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 specified
方法详细资料
getMatchOutcome
public ConditionOutcome getMatchOutcome(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
从类复制的说明:SpringBootCondition
Determine the outcome of the match along with suitable log output.- 指定者:
getMatchOutcome
在类中SpringBootCondition
- 参数:
context
- the condition contextmetadata
- the annotation metadata- 返回:
- the condition outcome
getResourceOutcome
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.- 参数:
context
- the condition contextmetadata
- the annotation metadata- 返回:
- the condition outcome
startConditionMessage
protected final ConditionMessage.Builder startConditionMessage()