public abstract class AllNestedConditions extends SpringBootCondition
Condition
that will match when all nested class conditions match. Can be used
to create composite conditions, for example:
static class OnJndiAndProperty extends AllNestedConditions { OnJndiAndProperty() { 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.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractNestedCondition.MemberMatchOutcomes |
Constructor and Description |
---|
AllNestedConditions(org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase configurationPhase) |
Modifier and Type | Method and Description |
---|---|
org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase |
getConfigurationPhase() |
protected ConditionOutcome |
getFinalMatchOutcome(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.
|
anyMatches, logOutcome, matches, matches
public AllNestedConditions(org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase configurationPhase)
protected ConditionOutcome getFinalMatchOutcome(AbstractNestedCondition.MemberMatchOutcomes memberOutcomes)
public org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase getConfigurationPhase()
getConfigurationPhase
in interface org.springframework.context.annotation.ConfigurationCondition
public ConditionOutcome getMatchOutcome(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
SpringBootCondition
getMatchOutcome
in class SpringBootCondition
context
- the condition contextmetadata
- the annotation metadataCopyright © 2018 Pivotal Software, Inc.. All rights reserved.