Interface Expression

  • All Known Subinterfaces:
    StaticExpression

    public interface Expression
    An expression provides a plugin strategy for evaluating expressions on a message exchange. An expression should be thread-safe and be able to evaluate concurrently by different threads with different exchanges. Any initialization logic should be done by the init(CamelContext) method which allows to prepare the expressions such as wiring in resources, pre-parsing and what else.
    See Also:
    StaticExpression
    • Method Detail

      • evaluate

        <T> T evaluate​(Exchange exchange,
                       Class<T> type)
        Returns the value of the expression on the given exchange
        Parameters:
        exchange - the message exchange on which to evaluate the expression
        type - the expected type of the evaluation result
        Returns:
        the value of the expression
      • init

        default void init​(CamelContext context)
        Initialize the expression with the given camel context
        Parameters:
        context - the camel context