|
||||||||||
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 |
clearEnrichers()
Clears all registered enrichers from the manager. |
void |
clearEvaluators()
Clears all registered evaluators from the manager. |
void |
enrich(String expression,
MuleMessage message,
Object object)
Enriches the current message using |
void |
enrich(String expression,
String enricher,
MuleMessage message,
Object object)
Enriches the current message |
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 |
evaluateBoolean(String expression,
MuleMessage message)
Evaluates the given expression resolving the result of the evaluation to a boolean. |
boolean |
evaluateBoolean(String expression,
MuleMessage message,
boolean nullReturnsTrue,
boolean nonBooleanReturnsTrue)
Evaluates the given expression resolving the result of the evaluation to a boolean. |
boolean |
evaluateBoolean(String expression,
String evaluator,
MuleMessage message)
Evaluates the given expression resolving the result of the evaluation to a boolean. |
boolean |
evaluateBoolean(String expression,
String evaluator,
MuleMessage message,
boolean nullReturnsTrue,
boolean nonBooleanReturnsTrue)
Evaluates the given expression resolving the result of the evaluation to a boolean. |
boolean |
isEnricherRegistered(String name)
Checks whether an enricher is registered with the manager |
boolean |
isEvaluatorRegistered(String name)
Checks whether an evaluator is registered with the manager |
boolean |
isExpression(String string)
Determines if the string is an expression. |
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 |
registerEnricher(ExpressionEnricher enricher)
|
void |
registerEvaluator(ExpressionEvaluator evaluator)
|
ExpressionEnricher |
unregisterEnricher(String name)
Removes the enricher with the given name |
ExpressionEvaluator |
unregisterEvaluator(String name)
Removes the evaluator with the given name |
void |
validateExpression(String expression)
Determines if the expression is valid or not. |
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
void registerEnricher(ExpressionEnricher enricher)
boolean isEnricherRegistered(String name)
name
- the name of the expression enricher
ExpressionEnricher unregisterEnricher(String name)
name
- the name of the enricher 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 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.boolean evaluateBoolean(String expression, String evaluator, MuleMessage message) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barevaluator
- the evaluator to use when executing the expressionmessage
- The current message being processed
ExpressionRuntimeException
boolean evaluateBoolean(String expression, MuleMessage message) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barmessage
- The current message being processed
ExpressionRuntimeException
boolean evaluateBoolean(String expression, String evaluator, MuleMessage message, boolean nullReturnsTrue, boolean nonBooleanReturnsTrue) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barevaluator
- the evaluator to use when executing the expressionmessage
- The current message being processednullReturnsTrue
- determines if true should be returned if the result of
the evaluation is nullnonBooleanReturnsTrue
- determines if true should returned if the result
is not null but isn't recognised as a boolean
ExpressionRuntimeException
boolean evaluateBoolean(String expression, MuleMessage message, boolean nullReturnsTrue, boolean nonBooleanReturnsTrue) throws ExpressionRuntimeException
expression
- a single expression i.e. header:foo=barmessage
- The current message being processednullReturnsTrue
- determines if true should be returned if the result of
the evaluation is nullnonBooleanReturnsTrue
- determines if true should returned if the result
is not null but isn't recognised as a boolean
ExpressionRuntimeException
void enrich(String expression, MuleMessage message, Object object)
expression
- a single expression i.e. header://foo that defines how the message shoud be enrichedmessage
- The current message being processed that will be enrichedobject
- The object that will be used to enrich the messagevoid enrich(String expression, String enricher, MuleMessage message, Object object)
expression
- a single expression i.e. header://foo that defines how the message shoud be enrichedenricher
- the enricher to use when executing the expressionmessage
- The current message being processed that will be enrichedobject
- The object that will be used to enrich the messageString 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()
void clearEnrichers()
boolean isValidExpression(String expression)
expression
- the expression to validate
void validateExpression(String expression) throws InvalidExpressionException
expression
- the expression to validate
InvalidExpressionException
- if the expression is invalid, including information about the position and faultboolean isExpression(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 |