@Override public Expression shallowCopy() { return new ASTFalse(id); }
/** * A convenience shortcut for boolean false expression. * * @since 3.0 */ public static Expression expFalse() { return new ASTFalse(); }
/** * @since 4.0 * @see ExpressionFactory#inExp(String, Collection) */ static Expression inExp(Expression exp, Collection<?> values) { if (values.isEmpty()) { return new ASTFalse(); } if(!(exp instanceof SimpleNode)) { throw new IllegalArgumentException("exp should be instance of SimpleNode"); } return new ASTIn((SimpleNode)exp, new ASTList(values)); }
/** * @since 4.0 * @see ExpressionFactory#inExp(String, Object[]) */ static Expression inExp(Expression exp, Object... values) { if (values.length == 0) { return new ASTFalse(); } if(!(exp instanceof SimpleNode)) { throw new IllegalArgumentException("exp should be instance of SimpleNode"); } return new ASTIn((SimpleNode)exp, new ASTList(values)); }
/** * A convenience shortcut for building IN DB expression. Return ASTFalse for * empty collection. */ public static Expression inDbExp(String pathSpec, Collection<?> values) { if (values.isEmpty()) { return new ASTFalse(); } return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }
@Override protected Object transformExpression(Transformer transformer) { Object transformed = super.transformExpression(transformer); // transform empty ASTIn to ASTFalse if (transformed instanceof ASTIn) { ASTIn exp = (ASTIn) transformed; if (exp.jjtGetNumChildren() == 2) { ASTList list = (ASTList) exp.jjtGetChild(1); Object[] objects = (Object[]) list.evaluate(null); if (objects.length == 0) { transformed = new ASTFalse(); } } } return transformed; }
/** * A convenience shortcut for building IN DB expression. Return ASTFalse for * empty collection. */ public static Expression inDbExp(String pathSpec, Object... values) { if (values.length == 0) { return new ASTFalse(); } return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }
ASTFalse jjtn002 = new ASTFalse(JJTFALSE); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002);