Class NoneNestedConditions

  • All Implemented Interfaces:
    org.springframework.context.annotation.Condition, org.springframework.context.annotation.ConfigurationCondition

    public abstract class NoneNestedConditions
    extends AbstractNestedCondition
    Condition that will match when none of the nested class conditions match. Can be used to create composite conditions, for example:
     static class OnNeitherJndiNorProperty extends NoneOfNestedConditions {
    
        OnNeitherJndiNorProperty() {
            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.3.0