callNonvirtualShortMethod

context(env: JniEnv)
fun JObject.callNonvirtualShortMethod(clazz: JClass, methodId: JMethodID, args: JArguments): Short(source)

Invokes an instance (nonstatic) method on a Java object, according to the specified class and method ID. The methodId argument must be obtained by calling methodId on the class clazz.

Unlike callShortMethod which invokes the method based on the class or interface of the object, this method invokes the method based on the class, designated by the clazz parameter, from which the method ID is obtained.

The method ID must be obtained from the real class of the object or from one of its supertypes.

callNonvirtual<type>Method routines are the mechanism for invoking "default interface methods" introduced in Java 8.

You should use this function only if the Java method you are calling returns short values.

Return

the result of calling the Java method.

Throws

Exceptions raised during the execution of the Java method.