Annotation Interface ConditionalOnAllProperties


Indicates that a component or configuration should only be activated if all specified properties in the application environment meet their respective conditions. This annotation can be applied to classes and methods to conditionally define components or configurations based on multiple property-based rules. Each rule is defined using an array of PropertyCondition. The evaluation process follows these rules for each PropertyCondition: - If a property with the specified name exists: - The condition is met if the actual value matches the expected value defined in PropertyCondition.havingValue(). - If a property does not exist: - The condition is determined by the PropertyCondition.matchIfMissing() attribute. All specified property conditions must match for the annotation to satisfy the condition and activate the associated component or configuration. If any condition fails, the activation is prevented. This annotation supports being declared multiple times on the same element. When applied multiple times, all instances must meet their respective conditions to activate the associated component or configuration. This annotation uses OnAllPropertiesCondition as its underlying implementation to evaluate property conditions. It also makes use of ConditionalOnAllPropertiesContainer to enable repeatable functionality.
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Specifies the property conditions that must be met for the associated component or configuration to be activated.
  • Element Details

    • value

      Specifies the property conditions that must be met for the associated component or configuration to be activated. Each condition is represented by a PropertyCondition, which defines the name of the property, the expected value, and whether the condition matches if the property is missing. All specified PropertyConditions must be satisfied for the annotation to be considered a match.
      Returns:
      an array of PropertyCondition that specifies the required property conditions