org.mule.api.el
Interface ExpressionLanguage

All Known Implementing Classes:
MVELExpressionLanguage, MVELExpressionLanguageWrapper

public interface ExpressionLanguage

Allows for the execution of expressions within Mule using an expression language. Expression language implementations should not only wrap an expression language runtime but populate the context such that expression can be used to access, and optionally mutate, both Mule configuration and the current message being processed via expression variables. Runtime exceptions should be caught and wrapped in a Mule ExpressionRuntimeException before being re-thrown.

Since:
3.3.0

Method Summary
<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. 
 boolean isValid(String expression)
          Validates the expression returning true is the expression is valid, false otherwise..
 void validate(String expression)
          Validates the expression returning.
 

Method Detail

evaluate

<T> T evaluate(String expression)
Execute the expression returning the result. The expression will be executed by the expression language implementation without making any event or message context available.

Type Parameters:
T - the return type expected
Parameters:
expression - the expression to be executed
Returns:
the result of execution of the expression.

evaluate

<T> T evaluate(String expression,
               Map<String,Object> vars)
Execute the expression returning the result. The expression will be executed by the expression language implementation without making any event or message context available. A Map of variables can be provided that will be able to the expression when executed. Variable provided in the map will only be available if there are no conflicts with context variables provided by the expression language implementation.

Type Parameters:
T - the return type expected
Parameters:
expression - the expression to be executed
vars - a map of expression variables
Returns:
the result of execution of the expression.

evaluate

<T> T evaluate(String expression,
               MuleEvent event)
Execute the expression returning the result. The expression will be executed with MuleEvent context, meaning the expression language implementation should provided access to the message.

Type Parameters:
T - the return type expected
Parameters:
expression - the expression to be executed
event - the current event being processed
Returns:
the result of execution of the expression.

evaluate

<T> T evaluate(String expression,
               MuleEvent event,
               Map<String,Object> vars)
Execute the expression returning the result. The expression will be executed with MuleEvent context, meaning the expression language implementation should provided access to the message. A Map of variables can be provided that will be able to the expression when executed. Variable provided in the map will only be available if there are no conflict with context variables provided by the expression language implementation.

Type Parameters:
T - the return type expected
Parameters:
expression - the expression to be executed
event - the current event being processed
vars - a map of expression variables
Returns:
the result of execution of the expression.

isValid

boolean isValid(String expression)
Validates the expression returning true is the expression is valid, false otherwise.. All implementors should should validate expression syntactically. Semantic validation is optional.

Parameters:
expression -
Returns:

validate

void validate(String expression)
              throws InvalidExpressionException
Validates the expression returning. An ExpressionInvalidException will be thrown is the All implementors should should validate expression syntactically. Semantic validation is optional.

Parameters:
expression -
Throws:
InvalidExpressionException

evaluate

@Deprecated
<T> T evaluate(String expression,
                          MuleMessage message)
Deprecated. 

Required to provide gradual migration to use of MuleEvent signatures

See Also:
evaluate(String, MuleEvent)

evaluate

@Deprecated
<T> T evaluate(String expression,
                          MuleMessage message,
                          Map<String,Object> vars)
Deprecated. 

Required to provide gradual migration to use of MuleEvent signatures

See Also:
evaluate(String, MuleEvent)


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.