klyn.reflection.Method.invoke
method
public native invoke(args as Object[]) as Object throws Exception
Description

Invokes a static method with dynamic arguments.

Instance methods must be invoked with invokeOn(instance, args) so the runtime has an explicit receiver.

Parameters
ParameterDescription
argsArguments as an Object[].
Returns

Boxed return value, or null for Void methods.

Throws
  • TypeError if the method is not static, is not accessible, or the arguments do not match the reflected signature.
  • Exception if the invoked method throws an exception.
Example
method = type(Application).getMethod("time")
now = method.invoke([] as Object[]) as Double