/** * Creates a copy of this expression node, without copying children. */ @Override public Expression shallowCopy() { return new ASTList(id); }
/** * Creates a copy of this expression node, without copying children. */ public Expression shallowCopy() { return new ASTList(id); }
/** * Applies a few default rules for adding operands to expressions. In * particular wraps all lists into LIST expressions. Applied only in path * expressions. */ protected static Object wrapPathOperand(Object op) { if (op instanceof Collection<?>) { return new ASTList((Collection<?>) op); } else if (op instanceof Object[]) { return new ASTList((Object[]) op); } else { return op; } }
/** * Applies a few default rules for adding operands to expressions. In particular wraps * all lists into LIST expressions. Applied only in path expressions. */ protected static Object wrapPathOperand(Object op) { if (op instanceof Collection) { return new ASTList((Collection) op); } else if (op instanceof Object[]) { return new ASTList((Object[]) op); } else { return op; } }
/** * @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#notInExp(String, Object[]) */ static Expression notInExp(Expression exp, Object... values) { if (values.length == 0) { return new ASTTrue(); } if(!(exp instanceof SimpleNode)) { throw new IllegalArgumentException("exp should be instance of SimpleNode"); } return new ASTNotIn((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)); }
/** * @since 4.0 * @see ExpressionFactory#notInExp(String, Collection) */ static Expression notInExp(Expression exp, Collection<?> values) { if (values.isEmpty()) { return new ASTTrue(); } if(!(exp instanceof SimpleNode)) { throw new IllegalArgumentException("exp should be instance of SimpleNode"); } return new ASTNotIn((SimpleNode)exp, new ASTList(values)); }
Expression trimmedInExpression(ASTPath path, Object[] values, int maxInSize) { Expression res = null; List<Object> in = new ArrayList<>(maxInSize); for (Object v : values) { in.add(v); if (in.size() == maxInSize) { Expression inExp = new ASTIn(path, new ASTList(in)); res = res != null ? res.orExp(inExp) : inExp; in = new ArrayList<>(maxInSize); } } if (in.size() > 0) { Expression inExp = new ASTIn(path, new ASTList(in)); res = res != null ? res.orExp(inExp) : inExp; } return res; }
/** * 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 IN DB expression. */ public static Expression inDbExp(String pathSpec, Collection values) { return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building IN DB expression. */ public static Expression inDbExp(String pathSpec, Object[] values) { return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building IN expression. */ public static Expression inExp(String pathSpec, Object[] values) { return new ASTIn(new ASTObjPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building NOT_IN expression. * * @since 1.0.6 */ public static Expression notInExp(String pathSpec, Object[] values) { return new ASTNotIn(new ASTObjPath(pathSpec), 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)); }
/** * A convenience shortcut for building NOT_IN expression. Return ASTTrue for * empty collection. * * @since 3.0 */ public static Expression notInDbExp(String pathSpec, Collection<?> values) { if (values.isEmpty()) { return new ASTTrue(); } return new ASTNotIn(new ASTDbPath(pathSpec), new ASTList(values)); }
/** * 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)); }
/** * 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)); }
final public void scalarCommaList() throws ParseException { ASTList jjtn001 = new ASTList(JJTLIST); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);