/** * A convenience shortcut for building NOT_IN expression. */ public static Expression notInExp(String pathSpec, Collection values) { return new ASTNotIn(new ASTObjPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building IN expression. */ public static Expression inExp(String pathSpec, Collection values) { return new ASTIn(new ASTObjPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building NOT_IN expression. Return ASTTrue for * empty collection. * * @since 3.0 */ public static Expression notInDbExp(String pathSpec, Object... values) { if (values.length == 0) { return new ASTTrue(); } return new ASTNotIn(new ASTDbPath(pathSpec), new ASTList(values)); }
public ExpressionParser(java.io.InputStream stream) { jj_input_stream = new JavaCharStream(stream, 1, 1); token_source = new ExpressionParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 23; i++) jj_la1[i] = -1; }
public void setOperand(int index, Object value) { Node node = (value == null || value instanceof Node) ? (Node) value : new ASTScalar(value); jjtAddChild(node, index); // set the parent, as jjtAddChild doesn't do it... if (node != null) { node.jjtSetParent(this); } }
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(); }
/** * A convenience method to create an DB_PATH "greater than or equal to" * expression. * * @since 3.0 */ public static Expression greaterOrEqualDbExp(String pathSpec, Object value) { return new ASTGreaterOrEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience shortcut for building NOT_LIKE_IGNORE_CASE expression. * * @since 3.0 */ public static Expression notLikeIgnoreCaseDbExp(String pathSpec, Object value) { return new ASTNotLikeIgnoreCase(new ASTDbPath(pathSpec), value); }
public Object transform(Object input) { if (input instanceof ASTObjPath) { return new ASTDbPath(((SimpleNode) input).getOperand(0)); } return input; } }
@Override public void jjtClose() { super.jjtClose(); flattenTree(); } }
@Override public void jjtClose() { super.jjtClose(); flattenTree(); }
/** * This method is used by FunctionExpressionFactory * @param part date/time part to extract */ public void setPart(DateTimePart part) { this.part = part; this.partName = nameToCamelCase(part.name()); }
@Override public void jjtClose() { super.jjtClose(); flattenTree(); }