Class AnyNestedCondition
java.lang.Object
org.springframework.boot.autoconfigure.condition.SpringBootCondition
org.springframework.boot.autoconfigure.condition.AbstractNestedCondition
org.springframework.boot.autoconfigure.condition.AnyNestedCondition
- All Implemented Interfaces:
org.springframework.context.annotation.Condition, org.springframework.context.annotation.ConfigurationCondition
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 so
PARSE_CONFIGURATION is a right fit.
- Since:
- 1.2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractNestedCondition
AbstractNestedCondition.MemberMatchOutcomesNested classes/interfaces inherited from interface org.springframework.context.annotation.ConfigurationCondition
org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase -
Constructor Summary
ConstructorsConstructorDescriptionAnyNestedCondition(org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase configurationPhase) -
Method Summary
Modifier and TypeMethodDescriptionprotected ConditionOutcomegetFinalMatchOutcome(AbstractNestedCondition.MemberMatchOutcomes memberOutcomes) Methods inherited from class AbstractNestedCondition
getConfigurationPhase, getMatchOutcomeMethods inherited from class SpringBootCondition
anyMatches, logOutcome, matches, matchesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.annotation.Condition
matches
-
Constructor Details
-
AnyNestedCondition
public AnyNestedCondition(org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase configurationPhase)
-
-
Method Details
-
getFinalMatchOutcome
protected ConditionOutcome getFinalMatchOutcome(AbstractNestedCondition.MemberMatchOutcomes memberOutcomes) - Specified by:
getFinalMatchOutcomein classAbstractNestedCondition
-