Package org.apache.activemq.filter
Class ComparisonExpression
- java.lang.Object
-
- org.apache.activemq.filter.BinaryExpression
-
- org.apache.activemq.filter.ComparisonExpression
-
- All Implemented Interfaces:
BooleanExpression
,Expression
public abstract class ComparisonExpression extends BinaryExpression implements BooleanExpression
A filter performing a comparison of two objects
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<Boolean>
CONVERT_STRING_EXPRESSIONS
-
Fields inherited from class org.apache.activemq.filter.BinaryExpression
left, right
-
-
Constructor Summary
Constructors Constructor Description ComparisonExpression(Expression left, Expression right)
-
Method Summary
-
Methods inherited from class org.apache.activemq.filter.BinaryExpression
equals, getExpressionSymbol, getLeft, getRight, hashCode, setLeft, setRight, toString
-
-
-
-
Field Detail
-
CONVERT_STRING_EXPRESSIONS
public static final ThreadLocal<Boolean> CONVERT_STRING_EXPRESSIONS
-
-
Constructor Detail
-
ComparisonExpression
public ComparisonExpression(Expression left, Expression right)
- Parameters:
left
-right
-
-
-
Method Detail
-
createBetween
public static BooleanExpression createBetween(Expression value, Expression left, Expression right)
-
createNotBetween
public static BooleanExpression createNotBetween(Expression value, Expression left, Expression right)
-
createLike
public static BooleanExpression createLike(Expression left, String right, String escape)
-
createNotLike
public static BooleanExpression createNotLike(Expression left, String right, String escape)
-
createInFilter
public static BooleanExpression createInFilter(Expression left, List elements)
-
createNotInFilter
public static BooleanExpression createNotInFilter(Expression left, List elements)
-
createIsNull
public static BooleanExpression createIsNull(Expression left)
-
createIsNotNull
public static BooleanExpression createIsNotNull(Expression left)
-
createNotEqual
public static BooleanExpression createNotEqual(Expression left, Expression right)
-
createEqual
public static BooleanExpression createEqual(Expression left, Expression right)
-
createGreaterThan
public static BooleanExpression createGreaterThan(Expression left, Expression right)
-
createGreaterThanEqual
public static BooleanExpression createGreaterThanEqual(Expression left, Expression right)
-
createLessThan
public static BooleanExpression createLessThan(Expression left, Expression right)
-
createLessThanEqual
public static BooleanExpression createLessThanEqual(Expression left, Expression right)
-
checkLessThanOperand
public static void checkLessThanOperand(Expression expr)
Only Numeric expressions can be used in >, >=, < or <= expressions.s- Parameters:
expr
-
-
checkEqualOperand
public static void checkEqualOperand(Expression expr)
Validates that the expression can be used in == or <> expression. Cannot not be NULL TRUE or FALSE litterals.- Parameters:
expr
-
-
evaluate
public Object evaluate(MessageEvaluationContext message) throws JMSException
- Specified by:
evaluate
in interfaceExpression
- Returns:
- the value of this expression
- Throws:
JMSException
-
compare
protected Boolean compare(Comparable lv, Comparable rv)
-
asBoolean
protected abstract boolean asBoolean(int answer)
-
matches
public boolean matches(MessageEvaluationContext message) throws JMSException
- Specified by:
matches
in interfaceBooleanExpression
- Returns:
- true if the expression evaluates to Boolean.TRUE.
- Throws:
JMSException
-
-