Class splitFunction
java.lang.Object
org.apache.activemq.filter.function.splitFunction
- All Implemented Interfaces:
FilterFunction
Function which splits a string into a list of strings given a regular expression for the separator.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionevaluate
(FunctionCallExpression expr, MessageEvaluationContext message_ctx) Evaluate the given expression for this function in the given context.boolean
Check whether the given expression is valid for this function.boolean
Indicate that this function does not return a boolean value.
-
Constructor Details
-
splitFunction
public splitFunction()
-
-
Method Details
-
isValid
Check whether the given expression is valid for this function.- Specified by:
isValid
in interfaceFilterFunction
- Parameters:
expr
- - the expression consisting of a call to this function.- Returns:
- true - if two or three arguments are passed to the function; false - otherwise.
-
returnsBoolean
Indicate that this function does not return a boolean value.- Specified by:
returnsBoolean
in interfaceFilterFunction
- Parameters:
expr
- - the expression consisting of a call to this function.- Returns:
- false - indicating this filter function never evaluates to a boolean result.
-
evaluate
public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) throws jakarta.jms.JMSException Evaluate the given expression for this function in the given context. A list of zero or more strings results from the evaluation. The result of the evaluation of the first argument is split with the regular expression which results from the evaluation of the second argument. If a third argument is given, it is an integer which limits the split. String#split() performs the split. The first two arguments must be Strings. If a third is given, it must be an Integer.- Specified by:
evaluate
in interfaceFilterFunction
- Parameters:
expr
- - the expression consisting of a call to this function.message_ctx
- - the context within which to evaluate the call.- Returns:
- List - a list of Strings resulting from the split.
- Throws:
jakarta.jms.JMSException
-