|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.el.mvel.MVELExpressionLanguage
public class MVELExpressionLanguage
Expression language that uses MVEL (http://mvel.codehaus.org/).
Field Summary | |
---|---|
protected Map<String,String> |
aliases
|
protected boolean |
autoResolveVariables
|
protected MVELExpressionExecutor |
expressionExecutor
|
protected Map<String,org.mvel2.ast.Function> |
globalFunctions
|
protected String |
globalFunctionsFile
|
protected String |
globalFunctionsString
|
protected Map<String,Class<?>> |
imports
|
protected MuleContext |
muleContext
|
protected org.mvel2.ParserContext |
parserContext
|
protected MVELExpressionLanguageContext |
staticContext
|
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
MVELExpressionLanguage(MuleContext muleContext)
|
Method Summary | ||
---|---|---|
void |
addAlias(String name,
String expression)
|
|
void |
addGlobalFunction(String name,
org.mvel2.ast.Function function)
|
|
void |
addImport(String name,
Class<?> clazz)
|
|
protected void |
configureParserContext(org.mvel2.ParserContext parserContext)
|
|
protected MVELExpressionLanguageContext |
createExpressionLanguageContext()
|
|
protected org.mvel2.ParserContext |
createParserContext()
|
|
|
evaluate(String expression)
Execute the expression returning the result. |
|
|
evaluate(String expression,
Map<String,Object> vars)
Execute the expression returning the result. |
|
|
evaluate(String expression,
MuleEvent event)
Execute the expression returning the result. |
|
|
evaluate(String expression,
MuleEvent event,
Map<String,Object> vars)
Execute the expression returning the result. |
|
|
evaluate(String expression,
MuleMessage message)
Required to provide gradual migration to use of MuleEvent signatures |
|
|
evaluate(String expression,
MuleMessage message,
Map<String,Object> vars)
Required to provide gradual migration to use of MuleEvent signatures |
|
protected
|
evaluateInternal(String expression,
MVELExpressionLanguageContext variableResolverFactory)
|
|
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.. |
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.mvel2.ParserContext parserContext
protected MuleContext muleContext
protected MVELExpressionExecutor expressionExecutor
protected MVELExpressionLanguageContext staticContext
protected String globalFunctionsString
protected String globalFunctionsFile
protected Map<String,org.mvel2.ast.Function> globalFunctions
protected Map<String,String> aliases
protected Map<String,Class<?>> imports
protected boolean autoResolveVariables
Constructor Detail |
---|
public MVELExpressionLanguage(MuleContext muleContext)
Method Detail |
---|
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 shutdown
RecoverableException
- if an error occurs that can be recovered frompublic <T> T evaluate(String expression)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
T
- the return type expectedexpression
- the expression to be executed
public <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 variables
public <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 processed
public <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
public <T> T evaluate(String expression, MuleMessage message)
ExpressionLanguage
evaluate
in interface ExpressionLanguage
ExpressionLanguage.evaluate(String, MuleEvent)
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.mvel2.ParserContext createParserContext()
protected void configureParserContext(org.mvel2.ParserContext parserContext)
public void setGlobalFunctionsString(String globalFunctionsString)
public void setAliases(Map<String,String> aliases)
public void setImports(Map<String,Class<?>> imports)
public void setAutoResolveVariables(boolean autoResolveVariables)
public void addGlobalFunction(String name, org.mvel2.ast.Function function)
public void addImport(String name, Class<?> clazz)
public void addAlias(String name, String expression)
public void setGlobalFunctionsFile(String globalFunctionsFile)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |