Package com.helixframework.conditional
Annotation Interface ConditionalOnAllProperties
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Repeatable(ConditionalOnAllPropertiesContainer.class)
@Conditional(OnAllPropertiesCondition.class)
public @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.-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionSpecifies the property conditions that must be met for the associated component or configuration to be activated.
-
Element Details
-
value
PropertyCondition[] valueSpecifies the property conditions that must be met for the associated component or configuration to be activated. Each condition is represented by aPropertyCondition, which defines the name of the property, the expected value, and whether the condition matches if the property is missing. All specifiedPropertyConditions must be satisfied for the annotation to be considered a match.- Returns:
- an array of
PropertyConditionthat specifies the required property conditions
-