@SuppressWarnings({ "rawtypes", "unchecked" }) public Object evaluate(MessageEvaluationContext message) throws JMSException { Comparable<Comparable> lv = (Comparable)left.evaluate(message); if (lv == null) { return null; } Comparable rv = (Comparable)right.evaluate(message); if (rv == null) { return null; } return compare(lv, rv); }
public static BooleanExpression createNotLike(Expression left, String right, String escape) { return UnaryExpression.createNOT(createLike(left, right, escape)); }
public static BooleanExpression createBetween(Expression value, Expression left, Expression right) { return LogicExpression.createAND(createGreaterThanEqual(value, left), createLessThanEqual(value, right)); }
public static BooleanExpression createNotBetween(Expression value, Expression left, Expression right) { return LogicExpression.createOR(createLessThan(value, left), createGreaterThan(value, right)); }
public static BooleanExpression createEqual(Expression left, Expression right) { checkEqualOperand(left); checkEqualOperand(right); checkEqualOperandCompatability(left, right); return doCreateEqual(left, right); }
public static BooleanExpression createNotEqual(Expression left, Expression right) { return UnaryExpression.createNOT(createEqual(left, right)); }
public static BooleanExpression createLessThan(final Expression left, final Expression right) { checkLessThanOperand(left); checkLessThanOperand(right); return new ComparisonExpression(left, right) { protected boolean asBoolean(int answer) { return answer < 0; } public String getExpressionSymbol() { return "<"; } }; }
/** * @see org.apache.activemq.filter.Expression#evaluate(MessageEvaluationContext) */ public Object evaluate(MessageEvaluationContext message) throws JMSException { if (view == cview) { return cachedValue; } cachedValue = right.evaluate(message); cview = view; return cachedValue; }
public boolean matches(MessageEvaluationContext message) throws JMSException { Object object = evaluate(message); return object != null && object == Boolean.TRUE; } }
/** * Removes the value from the associated destination */ public void remove(ActiveMQDestination key, Object value) { synchronized (this) { unsynchronizedRemove(key, value); } }
public boolean matches(MessageEvaluationContext message) throws JMSException { Object object = evaluate(message); return object != null && object == Boolean.TRUE; } }
/** * @param message * @return true if the expression evaluates to Boolean.TRUE. * @throws JMSException */ public boolean matches(MessageEvaluationContext message) throws JMSException { Object object = evaluate(message); return object != null && object == Boolean.TRUE; }
/** * Factory method to create a child node */ protected DestinationMapNode createChildNode() { return new DestinationMapNode(this); }
/** * Check whether the given expression is valid for this function. * * @param expr - the expression consisting of a call to this function. * @return true - if three arguments are passed to the function; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if (expr.getNumArguments() == 3) return true; return false; }
public static BooleanExpression createGreaterThanEqual(final Expression left, final Expression right) { checkLessThanOperand(left); checkLessThanOperand(right); return new ComparisonExpression(left, right) { protected boolean asBoolean(int answer) { return answer >= 0; } public String getExpressionSymbol() { return ">="; } }; }
public Object evaluate(MessageEvaluationContext message) throws JMSException { Object rvalue = right.evaluate(message); if (rvalue == null) { return null; } if (rvalue instanceof Number) { return negate((Number)rvalue); } return null; }
/** * Check whether the given expression is a valid call of this function. Two arguments are required. Note that * the evaluated results of the arguments will be compared with Object#equals(). * * @param expr - the expression consisting of a call to this function. * @return true - if the expression is valid; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if (expr.getNumArguments() != 2) return false; return true; }
public static BooleanExpression createLessThanEqual(final Expression left, final Expression right) { checkLessThanOperand(left); checkLessThanOperand(right); return new ComparisonExpression(left, right) { protected boolean asBoolean(int answer) { return answer <= 0; } public String getExpressionSymbol() { return "<="; } }; }
/** * Check whether the given expression is valid for this function. * * @param expr - the expression consisting of a call to this function. * @return true - if two or three arguments are passed to the function; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if ((expr.getNumArguments() >= 2) && (expr.getNumArguments() <= 3)) return true; return false; }