Annotation Type ConditionalOnExpression
Constructs this bean only when a boolean expression over the configuration
is true. Evaluated once at start-up, like ConditionalOnProperty.
Spring evaluates SpEL here. This is the part of it a condition is written in, and nothing else -- no method calls, no bean references, no arithmetic:
${key}and${key:default}, replaced by the configuration value (an unset key with no default is the empty string);- literals:
true,false, and text in single quotes; ==and!=, comparing text exactly;!ornot,&&orand,||oror, and parentheses.
A bare value is true when it reads true, ignoring case, so
"${feature.enabled:false}" works on its own. Anything outside this subset
stops the server at start-up, naming the expression.
@ConditionalOnExpression("${billing.provider:none} == 'paddle' && !${billing.sandbox:false}")
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
-