@Metadata(label="language",
title="Expression")
public class ExpressionDefinition
extends Object
implements Expression, Predicate, OtherAttributesAware
| Constructor and Description |
|---|
ExpressionDefinition() |
ExpressionDefinition(Expression expression) |
ExpressionDefinition(Predicate predicate) |
ExpressionDefinition(String expression) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertMatches(String text,
Exchange exchange) |
protected void |
configureExpression(CamelContext camelContext,
Expression expression) |
protected void |
configurePredicate(CamelContext camelContext,
Predicate predicate) |
Expression |
createExpression(CamelContext camelContext) |
Expression |
createExpression(RouteContext routeContext) |
Predicate |
createPredicate(CamelContext camelContext) |
Predicate |
createPredicate(RouteContext routeContext) |
Object |
evaluate(Exchange exchange) |
<T> T |
evaluate(Exchange exchange,
Class<T> type)
Returns the value of the expression on the given exchange
|
String |
getExpression() |
ExpressionDefinition |
getExpressionType() |
Expression |
getExpressionValue() |
String |
getId() |
String |
getLabel()
Returns some descriptive text to describe this node
|
static String |
getLabel(List<ExpressionDefinition> expressions) |
String |
getLanguage() |
Map<QName,Object> |
getOtherAttributes()
Adds optional attribute to use as property placeholder
|
Predicate |
getPredicate() |
Boolean |
getTrim() |
boolean |
matches(Exchange exchange)
Evaluates the predicate on the message exchange and returns true if this
exchange matches the predicate
|
void |
setExpression(String expression)
The expression value in your chosen language syntax
|
protected void |
setExpressionType(ExpressionDefinition expressionType)
Allows derived classes to set a lazily created expressionType instance
such as if using the
ExpressionClause |
protected void |
setExpressionValue(Expression expressionValue) |
void |
setId(String value)
Sets the id of this node
|
void |
setOtherAttributes(Map<QName,Object> otherAttributes)
Adds optional attribute to use as property placeholder
|
protected void |
setProperty(Object bean,
String name,
Object value)
Sets a named property on the object instance using introspection
|
void |
setTrim(Boolean trim)
Whether to trim the value to remove leading and trailing whitespaces and line breaks
|
String |
toString() |
public ExpressionDefinition()
public ExpressionDefinition(String expression)
public ExpressionDefinition(Predicate predicate)
public ExpressionDefinition(Expression expression)
public static String getLabel(List<ExpressionDefinition> expressions)
public <T> T evaluate(Exchange exchange, Class<T> type)
Expressionevaluate in interface Expressionexchange - the message exchange on which to evaluate the expressiontype - the expected type of the evaluation resultpublic void assertMatches(String text, Exchange exchange) throws AssertionError
AssertionErrorpublic boolean matches(Exchange exchange)
Predicatepublic String getLanguage()
public final Predicate createPredicate(RouteContext routeContext)
public Predicate createPredicate(CamelContext camelContext)
public final Expression createExpression(RouteContext routeContext)
public Expression createExpression(CamelContext camelContext)
public String getExpression()
public void setExpression(String expression)
public Predicate getPredicate()
public Expression getExpressionValue()
protected void setExpressionValue(Expression expressionValue)
public ExpressionDefinition getExpressionType()
public void setTrim(Boolean trim)
public Map<QName,Object> getOtherAttributes()
OtherAttributesAwaregetOtherAttributes in interface OtherAttributesAwarepublic void setOtherAttributes(Map<QName,Object> otherAttributes)
OtherAttributesAwaresetOtherAttributes in interface OtherAttributesAwareprotected void setExpressionType(ExpressionDefinition expressionType)
ExpressionClauseprotected void configurePredicate(CamelContext camelContext, Predicate predicate)
protected void configureExpression(CamelContext camelContext, Expression expression)
protected void setProperty(Object bean, String name, Object value)
Apache Camel