/** * Evaluate the expression. * @param node node in the expression tree * @param data data * @return Evaluated string */ public String evalString(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); if (comparison != Compare.EQ) { return null; } return String.format("%s=%s", value1, value2.toString()); }
@Override public String evalString(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); if (!"dateCreated".equals(value1)) { return null; } final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); return String.format("%s%s%s", value1, comparison.getExpression(), value2.toString()); } }
@Override public String evalString(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); if (!"dateCreated".equals(value1)) { return null; } final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); return String.format("%s%s%s", value1, comparison.getExpression(), value2.toString()); } }
/** * Evaluate the expression. * @param node node in the expression tree * @param data data * @return Evaluated string */ public String evalString(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); if (comparison != Compare.EQ) { return null; } return String.format("%s=%s", value1, value2.toString()); }
/** * Compares. * @param node node in the tree * @param data data * @return comparison result */ public Boolean evalCompare(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); return compare(comparison, value1, value2); }
/** * evalString. * * @param node node * @param data data * @return eval String */ private Expression evalString(final SimpleNode node, final Object data) { final Object lhs = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object rhs = node.jjtGetChild(2).jjtAccept(this, data); return createIcebergExpression(lhs, rhs, comparison); }
/** * Compares. * @param node node in the tree * @param data data * @return comparison result */ public Boolean evalCompare(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); return compare(comparison, value1, value2); }
/** * evalString. * * @param node node * @param data data * @return eval String */ public String evalString(final SimpleNode node, final Object data) { final Object lhs = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object rhs = node.jjtGetChild(2).jjtAccept(this, data); return createSqlCriteria(lhs, rhs, comparison, false); }
/** * evalString. * * @param node node * @param data data * @return eval String */ public String evalString(final SimpleNode node, final Object data) { final Object lhs = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object rhs = node.jjtGetChild(2).jjtAccept(this, data); return createSqlCriteria(lhs, rhs, comparison, false); }
/** * evalString. * * @param node node * @param data data * @return eval String */ private Expression evalString(final SimpleNode node, final Object data) { final Object lhs = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object rhs = node.jjtGetChild(2).jjtAccept(this, data); return createIcebergExpression(lhs, rhs, comparison); }