Class splitFunction

java.lang.Object
org.apache.activemq.filter.function.splitFunction
All Implemented Interfaces:
FilterFunction

public class splitFunction extends Object implements FilterFunction
Function which splits a string into a list of strings given a regular expression for the separator.
  • Constructor Details

    • splitFunction

      public splitFunction()
  • Method Details

    • isValid

      public boolean isValid(FunctionCallExpression expr)
      Check whether the given expression is valid for this function.
      Specified by:
      isValid in interface FilterFunction
      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

      public boolean returnsBoolean(FunctionCallExpression expr)
      Indicate that this function does not return a boolean value.
      Specified by:
      returnsBoolean in interface FilterFunction
      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 interface FilterFunction
      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