org.mule.expression
Class FunctionExpressionEvaluator
java.lang.Object
org.mule.expression.FunctionExpressionEvaluator
- All Implemented Interfaces:
- ExpressionEvaluator, NamedObject
public class FunctionExpressionEvaluator
- extends Object
- implements ExpressionEvaluator
This property extractor doesn't actually extract a property from the message, instead it allows for certain functions
to be called and returns a result. The functions it supports are -
- now - returns an
Timestamp
with the current time.
- date - returns a
Date
with the current time.
- dateStamp - returns a
String
that contains the current date formatted according to DEFAULT_DATE_FORMAT
.
- datestamp:dd-MM-yyyy - returns a
String
that contains the current date formatted according to the format passed into the function.
- uuid - returns a globally unique identifier
- hostname - returns the hostname of the machine Mule is running on
- ip - returns the ip address of the machine Mule is running on
- count - returns a local count that will increment for each call. If the server is re-started the counter will return to zero
- payloadClass - Returns a fuly qualified class name of the payload as a string
- shortPayloadClass - Returns just the class name of the payload as a string
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final String NAME
- See Also:
- Constant Field Values
DEFAULT_DATE_FORMAT
public static final String DEFAULT_DATE_FORMAT
- See Also:
- Constant Field Values
NOW_FUNCTION
public static final String NOW_FUNCTION
- See Also:
- Constant Field Values
DATE_FUNCTION
public static final String DATE_FUNCTION
- See Also:
- Constant Field Values
DATESTAMP_FUNCTION
public static final String DATESTAMP_FUNCTION
- See Also:
- Constant Field Values
SYSTIME_FUNCTION
public static final String SYSTIME_FUNCTION
- See Also:
- Constant Field Values
UUID_FUNCTION
public static final String UUID_FUNCTION
- See Also:
- Constant Field Values
HOSTNAME_FUNCTION
public static final String HOSTNAME_FUNCTION
- See Also:
- Constant Field Values
IP_FUNCTION
public static final String IP_FUNCTION
- See Also:
- Constant Field Values
COUNT_FUNCTION
public static final String COUNT_FUNCTION
- See Also:
- Constant Field Values
PAYLOAD_CLASS_FUNCTION
public static final String PAYLOAD_CLASS_FUNCTION
- See Also:
- Constant Field Values
SHORT_PAYLOAD_CLASS_FUNCTION
public static final String SHORT_PAYLOAD_CLASS_FUNCTION
- See Also:
- Constant Field Values
FunctionExpressionEvaluator
public FunctionExpressionEvaluator()
evaluate
public Object evaluate(String name,
MuleMessage message)
- Description copied from interface:
ExpressionEvaluator
- Extracts a single property from the message
- Specified by:
evaluate
in interface ExpressionEvaluator
- Parameters:
name
- the property expression or expressionmessage
- the message to extract from
- Returns:
- the result of the extraction or null if the property was not found
getName
public String getName()
- Gts the name of the object
- Specified by:
getName
in interface NamedObject
- Returns:
- the name of the object
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.