public class MVELExpressionLanguage extends Object implements ExpressionLanguage, Initialisable
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
aliases |
protected boolean |
autoResolveVariables |
protected MVELExpressionExecutor |
expressionExecutor |
protected org.mule.mvel2.integration.VariableResolverFactory |
globalContext |
protected Map<String,org.mule.mvel2.ast.Function> |
globalFunctions |
protected String |
globalFunctionsFile |
protected String |
globalFunctionsString |
protected Map<String,Class<?>> |
imports |
protected MuleContext |
muleContext |
protected org.mule.mvel2.ParserConfiguration |
parserConfiguration |
protected org.mule.mvel2.integration.VariableResolverFactory |
staticContext |
PHASE_NAME
Constructor and Description |
---|
MVELExpressionLanguage(MuleContext muleContext) |
Modifier and Type | Method and Description |
---|---|
void |
addAlias(String name,
String expression) |
void |
addGlobalFunction(String name,
org.mule.mvel2.ast.Function function) |
void |
addImport(String name,
Class<?> clazz) |
protected void |
configureParserConfiguration(org.mule.mvel2.ParserConfiguration parserConfiguration) |
protected MVELExpressionLanguageContext |
createExpressionLanguageContext() |
protected org.mule.mvel2.ParserConfiguration |
createParserConfiguration() |
protected void |
createStaticContext() |
protected org.mule.mvel2.integration.VariableResolverFactory |
createVariableVariableResolverFactory(MuleEvent event) |
protected org.mule.mvel2.integration.VariableResolverFactory |
createVariableVariableResolverFactory(MuleMessage message)
Deprecated.
|
<T> T |
evaluate(String expression)
Execute the expression returning the result.
|
<T> T |
evaluate(String expression,
Map<String,Object> vars)
Execute the expression returning the result.
|
<T> T |
evaluate(String expression,
MuleEvent event)
Execute the expression returning the result.
|
<T> T |
evaluate(String expression,
MuleEvent event,
Map<String,Object> vars)
Execute the expression returning the result.
|
<T> T |
evaluate(String expression,
MuleMessage message)
Deprecated.
|
<T> T |
evaluate(String expression,
MuleMessage message,
Map<String,Object> vars)
Deprecated.
|
protected <T> T |
evaluateInternal(String expression,
MVELExpressionLanguageContext variableResolverFactory) |
protected Map<String,String> |
getAliases() |
protected Map<String,org.mule.mvel2.ast.Function> |
getGlobalFunctions() |
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isValid(String expression)
Validates the expression returning true is the expression is valid, false otherwise..
|
protected void |
loadGlobalFunctions() |
void |
setAliases(Map<String,String> aliases) |
void |
setAutoResolveVariables(boolean autoResolveVariables) |
void |
setGlobalFunctionsFile(String globalFunctionsFile) |
void |
setGlobalFunctionsString(String globalFunctionsString) |
void |
setImports(Map<String,Class<?>> imports) |
void |
validate(String expression)
Validates the expression returning.
|
protected org.mule.mvel2.ParserConfiguration parserConfiguration
protected MuleContext muleContext
protected MVELExpressionExecutor expressionExecutor
protected org.mule.mvel2.integration.VariableResolverFactory staticContext
protected org.mule.mvel2.integration.VariableResolverFactory globalContext
protected String globalFunctionsString
protected String globalFunctionsFile
protected boolean autoResolveVariables
public MVELExpressionLanguage(MuleContext muleContext)
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered fromprotected void createStaticContext()
protected void loadGlobalFunctions() throws InitialisationException
InitialisationException
public <T> T evaluate(String expression)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
T
- the return type expectedexpression
- the expression to be executedpublic <T> T evaluate(String expression, Map<String,Object> vars)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
T
- the return type expectedexpression
- the expression to be executedvars
- a map of expression variablespublic <T> T evaluate(String expression, MuleEvent event)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
T
- the return type expectedexpression
- the expression to be executedevent
- the current event being processedpublic <T> T evaluate(String expression, MuleEvent event, Map<String,Object> vars)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
T
- the return type expectedexpression
- the expression to be executedevent
- the current event being processedvars
- a map of expression variables@Deprecated public <T> T evaluate(String expression, MuleMessage message)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
ExpressionLanguage.evaluate(String, MuleEvent)
@Deprecated public <T> T evaluate(String expression, MuleMessage message, Map<String,Object> vars)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
ExpressionLanguage.evaluate(String, MuleEvent)
protected <T> T evaluateInternal(String expression, MVELExpressionLanguageContext variableResolverFactory)
public boolean isValid(String expression)
ExpressionLanguage
isValid
in interface ExpressionLanguage
public void validate(String expression) throws InvalidExpressionException
ExpressionLanguage
ExpressionInvalidException
will be thrown is the All
implementors should should validate expression syntactically. Semantic validation is optional.validate
in interface ExpressionLanguage
InvalidExpressionException
protected MVELExpressionLanguageContext createExpressionLanguageContext()
protected org.mule.mvel2.ParserConfiguration createParserConfiguration()
protected void configureParserConfiguration(org.mule.mvel2.ParserConfiguration parserConfiguration)
public void setGlobalFunctionsString(String globalFunctionsString)
public void setAutoResolveVariables(boolean autoResolveVariables)
public void addGlobalFunction(String name, org.mule.mvel2.ast.Function function)
public void setGlobalFunctionsFile(String globalFunctionsFile)
protected org.mule.mvel2.integration.VariableResolverFactory createVariableVariableResolverFactory(MuleEvent event)
@Deprecated protected org.mule.mvel2.integration.VariableResolverFactory createVariableVariableResolverFactory(MuleMessage message)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.