|
||||||||||
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 Collection<ExpressionLanguageExtension> |
expressionLanguageExtensions
|
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
|
protected boolean |
useGlobalConfiguration
|
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.mule.mvel2.ast.Function function)
|
|
void |
addImport(String name,
Class<?> clazz)
|
|
protected void |
configureParserConfiguration(org.mule.mvel2.ParserConfiguration parserConfiguration)
|
|
protected MVELExpressionLanguageContext |
createExpressionLanguageContext(Map<String,Object> vars)
|
|
protected org.mule.mvel2.integration.VariableResolverFactory |
createGlobalVariableResolverFactory(org.mule.mvel2.integration.VariableResolverFactory... parents)
|
|
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. |
|
|
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)
Deprecated. |
|
|
evaluate(String expression,
MuleMessage message,
Map<String,Object> vars)
Deprecated. |
|
protected
|
evaluateInternal(String expression,
MVELExpressionLanguageContext variableResolverFactory)
|
|
protected Map<String,String> |
getAliases()
|
|
protected Collection<ExpressionLanguageExtension> |
getExpressionLanguageExtensions()
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.mule.mvel2.ParserConfiguration parserConfiguration
protected MuleContext muleContext
protected MVELExpressionExecutor expressionExecutor
protected Collection<ExpressionLanguageExtension> expressionLanguageExtensions
protected org.mule.mvel2.integration.VariableResolverFactory staticContext
protected String globalFunctionsString
protected String globalFunctionsFile
protected Map<String,org.mule.mvel2.ast.Function> globalFunctions
protected Map<String,String> aliases
protected Map<String,Class<?>> imports
protected boolean autoResolveVariables
protected boolean useGlobalConfiguration
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 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 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
@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(Map<String,Object> vars)
protected org.mule.mvel2.ParserConfiguration createParserConfiguration()
protected void configureParserConfiguration(org.mule.mvel2.ParserConfiguration parserConfiguration)
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.mule.mvel2.ast.Function function)
public void addImport(String name, Class<?> clazz)
public void addAlias(String name, String expression)
public void setGlobalFunctionsFile(String globalFunctionsFile)
protected org.mule.mvel2.integration.VariableResolverFactory createGlobalVariableResolverFactory(org.mule.mvel2.integration.VariableResolverFactory... parents)
protected org.mule.mvel2.integration.VariableResolverFactory createVariableVariableResolverFactory(MuleEvent event)
@Deprecated protected org.mule.mvel2.integration.VariableResolverFactory createVariableVariableResolverFactory(MuleMessage message)
protected Collection<ExpressionLanguageExtension> getExpressionLanguageExtensions()
protected Map<String,String> getAliases()
protected Map<String,org.mule.mvel2.ast.Function> getGlobalFunctions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |