/** * Constructs an instance of this class from a left and right expression * and an escape character * * @param leftExpression The expression to check * @param rightExpression The match expression * @param escapeChar The escape character, to allow literal use of wildcard and single match chars */ public MatchCriteria( Expression leftExpression, Expression rightExpression, char escapeChar ) { this(leftExpression, rightExpression); setEscapeChar(escapeChar); }
/** * Constructs an instance of this class from a left and right expression * and an escape character * * @param leftExpression The expression to check * @param rightExpression The match expression * @param escapeChar The escape character, to allow literal use of wildcard and single match chars */ public MatchCriteria( Expression leftExpression, Expression rightExpression, char escapeChar ) { this(leftExpression, rightExpression); setEscapeChar(escapeChar); }
/** * Constructs an instance of this class from a left and right expression * and an escape character * * @param leftExpression The expression to check * @param rightExpression The match expression * @param escapeChar The escape character, to allow literal use of wildcard and single match chars */ public MatchCriteria( Expression leftExpression, Expression rightExpression, char escapeChar ) { this(leftExpression, rightExpression); setEscapeChar(escapeChar); }
criteria.setEscapeChar(MatchCriteria.NULL_ESCAPE_CHAR); criteria.setEscapeChar(MatchCriteria.NULL_ESCAPE_CHAR); } else if(DataTypeManager.DefaultDataClasses.STRING.equals(criteria.getLeftExpression().getType()) && value.indexOf(escape) < 0
criteria.setEscapeChar(MatchCriteria.NULL_ESCAPE_CHAR); criteria.setEscapeChar(MatchCriteria.NULL_ESCAPE_CHAR); } else if(DataTypeManager.DefaultDataClasses.STRING.equals(criteria.getLeftExpression().getType()) && value.indexOf(escape) < 0
criteria.setEscapeChar(MatchCriteria.NULL_ESCAPE_CHAR); criteria.setEscapeChar(MatchCriteria.NULL_ESCAPE_CHAR); } else if(DataTypeManager.DefaultDataClasses.STRING.equals(criteria.getLeftExpression().getType()) && value.indexOf(escape) < 0
public static MatchCriteria example(String str, char escapeChar) { MatchCriteria crit = new MatchCriteria(); crit.setLeftExpression(new ElementSymbol("m.g1.e1")); //$NON-NLS-1$ crit.setRightExpression(new Constant(str)); crit.setEscapeChar(escapeChar); return crit; }
@Test public void testMatchCriteria2() { MatchCriteria mc = new MatchCriteria(); mc.setLeftExpression(new ElementSymbol("m.g.e1")); //$NON-NLS-1$ mc.setRightExpression(new Constant("%")); //$NON-NLS-1$ mc.setEscapeChar('#'); helpTest(mc, "m.g.e1 LIKE '%' ESCAPE '#'"); //$NON-NLS-1$ }
matchcriteria.setEscapeChar(esc.charValue());
matchcriteria.setEscapeChar(esc.charValue());
matchcriteria.setEscapeChar(esc.charValue());