Beispiel #1
0
  @Override
  public Object invoke(PageContext pc, Object[] args) throws PageException {

    if (args.length == 2) return call(pc, Caster.toArray(args[0]), Caster.toFunction(args[1]));
    if (args.length == 3)
      return call(
          pc, Caster.toArray(args[0]), Caster.toFunction(args[1]), Caster.toBooleanValue(args[2]));
    if (args.length == 4)
      return call(
          pc,
          Caster.toArray(args[0]),
          Caster.toFunction(args[1]),
          Caster.toBooleanValue(args[2]),
          Caster.toDoubleValue(args[3]));

    throw new FunctionException(pc, "ArrayEach", 2, 4, args.length);
  }
Beispiel #2
0
 public static double call(
     PageContext pc, Query query, String string, Object datatype, Object array)
     throws PageException {
   if (datatype == null) return call(pc, query, string, array);
   query.addColumn(
       KeyImpl.init(string),
       Caster.toArray(array),
       SQLCaster.toSQLType(Caster.toString(datatype)));
   return query.size();
 }
 Resource[] callResourceArrayRTE(PageContext pc, Component cfc, String methodName, Object[] args) {
   pc = ThreadLocalPageContext.get(pc);
   try {
     Array arr = Caster.toArray(call(pc, getCFC(pc, cfc), methodName, args));
     Iterator<Object> it = arr.valueIterator();
     CFMLResource[] resources = new CFMLResource[arr.size()];
     int index = 0;
     while (it.hasNext()) {
       resources[index++] = new CFMLResource(this, Caster.toComponent(it.next()));
     }
     return resources;
   } catch (PageException pe) {
     throw new PageRuntimeException(pe);
   }
 }
Beispiel #4
0
 public static double call(PageContext pc, Query query, String string, Object array)
     throws PageException {
   query.addColumn(KeyImpl.init(string), Caster.toArray(array));
   return query.size();
 }