예제 #1
0
  /**
   * Binds the specified value to a variable.
   *
   * @param name variable name
   * @param args argument array
   * @param value value to be bound
   * @throws QueryException query exception
   */
  private void bind(final QNm name, final Expr[] args, final Value value) throws QueryException {
    // skip nulled values
    if (value == null) return;

    for (int i = 0; i < function.args.length; i++) {
      final Var var = function.args[i];
      if (!var.name.eq(name)) continue;
      // casts and binds the value
      args[i] = var.checkType(value, context, null);
      break;
    }
  }
예제 #2
0
 @Override
 public String toString() {
   final TokenBuilder tb = new TokenBuilder().add(var.toString()).add(' ').add(ASSIGN);
   tb.add(' ').add(expr.toString());
   if (coll != null) tb.add(' ').add(COLLATION).add(" \"").add(coll.uri()).add('"');
   return tb.toString();
 }
예제 #3
0
 @Override
 public void plan(final FElem plan) {
   final FElem e = planElem();
   var.plan(e);
   expr.plan(e);
   plan.add(e);
 }
예제 #4
0
파일: Count.java 프로젝트: james-jw/basex
 @Override
 public Count optimize(final QueryContext qc, final VarScope scp) throws QueryException {
   var.refineType(SeqType.ITR, qc, info);
   return this;
 }