public class FunctionCallExpression extends java.lang.Object implements Expression
| Modifier and Type | Class and Description |
|---|---|
protected static class |
FunctionCallExpression.functionRegistration
Maintain a single function registration.
|
static class |
FunctionCallExpression.invalidFunctionExpressionException
Exception indicating that an invalid function call expression was created, usually by the selector parser.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList |
arguments |
protected FilterFunction |
filterFunc |
protected java.lang.String |
functionName |
protected static java.util.HashMap<java.lang.String,FunctionCallExpression.functionRegistration> |
functionRegistry |
| Modifier | Constructor and Description |
|---|---|
protected |
FunctionCallExpression(java.lang.String func_name,
java.util.List<Expression> args)
Constructs a function call expression with the named function and argument list.
|
| Modifier and Type | Method and Description |
|---|---|
static FunctionCallExpression |
createFunctionCall(java.lang.String func_name,
java.util.List<Expression> args)
Create a function call expression for the named function and argument list, returning a Boolean function
call expression if the function returns a boolean value so that it may be used in boolean contexts.
|
static void |
deregisterFunction(java.lang.String name)
Remove the registration of the function with the specified name.
|
java.lang.Object |
evaluate(MessageEvaluationContext message_ctx)
Evaluate the function call expression in the context given.
|
Expression |
getArgument(int which)
Retrieve the argument at the specified index; the first argument is index 0.
|
int |
getNumArguments()
Retrieve the number of arguments for the function call defined in this expression.
|
static boolean |
registerFunction(java.lang.String name,
FilterFunction impl)
Register the function with the specified name.
|
java.lang.String |
toString()
Translate the expression back into text in a form similar to the input to the selector parser.
|
protected static final java.util.HashMap<java.lang.String,FunctionCallExpression.functionRegistration> functionRegistry
protected java.lang.String functionName
protected java.util.ArrayList arguments
protected FilterFunction filterFunc
protected FunctionCallExpression(java.lang.String func_name,
java.util.List<Expression> args)
throws FunctionCallExpression.invalidFunctionExpressionException
FunctionCallExpression.invalidFunctionExpressionException - - if the function name is not valid.public static boolean registerFunction(java.lang.String name,
FilterFunction impl)
name - - the function name, as used in selector expressions. Case Sensitive.impl - - class which implements the function interface, including parse-time and evaluation-time
operations.public static void deregisterFunction(java.lang.String name)
name - - name of the function to remove.public static FunctionCallExpression createFunctionCall(java.lang.String func_name, java.util.List<Expression> args) throws FunctionCallExpression.invalidFunctionExpressionException
func_name - - name of the function, as used in selectors.args - - list of argument expressions passed to the function.invalidFunctionExpression - - if the function name is not valid, or the given argument list is
not valid for the function.FunctionCallExpression.invalidFunctionExpressionExceptionpublic int getNumArguments()
public Expression getArgument(int which)
which - - number of the argument to retrieve; the first is 0.public java.lang.Object evaluate(MessageEvaluationContext message_ctx) throws javax.jms.JMSException
evaluate in interface Expressionjavax.jms.JMSExceptionExpression.evaluate(org.apache.activemq.filter.MessageEvaluationContext)public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.