Package org.apache.camel
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 theinit(CamelContext)
method which allows to prepare the expressions such as wiring in resources, pre-parsing and what else.- See Also:
StaticExpression
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> T
evaluate(Exchange exchange, Class<T> type)
Returns the value of the expression on the given exchangedefault void
init(CamelContext context)
Initialize the expression with the given camel context
-
-
-
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 expressiontype
- 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
-
-