callStaticMethod

fun Class<*>.callStaticMethod(methodName: String, args: Args, argTypes: ArgTypes = argTypes(), returnType: Class<*>? = null): Any?

调用静态方法。

val result = targetClass.callStaticMethod("getInstance", args())

fun Class<*>.callStaticMethod(methodName: String, vararg args: Any?): Any?

自动匹配参数并调用静态方法。

val result = targetClass.callStaticMethod("getInstance")