Search in sources :

Example 6 with BIFCall

use of lucee.runtime.interpreter.ref.func.BIFCall in project Lucee by lucee.

the class BIF method call.

@Override
public Object call(PageContext pageContext, Object[] args, boolean doIncludePath) throws PageException {
    ArrayList<FunctionLibFunctionArg> flfas = flf.getArg();
    FunctionLibFunctionArg flfa;
    List<Ref> refs = new ArrayList<Ref>();
    for (int i = 0; i < args.length; i++) {
        if (i >= flfas.size())
            throw new ApplicationException("too many Attributes in function call [" + flf.getName() + "]");
        flfa = flfas.get(i);
        refs.add(new Casting(flfa.getTypeAsString(), flfa.getType(), args[i]));
    }
    BIFCall call = new BIFCall(flf, refs.toArray(new Ref[refs.size()]));
    return call.getValue(pageContext);
}
Also used : Casting(lucee.runtime.interpreter.ref.cast.Casting) Ref(lucee.runtime.interpreter.ref.Ref) ApplicationException(lucee.runtime.exp.ApplicationException) ArrayList(java.util.ArrayList) BIFCall(lucee.runtime.interpreter.ref.func.BIFCall) FunctionLibFunctionArg(lucee.transformer.library.function.FunctionLibFunctionArg)

Aggregations

Ref (lucee.runtime.interpreter.ref.Ref)6 BIFCall (lucee.runtime.interpreter.ref.func.BIFCall)6 ArrayList (java.util.ArrayList)4 Casting (lucee.runtime.interpreter.ref.cast.Casting)4 LString (lucee.runtime.interpreter.ref.literal.LString)4 FunctionLibFunction (lucee.transformer.library.function.FunctionLibFunction)4 FunctionLibFunctionArg (lucee.transformer.library.function.FunctionLibFunctionArg)4 ExpressionException (lucee.runtime.exp.ExpressionException)3 LFunctionValue (lucee.runtime.interpreter.ref.literal.LFunctionValue)2 Key (lucee.runtime.type.Collection.Key)2 Entry (java.util.Map.Entry)1 ParserString (lucee.commons.lang.ParserString)1 ApplicationException (lucee.runtime.exp.ApplicationException)1 UDFCall (lucee.runtime.interpreter.ref.func.UDFCall)1 Scope (lucee.runtime.type.scope.Scope)1 Undefined (lucee.runtime.type.scope.Undefined)1