org.apache.activemq.filter.function
Class splitFunction

java.lang.Object
  extended by 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 Summary
splitFunction()
           
 
Method Summary
 Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx)
          Evaluate the given expression for this function in the given context.
 boolean isValid(FunctionCallExpression expr)
          Check whether the given expression is valid for this function.
 boolean returnsBoolean(FunctionCallExpression expr)
          Indicate that this function does not return a boolean value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

splitFunction

public splitFunction()
Method Detail

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 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.
Returns:
List - a list of Strings resulting from the split.
Throws:
JMSException


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.