public class MunitExpressionWrapper extends Object
Provides a friendly API for the ExtendedExpressionManager
| Constructor and Description |
|---|
MunitExpressionWrapper(org.mule.runtime.core.api.el.ExpressionManager expressionManager) |
| Modifier and Type | Method and Description |
|---|---|
org.mule.runtime.api.metadata.TypedValue |
evaluate(org.mule.runtime.api.event.Event muleEvent,
Object source) |
org.mule.runtime.api.metadata.TypedValue |
evaluate(Object source) |
String |
evaluateAsStringIfExpression(org.mule.runtime.api.event.Event event,
Object expression)
Tries to evaluate the given expression and cast it to String, if a java.lang.ClassCastException is thrown it throws a
MunitError
|
String |
evaluateAsStringIfExpression(org.mule.runtime.api.event.Event event,
Object expression,
String name)
Tries to evaluate the given expression and cast it to String, if a java.lang.ClassCastException is thrown it throws a
MunitError
|
org.mule.runtime.api.metadata.TypedValue |
evaluateIfExpression(org.mule.runtime.api.event.Event event,
Object source)
It will try to evaluate the source sent, if it's a string and a valid expression.
|
String |
evaluateNotNullString(org.mule.runtime.api.event.Event event,
Object expression,
String name)
Tries to evaluate the given expression and cast it to String, if a java.lang.ClassCastException is thrown or the expression
evaluates to null it throws a MunitError
|
org.mule.runtime.core.api.el.ExpressionManager |
getExpressionManager() |
boolean |
isExpression(Object source) |
boolean |
isExpressionValid(Object source) |
void |
validate(Object expression) |
public MunitExpressionWrapper(org.mule.runtime.core.api.el.ExpressionManager expressionManager)
public org.mule.runtime.core.api.el.ExpressionManager getExpressionManager()
public org.mule.runtime.api.metadata.TypedValue evaluateIfExpression(org.mule.runtime.api.event.Event event,
Object source)
event - the event over to which evaluatesource - the variable containing the posible expressionpublic org.mule.runtime.api.metadata.TypedValue evaluate(org.mule.runtime.api.event.Event muleEvent,
Object source)
public org.mule.runtime.api.metadata.TypedValue evaluate(Object source)
public boolean isExpression(Object source)
public boolean isExpressionValid(Object source)
public void validate(Object expression)
public String evaluateNotNullString(org.mule.runtime.api.event.Event event, Object expression, String name)
event - the event over to which evaluateexpression - the expression to be evaluatedname - the name of the variable to be evaluatedpublic String evaluateAsStringIfExpression(org.mule.runtime.api.event.Event event, Object expression)
event - the event over to which evaluateexpression - the expression to be evaluatedpublic String evaluateAsStringIfExpression(org.mule.runtime.api.event.Event event, Object expression, String name)
event - the event over to which evaluateexpression - the expression to be evaluatedname - the name of the variable to be evaluatedCopyright © 2020. All rights reserved.