|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.expression.DefaultExpressionManager
public class DefaultExpressionManager
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 | |
---|---|
protected static Log |
logger
logger used by this class |
Fields inherited from interface org.mule.api.expression.ExpressionManager |
---|
DEFAULT_EXPRESSION_POSTFIX, DEFAULT_EXPRESSION_PREFIX |
Constructor Summary | |
---|---|
DefaultExpressionManager()
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final transient Log logger
Constructor Detail |
---|
public DefaultExpressionManager()
Method Detail |
---|
public void registerEvaluator(ExpressionEvaluator evaluator)
registerEvaluator
in interface ExpressionManager
public boolean isEvaluatorRegistered(String name)
isEvaluatorRegistered
in interface ExpressionManager
name
- the name of the expression evaluator
public ExpressionEvaluator unregisterEvaluator(String name)
unregisterEvaluator
in interface ExpressionManager
name
- the name of the evaluator to remove
public Object evaluate(String expression, MuleMessage message) throws ExpressionRuntimeException
ExpressionManager.parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate through all expressions in a string.
evaluate
in interface ExpressionManager
expression
- a single expression i.e. xpath://foomessage
-
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.public Object evaluate(String expression, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
ExpressionManager.parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate through all expressions in a string.
evaluate
in interface ExpressionManager
expression
- a single expression i.e. xpath://foomessage
- failIfNull
- determines if an exception should be thrown if expression could not be evaluated or returns
null. @return the result of the evaluation @throws ExpressionRuntimeException if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.public Object evaluate(String expression, String evaluator, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
ExpressionManager.parse(String,org.mule.api.MuleMessage,boolean)
method should be used since it will iterate through all expressions in a string.
evaluate
in interface ExpressionManager
expression
- a single expression i.e. xpath://fooevaluator
- the evaluator to use when executing the expressionmessage
- failIfNull
- determines if an exception should be thrown if expression could not be evaluated or returns
null. @return the result of the evaluation @throws ExpressionRuntimeException if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.public String parse(String expression, MuleMessage message) throws ExpressionRuntimeException
ExpressionManager.evaluate(String,org.mule.api.MuleMessage,boolean)
.
parse
in interface ExpressionManager
expression
- a single expression i.e. xpath://foomessage
-
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.public String parse(String expression, MuleMessage message, boolean failIfNull) throws ExpressionRuntimeException
ExpressionManager.evaluate(String,org.mule.api.MuleMessage,boolean)
.
parse
in interface ExpressionManager
expression
- a single expression i.e. xpath://foomessage
- failIfNull
- determines if an exception should be thrown if expression could not be evaluated or returns
null. @return the result of the evaluation @throws ExpressionRuntimeException if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.
ExpressionRuntimeException
- if the expression is invalid, or a null is found for the expression and
'failIfNull is set to true.public void clearEvaluators()
clearEvaluators
in interface ExpressionManager
public boolean isValidExpression(String expression)
isValidExpression
in interface ExpressionManager
expression
- the expression to validate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |