批注接口 ConditionalOnExpression


@Retention(RUNTIME) @Target({TYPE,METHOD}) @Documented @Conditional(org.springframework.boot.autoconfigure.condition.OnExpressionCondition.class) public @interface ConditionalOnExpression
Configuration annotation for a conditional element that depends on the value of a SpEL expression.

Referencing a bean in the expression will cause that bean to be initialized very early in context refresh processing. As a result, the bean won't be eligible for post-processing (such as configuration properties binding) and its state may be incomplete.

从以下版本开始:
1.0.0
作者:
Dave Syer
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    The SpEL expression to evaluate.
  • 元素详细资料

    • value

      String value
      The SpEL expression to evaluate. Expression should return true if the condition passes or false if it fails.
      返回:
      the SpEL expression
      默认值:
      "true"