Class MuleExpressionEvaluator

  extended by org.mule.expression.MuleExpressionEvaluator
All Implemented Interfaces:
MuleContextAware, ExpressionEvaluator, NamedObject

Deprecated. MuleExpressionEvaluator is a wrapper of the default expression evaluators which ends up redirecting to the DefaultExpressionManager evaluate method. It has been deprecated since it only provides one more way to accomplish the same result. Instead use the default expression evaluators, for example: #[mule:message.headers(foo, bar)] - replaced by #[headers:foo,bar] #[mule:message.attachments-list(attach1, attach2*)] - replaced by #[attachments-list:attach1,attach2*] #[mule:context.serviceName] - replaced by #[context:serviceName] Check the Expressions configuration reference for more examples of the default expression evaluators syntax.

public class MuleExpressionEvaluator
extends Object
implements ExpressionEvaluator, MuleContextAware

This evaluator provide a powerful expression language for querying mule information at runtime. It provides a unified language for querying message properties, attachments payload, Mule context information such as the current service or endpoint and access to the registry. Here are some examples: #[mule:message.headers(foo, bar)] - retrieves two headers 'foo' and 'bar' and returns a Map. #[mule:message.attachments-list(attach1, attach2*)] - retrieves two named attachments in a List. The star on 'attach2' indicates that it is optional #[mule:message.headers(all)] - retrieves all headers and returns as a Map. #[mule:message.payload(org.dom4j.Document)] - return the payload and convert it to a org.dom4j.Document. #[mule:message.correlationId] - return the the correlationId on the message #[] - expects a Map payload object and will retrive a property 'foo' from the map. #[mule.context.serviceName] - returns the current service Name #[mule.context.modelName] - returns the current model Name #[mule.context.workingDir] - returns the working Directory #[mule.context.serverId] - returns the current server ID #[] - returns an object called 'apple' from the registry #[*] - returns an object called 'apple' from the registry but is optional #[] - returns the property 'washed on an object called 'apple' in the registry

Field Summary
static String NAME
Constructor Summary
Method Summary
 Object evaluate(String expression, MuleMessage message)
          Deprecated. Extracts a single property from the message
protected  ExpressionConfig getExpressionConfig(String eval, String expression)
 String getName()
          Deprecated. Gets the name of the object
 void setMuleContext(MuleContext context)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String NAME
See Also:
Constant Field Values
Constructor Detail


public MuleExpressionEvaluator()
Method Detail


public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware


public Object evaluate(String expression,
                       MuleMessage message)
Description copied from interface: ExpressionEvaluator
Extracts a single property from the message

Specified by:
evaluate in interface ExpressionEvaluator
expression - the property expression or expression
message - the message to extract from
the result of the extraction or null if the property was not found


protected ExpressionConfig getExpressionConfig(String eval,
                                               String expression)


public String getName()
Description copied from interface: NamedObject
Gets the name of the object

Specified by:
getName in interface NamedObject
the name of the object

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