use of lucee.runtime.type.scope.ArgumentImpl in project Lucee by lucee.
the class ComponentImpl method onMissingMethod.
public Object onMissingMethod(PageContext pc, int access, Member member, String name, Object[] _args, Struct _namedArgs, boolean superAccess) throws PageException {
Member ommm = access == -1 ? getMember(pc, KeyConstants._onmissingmethod, false, superAccess) : getMember(access, KeyConstants._onmissingmethod, false, superAccess);
if (ommm instanceof UDF) {
Argument args = new ArgumentImpl();
if (_args != null) {
for (int i = 0; i < _args.length; i++) {
args.setEL(ArgumentIntKey.init(i + 1), _args[i]);
}
} else if (_namedArgs != null) {
UDFUtil.argumentCollection(_namedArgs, new FunctionArgument[] {});
Iterator<Entry<Key, Object>> it = _namedArgs.entryIterator();
Entry<Key, Object> e;
while (it.hasNext()) {
e = it.next();
args.setEL(e.getKey(), e.getValue());
}
}
// Struct newArgs=new StructImpl(StructImpl.TYPE_SYNC);
// newArgs.setEL(MISSING_METHOD_NAME, name);
// newArgs.setEL(MISSING_METHOD_ARGS, args);
Object[] newArgs = new Object[] { name, args };
return _call(pc, KeyConstants._onmissingmethod, (UDFPlus) ommm, null, newArgs);
}
if (member == null)
throw ComponentUtil.notFunction(this, KeyImpl.init(name), null, access);
throw ComponentUtil.notFunction(this, KeyImpl.init(name), member.getValue(), access);
}
Aggregations