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

Invokes the method on an instance.

Parameters
ParameterDescription
instanceTarget object.
argsArguments as an Object[].
Returns

Boxed return value, or null for Void methods.

Throws
  • TypeError if the target is null, is not compatible with the declaring class, the method is not accessible, or the arguments do not match the reflected signature.
  • Exception if the invoked method throws an exception.
Example
method = type(user).getMethod("rename", true, type(""))
method.invokeOn(user, ["root"] as Object[])