|
||||||||||
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 java.lang.String |
DEFAULT_EXPRESSION_POSTFIX
|
static java.lang.String |
DEFAULT_EXPRESSION_PREFIX
|
Method Summary | |
---|---|
void |
clearEvaluators()
Clears all registered evaluators from the manager. |
java.lang.Object |
evaluate(java.lang.String expression,
MuleMessage message)
Evaluates the given expression. |
java.lang.Object |
evaluate(java.lang.String expression,
MuleMessage message,
boolean failIfNull)
Evaluates the given expression. |
java.lang.Object |
evaluate(java.lang.String expression,
java.lang.String evaluator,
MuleMessage message,
boolean failIfNull)
Evaluates the given expression. |
boolean |
isEvaluatorRegistered(java.lang.String name)
Checks whether an evaluator is registered with the manager |
boolean |
isExpression(java.lang.String string)
Determines if the string is an expression. |
boolean |
isValidExpression(java.lang.String expression)
Determines if the expression is valid or not. |
java.lang.String |
parse(java.lang.String expression,
MuleMessage message)
Evaluates expressions in a given string. |
java.lang.String |
parse(java.lang.String expression,
MuleMessage message,
boolean failIfNull)
Evaluates expressions in a given string. |
void |
registerEvaluator(ExpressionEvaluator evaluator)
|
ExpressionEvaluator |
unregisterEvaluator(java.lang.String name)
Removes the evaluator with the given name |
void |
validateExpression(java.lang.String expression)
Determines if the expression is valid or not. |
Field Detail |
---|
static final java.lang.String DEFAULT_EXPRESSION_PREFIX
static final java.lang.String DEFAULT_EXPRESSION_POSTFIX
Method Detail |
---|
void registerEvaluator(ExpressionEvaluator evaluator)
boolean isEvaluatorRegistered(java.lang.String name)
name
- the name of the expression evaluator
ExpressionEvaluator unregisterEvaluator(java.lang.String name)
name
- the name of the evaluator to remove
java.lang.Object evaluate(java.lang.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.java.lang.Object evaluate(java.lang.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.java.lang.Object evaluate(java.lang.String expression, java.lang.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.java.lang.String parse(java.lang.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.java.lang.String parse(java.lang.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(java.lang.String expression)
expression
- the expression to validate
void validateExpression(java.lang.String expression) throws InvalidExpressionException
expression
- the expression to validate
InvalidExpressionException
- if the expression is invalid, including information about the position and faultboolean isExpression(java.lang.String string)
string
- is this string an expression string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |