Interface StaticExpression

All Superinterfaces:
Expression

public interface StaticExpression extends Expression
Marker for an Expression whose value is a compile-time or configuration-time constant.

A static expression always evaluates to the same result regardless of the Exchange, so the framework can optimize it: it is evaluated once, the result is cached, and no per-exchange evaluation overhead is incurred. Implementations must expose the constant through getValue() and allow it to be overwritten via setValue(Object) (for example, when a property placeholder is resolved at startup).

Since:
3.7
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Object
    Gets the constant value
    void
    setValue(@Nullable Object value)
    Sets the constant value

    Methods inherited from interface Expression

    evaluate, init
  • Method Details

    • getValue

      @Nullable Object getValue()
      Gets the constant value
    • setValue

      void setValue(@Nullable Object value)
      Sets the constant value