if ((flags & COM.DISPATCH_METHOD) != 0) {
// implicit call -- "m()"
return callMethod(classLoader, null, params, method);
} else if ((flags & COM.DISPATCH_PROPERTYGET) != 0) {
// implicit toString -- "'foo' + m"
return new Variant(toString());
}
break;
case 1:
// "m.toString()"
if ((flags & (COM.DISPATCH_METHOD | COM.DISPATCH_PROPERTYGET)) != 0) {
return new Variant(toString());
}
break;
case 2:
// "m.call(thisObj, arg)"
if ((flags & COM.DISPATCH_METHOD) != 0) {
/*
* First param must be a this object of the correct type (for instance
* methods). If method is static, it can be null.
*/
Object jthis = JsValueGlue.get(new JsValueIE6(params[0]),
method.getDeclaringClass(), "this");
Variant[] otherParams = new Variant[params.length - 1];
System.arraycopy(params, 1, otherParams, 0, otherParams.length);
return callMethod(classLoader, jthis, otherParams, method);
}
break;
case IDispatchProxy.DISPID_MAGIC_GETGLOBALREF:
// We are NOT in fact a "wrapped Java Object", but we don't want to
// throw an exception for being asked.
return new Variant(0);
default:
// The specified member id is out of range.
throw new HResultException(COM.DISP_E_MEMBERNOTFOUND);
}
throw new HResultException(COM.E_NOTSUPPORTED);