/** * Wrap value into ASTScalar * @since 4.0 */ static Expression wrapScalarValue(Object value) { return new ASTScalar(value); }
/** * Creates a copy of this expression node, without copying children. */ @Override public Expression shallowCopy() { ASTScalar copy = new ASTScalar(id); copy.value = value; return copy; }
protected Node wrapChild(Object child) { // when child is null, there's no way of telling whether this is a scalar or not... fuzzy... // maybe we should stop using this method - it is too generic return (child instanceof Node || child == null) ? (Node) child : new ASTScalar(child); }
/** * Call SUBSTRING(string, offset, length) function * * @param exp expression that must evaluate to string * @param offset start offset of substring * @param length length of substring * @return SUBSTRING() call expression */ public static Expression substringExp(Expression exp, int offset, int length) { return substringExp(exp, new ASTScalar((Integer)offset), new ASTScalar((Integer)length)); }
/** * Call SUBSTRING(string, offset, length) function * * @param path Object path value * @param offset start offset of substring * @param length length of substring * @return SUBSTRING() call expression */ public static Expression substringExp(String path, int offset, int length) { return substringExp(new ASTObjPath(path), new ASTScalar((Integer)offset), new ASTScalar((Integer)length)); }
/** * @param exp numeric expression * @param number divisor * @return MOD() call expression */ public static Expression modExp(Expression exp, Number number) { return modExp(exp, new ASTScalar(number)); }
/** * @param path object path value * @param number divisor * @return MOD() call expression */ public static Expression modExp(String path, Number number) { return modExp(new ASTObjPath(path), new ASTScalar(number)); }
/** * Call LOCATE(substring, string) function that return position * of substring in string or 0 if it is not found. * * @param substring object path value * @param path object path * @return LOCATE() call expression */ public static Expression locateExp(String substring, String path) { return locateExp(new ASTScalar(substring), new ASTObjPath(path)); }
public ASTGreaterOrEqual(SimpleNode path, Object value) { super(ExpressionParserTreeConstants.JJTGREATEROREQUAL); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
public ASTLikeIgnoreCase(SimpleNode path, Object pattern) { super(ExpressionParserTreeConstants.JJTLIKEIGNORECASE, true); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(pattern), 1); connectChildren(); }
public ASTLess(ASTPath path, Object value) { super(ExpressionParserTreeConstants.JJTLESS); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
/** * Creates "Not Equal To" expression. */ public ASTNotEqual(SimpleNode path, Object value) { super(ExpressionParserTreeConstants.JJTNOTEQUAL); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
public ASTNotLike(ASTPath path, Object value) { super(ExpressionParserTreeConstants.JJTNOTLIKE, false); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
public ASTNotLikeIgnoreCase(ASTPath path, Object value) { super(ExpressionParserTreeConstants.JJTNOTLIKEIGNORECASE, true); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
public ASTLessOrEqual(SimpleNode path, Object value) { super(ExpressionParserTreeConstants.JJTLESSOREQUAL); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
public ASTLike(SimpleNode path, Object pattern) { super(ExpressionParserTreeConstants.JJTLIKE, false); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(pattern), 1); connectChildren(); }
public ASTNotLike(SimpleNode path, Object value, char escapeChar) { super(ExpressionParserTreeConstants.JJTNOTLIKE, false, escapeChar); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(value), 1); connectChildren(); }
public ASTLike(SimpleNode path, Object pattern, char escapeChar) { super(ExpressionParserTreeConstants.JJTLIKE, false, escapeChar); jjtAddChild(path, 0); jjtAddChild(new ASTScalar(pattern), 1); connectChildren(); }