_expression_Page edited by Claus IbsenChanges (4)
Full ContentExpressionsExpressions and Predicates can then be used to create the various Enterprise Integration Patterns in the DSL or Xml Configuration like the Recipient List. APIIf you are outside of the DSL and want to create your own expressions you can either implement the _expression_ interface, reuse one of the other builders or try the ExpressionBuilder class. _expression_The API for a Camel _expression_ is defined in the org.apache.camel._expression_ interface as shown: public interface _expression_ { /** * Returns the value of the _expression_ on the given exchange * * @param exchange the message exchange on which to evaluate the _expression_ * @param type the expected type of the evaluation result * @return the value of the _expression_ */ <T> T evaluate(Exchange exchange, Class<T> type); } PredicateThe API for a Camel Predicate is defined in the org.apache.camel.Predicate interface as shown: public interface Predicate { /** * Evaluates the predicate on the message exchange and returns true if this * exchange matches the predicate * * @param exchange the message exchange * @return true if the predicate matches */ boolean matches(Exchange exchange); } _expression_ LanguagesThe following languages are supported out of the box
Most of these languages is also supported used as Annotation Based _expression_ Language. Using Expressions in your IDETo use different _expression_ and predicates in your IDE you need to perform a static import of the builder class for the language(s) you wish to use.
See Also
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|