例如,我有一个 Java 类:
public class JniTest {
public int member_int_;
public int member_int_2_;
public boolean member_bool_;
public static int member_static_int_ = 90;
public String member_str_;
void print() {};
}
在 JNI 中,我想在不事先知道他们名字的情况下获取每个成员:
JNIEXPORT void JNICALL Java_com_tencent_qqmail_protocol_JniMethodTest_TestObject(JNIEnv * env, jclass cls, jobject obj) {
*for (each member in obj)* { ... } //how to implement ?
}