/** * @since 4.0 * @see ExpressionFactory#containsIgnoreCaseExp(String, String) */ static Expression containsIgnoreCaseExp(Expression exp, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExp(exp, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
/** * @return An expression for a database "LIKE" query with the value * converted to a pattern matching the beginning of the String. * @since 4.0 */ public static Expression endsWithExp(String pathSpec, String value) { ASTLike like = likeExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toEndsWith(like); return like; }
/** * @since 4.0 * @see ExpressionFactory#startsWithExp(String, String) */ static Expression startsWithExp(Expression exp, String value) { ASTLike like = likeExpInternal(exp, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }
static void escape(PatternMatchNode exp) { Object pattern = exp.getOperand(1); if (pattern instanceof String) { // find _ or % and then attempt to escape... String pString = pattern.toString(); int len = pString.length(); for (int i = 0; i < len; i++) { char c = pString.charAt(i); if (c == WILDCARD_SEQUENCE || c == WILDCARD_ONE) { exp.setOperand(1, escapeFrom(exp, pString, i, len)); break; } } } }
/** * Same as {@link #containsExp(String, String)} only using case-insensitive * comparison. * * @since 4.0 */ public static Expression containsIgnoreCaseExp(String pathSpec, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
/** * @since 4.0 * @see ExpressionFactory#endsWithExp(String, String) */ static Expression endsWithExp(Expression exp, String value) { ASTLike like = likeExpInternal(exp, value, (char) 0); LikeExpressionHelper.toEndsWith(like); return like; }
/** * @return An expression for a database "LIKE" query with the value * converted to a pattern matching the beginning of the String. * @since 4.0 */ public static Expression startsWithExp(String pathSpec, String value) { ASTLike like = likeExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }
/** * @since 4.0 * @see ExpressionFactory#containsExp(String, String) */ static Expression containsExp(Expression exp, String value) { ASTLike like = likeExpInternal(exp, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
/** * Same as {@link #endsWithExp(String, String)} only using case-insensitive * comparison. * * @since 4.0 */ public static Expression endsWithIgnoreCaseExp(String pathSpec, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toEndsWith(like); return like; }
/** * Same as {@link #startsWithExp(String, String)} only using * case-insensitive comparison. * * @since 4.0 */ public static Expression startsWithIgnoreCaseExp(String pathSpec, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }
/** * @return An expression for a database "LIKE" query with the value * converted to a pattern matching anywhere in the String. * @since 4.0 */ public static Expression containsExp(String pathSpec, String value) { ASTLike like = likeExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
/** * @since 4.0 * @see ExpressionFactory#endsWithIgnoreCaseExp(String, String) */ static Expression endsWithIgnoreCaseExp(Expression exp, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExp(exp, value, (char) 0); LikeExpressionHelper.toEndsWith(like); return like; }
/** * @since 4.0 * @see ExpressionFactory#startsWithIgnoreCaseExp(String, String) */ static Expression startsWithIgnoreCaseExp(Expression exp, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExp(exp, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }