org.apache.activemq.filter
Class BooleanFunctionCallExpr

java.lang.Object
  extended by org.apache.activemq.filter.FunctionCallExpression
      extended by org.apache.activemq.filter.BooleanFunctionCallExpr
All Implemented Interfaces:
BooleanExpression, Expression

public class BooleanFunctionCallExpr
extends FunctionCallExpression
implements BooleanExpression

Function call expression that evaluates to a boolean value. Selector parsing requires BooleanExpression objects for Boolean expressions, such as operands to AND, and as the final result of a selector. This provides that interface for function call expressions that resolve to Boolean values.

If a function can return different types at evaluation-time, the function implementation needs to decide whether it supports casting to Boolean at parse-time.

See Also:
FunctionCallExpression.createFunctionCall(java.lang.String, java.util.List)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.activemq.filter.FunctionCallExpression
FunctionCallExpression.functionRegistration, FunctionCallExpression.invalidFunctionExpressionException
 
Field Summary
 
Fields inherited from class org.apache.activemq.filter.FunctionCallExpression
arguments, filterFunc, functionName, functionRegistry
 
Constructor Summary
BooleanFunctionCallExpr(String func_name, List<Expression> args)
          Constructs a function call expression with the named filter function and arguments, which returns a boolean result.
 
Method Summary
 boolean matches(MessageEvaluationContext message_ctx)
          Evaluate the function call expression, in the given context, and return an indication of whether the expression "matches" (i.e. evaluates to true).
 
Methods inherited from class org.apache.activemq.filter.FunctionCallExpression
createFunctionCall, deregisterFunction, evaluate, getArgument, getNumArguments, registerFunction, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.filter.Expression
evaluate
 

Constructor Detail

BooleanFunctionCallExpr

public BooleanFunctionCallExpr(String func_name,
                               List<Expression> args)
                        throws FunctionCallExpression.invalidFunctionExpressionException
Constructs a function call expression with the named filter function and arguments, which returns a boolean result.

Parameters:
func_name - - Name of the filter function to be called when evaluated.
args - - List of argument expressions passed to the function.
Throws:
FunctionCallExpression.invalidFunctionExpressionException
Method Detail

matches

public boolean matches(MessageEvaluationContext message_ctx)
                throws JMSException
Evaluate the function call expression, in the given context, and return an indication of whether the expression "matches" (i.e. evaluates to true).

Specified by:
matches in interface BooleanExpression
Parameters:
message_ctx - - message context against which the expression will be evaluated.
Returns:
the boolean evaluation of the function call expression.
Throws:
JMSException


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