Class AnyNestedCondition
- java.lang.Object
- org.springframework.boot.autoconfigure.condition.SpringBootCondition
- org.springframework.boot.autoconfigure.condition.AnyNestedCondition
- All Implemented Interfaces:
org.springframework.context.annotation.Condition
,org.springframework.context.annotation.ConfigurationCondition
@Order(2147483627) public abstract class AnyNestedCondition extends SpringBootCondition
Condition
that will match when any nested class condition matches. Can be used to create composite conditions, for example:static class OnJndiOrProperty extends AnyNestedCondition { OnJndiOrProperty() { super(ConfigurationPhase.PARSE_CONFIGURATION); } @ConditionalOnJndi() static class OnJndi { } @ConditionalOnProperty("something") static class OnProperty { } }
The
ConfigurationPhase
should be specified according to the conditions that are defined. In the example above, all conditions are static and can be evaluated early soPARSE_CONFIGURATION
is a right fit.- Since:
- 1.2.0
Constructor Summary
Constructors Constructor Description AnyNestedCondition(org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase configurationPhase)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase
getConfigurationPhase()
protected ConditionOutcome
getFinalMatchOutcome(org.springframework.boot.autoconfigure.condition.AbstractNestedCondition.MemberMatchOutcomes memberOutcomes)
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.Methods inherited from class org.springframework.boot.autoconfigure.condition.SpringBootCondition
anyMatches, logOutcome, matches, matches
Constructor Detail
AnyNestedCondition
public AnyNestedCondition(org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase configurationPhase)
Method Detail
getFinalMatchOutcome
protected ConditionOutcome getFinalMatchOutcome(org.springframework.boot.autoconfigure.condition.AbstractNestedCondition.MemberMatchOutcomes memberOutcomes)
getConfigurationPhase
public org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase getConfigurationPhase()
- Specified by:
getConfigurationPhase
in interfaceorg.springframework.context.annotation.ConfigurationCondition
getMatchOutcome
public ConditionOutcome getMatchOutcome(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
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