public interface ExpressionManager
Users can register or unregister ExpressionEvaluator
through this interface.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EXPRESSION_POSTFIX |
static String |
DEFAULT_EXPRESSION_PREFIX |
Modifier and Type | Method and Description |
---|---|
void |
clearEnrichers()
Clears all registered enrichers from the manager.
|
void |
clearEvaluators()
Clears all registered evaluators from the manager.
|
void |
enrich(String expression,
MuleEvent message,
Object object) |
void |
enrich(String expression,
MuleMessage message,
Object object)
Deprecated.
|
void |
enrich(String expression,
String enricher,
MuleMessage message,
Object object)
Enriches the current message
|
void |
enrichTyped(String expression,
MuleMessage message,
TypedValue object)
Enriches the current message using a typed value
|
Object |
evaluate(String expression,
MuleEvent event) |
Object |
evaluate(String expression,
MuleEvent event,
boolean failIfNull) |
Object |
evaluate(String expression,
MuleMessage message)
Deprecated.
|
Object |
evaluate(String expression,
MuleMessage message,
boolean failIfNull)
Deprecated.
|
Object |
evaluate(String expression,
String evaluator,
MuleMessage message,
boolean failIfNull)
Evaluates the given expression.
|
boolean |
evaluateBoolean(String expression,
MuleEvent event) |
boolean |
evaluateBoolean(String expression,
MuleEvent event,
boolean nullReturnsTrue,
boolean nonBooleanReturnsTrue) |
boolean |
evaluateBoolean(String expression,
MuleMessage message)
Deprecated.
|
boolean |
evaluateBoolean(String expression,
MuleMessage message,
boolean nullReturnsTrue,
boolean nonBooleanReturnsTrue)
Deprecated.
|
boolean |
evaluateBoolean(String expression,
String evaluator,
MuleMessage message)
Evaluates the given expression resolving the result of the evaluation to a boolean.
|
boolean |
evaluateBoolean(String expression,
String evaluator,
MuleMessage message,
boolean nullReturnsTrue,
boolean nonBooleanReturnsTrue)
Evaluates the given expression resolving the result of the evaluation to a boolean.
|
TypedValue |
evaluateTyped(String expression,
MuleMessage message) |
TypedValue |
evaluateTyped(String expression,
String evaluator,
MuleMessage message,
boolean failIfNull)
Evaluates the given expression propagating dataType.
|
boolean |
isEnricherRegistered(String name)
Deprecated.
|
boolean |
isEvaluatorRegistered(String name)
Checks whether an evaluator is registered with the manager
|
boolean |
isExpression(String string)
Determines if the string is an expression.
|
boolean |
isValidExpression(String expression)
Determines if the expression is valid or not.
|
String |
parse(String expression,
MuleEvent event) |
String |
parse(String expression,
MuleEvent event,
boolean failIfNull) |
String |
parse(String expression,
MuleMessage message)
Deprecated.
|
String |
parse(String expression,
MuleMessage message,
boolean failIfNull)
Deprecated.
|
void |
registerEnricher(ExpressionEnricher enricher) |
void |
registerEvaluator(ExpressionEvaluator evaluator) |
ExpressionEnricher |
unregisterEnricher(String name)
Deprecated.
|
ExpressionEvaluator |
unregisterEvaluator(String name)
Removes the evaluator with the given name
|
void |
validateExpression(String expression)
Determines if the expression is valid or not.
|
static final String DEFAULT_EXPRESSION_PREFIX
static final String DEFAULT_EXPRESSION_POSTFIX
void registerEvaluator(ExpressionEvaluator evaluator)
boolean isEvaluatorRegistered(String name)
name
- the name of the expression evaluatorExpressionEvaluator unregisterEvaluator(String name)
name
- the name of the evaluator to removevoid registerEnricher(ExpressionEnricher enricher)
@Deprecated boolean isEnricherRegistered(String name)
name
- the name of the expression enricher@Deprecated ExpressionEnricher unregisterEnricher(String name)
name
- the name of the enricher to remove@Deprecated Object evaluate(String expression, MuleMessage message) throws ExpressionRuntimeException
parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate
through all expressions in a string.expression
- a single expression i.e. xpath://foomessage
- The current message being processedExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression
and 'failIfNull is set to true.Object evaluate(String expression, MuleEvent event) throws ExpressionRuntimeException
ExpressionRuntimeException
@Deprecated Object evaluate(String expression, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate
through all expressions in a string.expression
- a single expression i.e. xpath://foomessage
- The current message being processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or
returns null. @return the result of the evaluationExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression
and 'failIfNull is set to true.Object evaluate(String expression, MuleEvent event, boolean failIfNull) throws ExpressionRuntimeException
ExpressionRuntimeException
Object evaluate(String expression, String evaluator, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate
through all expressions in a string.expression
- one or more expressions embedded in a literal string i.e.
"Value is #[xpath://foo] other value is #[header:foo]."evaluator
- the evaluator to use when executing the expressionmessage
- The current message being processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or
returns null. @return the result of the evaluationExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression
and 'failIfNull is set to true.TypedValue evaluateTyped(String expression, String evaluator, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
The expression should be a single expression definition with or without
enclosing braces. i.e. "context:serviceName" and "#[context:serviceName]" are both valid. For
situations where one or more expressions need to be parsed within a single text, the
parse(String, org.mule.api.MuleMessage, boolean)
method should be used since it will iterate
through all expressions in a string.
expression
- one or more expressions embedded in a literal string i.e.
"Value is #[xpath://foo] other value is #[header:foo]."evaluator
- the evaluator to use when executing the expressionmessage
- The current message being processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or
returns null. @return the result of the evaluationExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression
and 'failIfNull is set to true.boolean evaluateBoolean(String expression, String evaluator, MuleMessage message) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barevaluator
- the evaluator to use when executing the expressionmessage
- The current message being processedExpressionRuntimeException
@Deprecated boolean evaluateBoolean(String expression, MuleMessage message) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barmessage
- The current message being processedExpressionRuntimeException
boolean evaluateBoolean(String expression, MuleEvent event) throws ExpressionRuntimeException
ExpressionRuntimeException
boolean evaluateBoolean(String expression, String evaluator, MuleMessage message, boolean nullReturnsTrue, boolean nonBooleanReturnsTrue) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barevaluator
- the evaluator to use when executing the expressionmessage
- The current message being processednullReturnsTrue
- determines if true should be returned if the result of the evaluation is nullnonBooleanReturnsTrue
- determines if true should returned if the result is not null but isn't
recognised as a booleanExpressionRuntimeException
@Deprecated boolean evaluateBoolean(String expression, MuleMessage message, boolean nullReturnsTrue, boolean nonBooleanReturnsTrue) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barmessage
- The current message being processednullReturnsTrue
- determines if true should be returned if the result of the evaluation is nullnonBooleanReturnsTrue
- determines if true should returned if the result is not null but isn't
recognised as a booleanExpressionRuntimeException
boolean evaluateBoolean(String expression, MuleEvent event, boolean nullReturnsTrue, boolean nonBooleanReturnsTrue) throws ExpressionRuntimeException
ExpressionRuntimeException
@Deprecated void enrich(String expression, MuleMessage message, Object object)
expression
- a single expression i.e. header://foo that defines how the message should be enrichedmessage
- The current message being processed that will be enrichedobject
- The object that will be used to enrich the messagevoid enrichTyped(String expression, MuleMessage message, TypedValue object)
expression
- a single expression i.e. header://foo that defines how the message should be enrichedmessage
- The current message being processed that will be enrichedobject
- The typed value that will be used to enrich the messagevoid enrich(String expression, String enricher, MuleMessage message, Object object)
expression
- a single expression i.e. header://foo that defines how the message shoud be enrichedenricher
- the enricher to use when executing the expressionmessage
- The current message being processed that will be enrichedobject
- The object that will be used to enrich the message@Deprecated String parse(String expression, MuleMessage message) throws ExpressionRuntimeException
evaluate(String,org.mule.api.MuleMessage,boolean)
.expression
- one or more expressions ebedded in a literal string i.e.
"Value is #[xpath://foo] other value is #[header:foo]."message
- The current message being processedExpressionRuntimeException
- if the expression is invalid, or a null is
found for the expression and 'failIfNull is set to true.String parse(String expression, MuleEvent event) throws ExpressionRuntimeException
ExpressionRuntimeException
@Deprecated String parse(String expression, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
evaluate(String,org.mule.api.MuleMessage,boolean)
.expression
- one or more expressions ebedded in a literal string i.e.
"Value is #[xpath://foo] other value is #[header:foo]."message
- The current message being processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or
returns null. @return the result of the evaluationExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression
and 'failIfNull is set to true.String parse(String expression, MuleEvent event, boolean failIfNull) throws ExpressionRuntimeException
ExpressionRuntimeException
void clearEvaluators()
void clearEnrichers()
boolean isValidExpression(String expression)
expression
- the expression to validatevoid validateExpression(String expression) throws InvalidExpressionException
expression
- the expression to validateInvalidExpressionException
- if the expression is invalid, including information about the
position and faultboolean isExpression(String string)
string
- is this string an expression stringTypedValue evaluateTyped(String expression, MuleMessage message)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.