|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExpressionManager
Provides universal access for evaluating expressions embedded in Mule configurations, such as Xml, Java, scripting and annotations.
Users can register or unregisterExpressionEvaluator
through this interface.
Field Summary | |
---|---|
static String |
DEFAULT_EXPRESSION_POSTFIX
|
static String |
DEFAULT_EXPRESSION_PREFIX
|
Method Summary | |
---|---|
void |
clearEvaluators()
Clears all registered evaluators from the manager. |
Object |
evaluate(String expression,
MuleMessage message)
Evaluates the given expression. |
Object |
evaluate(String expression,
MuleMessage message,
boolean failIfNull)
Evaluates the given expression. |
Object |
evaluate(String expression,
String evaluator,
MuleMessage message,
boolean failIfNull)
Evaluates the given expression. |
boolean |
isEvaluatorRegistered(String name)
Checks whether an evaluator is registered with the manager |
boolean |
isValidExpression(String expression)
Determines if the expression is valid or not. |
String |
parse(String expression,
MuleMessage message)
Evaluates expressions in a given string. |
String |
parse(String expression,
MuleMessage message,
boolean failIfNull)
Evaluates expressions in a given string. |
void |
registerEvaluator(ExpressionEvaluator evaluator)
|
ExpressionEvaluator |
unregisterEvaluator(String name)
Removes the evaluator with the given name |
Field Detail |
---|
static final String DEFAULT_EXPRESSION_PREFIX
static final String DEFAULT_EXPRESSION_POSTFIX
Method Detail |
---|
void registerEvaluator(ExpressionEvaluator evaluator)
boolean isEvaluatorRegistered(String name)
name
- the name of the expression evaluator
ExpressionEvaluator unregisterEvaluator(String name)
name
- the name of the evaluator to remove
Object evaluate(String expression, MuleMessage message) throws ExpressionRuntimeException
parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate through all expressions in a string.
expression
- a single expression i.e. xpath://foomessage
- The current message being processed
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.Object evaluate(String expression, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate through all expressions in a string.
expression
- a single expression i.e. xpath://foomessage
- The current message being processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or returns
null. @return the result of the evaluation
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.Object evaluate(String expression, String evaluator, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate through all expressions in a string.
expression
- one or more expressions ebedded in a literal string i.e. "Value is #[xpath://foo] other value is #[header:foo]."evaluator
- the evaluator to use when executing the expressionmessage
- The current message bing processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or returns
null. @return the result of the evaluation
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.String parse(String expression, MuleMessage message) throws ExpressionRuntimeException
evaluate(String,org.mule.api.MuleMessage,boolean)
.
expression
- one or more expressions ebedded in a literal string i.e. "Value is #[xpath://foo] other value is #[header:foo]."message
- The current message being processed
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.String parse(String expression, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
evaluate(String,org.mule.api.MuleMessage,boolean)
.
expression
- one or more expressions ebedded in a literal string i.e. "Value is #[xpath://foo] other value is #[header:foo]."message
- The current message being processedfailIfNull
- determines if an exception should be thrown if expression could not be evaluated or returns
null. @return the result of the evaluation
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.void clearEvaluators()
boolean isValidExpression(String expression)
expression
- the expression to validate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |