implement JNI reflection methods

These include FromReflectedMethod, ToReflectedMethod,
FromReflectedField, and ToReflectedField.
This commit is contained in:
Joel Dice
2012-12-19 12:39:33 -07:00
parent 7b07b5b9a3
commit d200019d10
6 changed files with 476 additions and 145 deletions

View File

@ -57,6 +57,50 @@ Java_JNI_doEcho__D(JNIEnv* e, jclass c, jdouble f)
(c, e->GetStaticMethodID(c, "echo", "(D)D"), array);
}
extern "C" JNIEXPORT jlong JNICALL
Java_JNI_fromReflectedMethod(JNIEnv* e, jclass, jobject method)
{
return reinterpret_cast<uintptr_t>(e->FromReflectedMethod(method));
}
extern "C" JNIEXPORT jobject JNICALL
Java_JNI_toReflectedMethod(JNIEnv* e, jclass, jclass c, jlong id,
jboolean isStatic)
{
return e->ToReflectedMethod(c, reinterpret_cast<jmethodID>(id), isStatic);
}
extern "C" JNIEXPORT jint JNICALL
Java_JNI_callStaticIntMethod(JNIEnv* e, jclass, jclass c, jlong id)
{
return e->CallStaticIntMethod(c, reinterpret_cast<jmethodID>(id));
}
extern "C" JNIEXPORT jobject JNICALL
Java_JNI_newObject(JNIEnv* e, jclass, jclass c, jlong id)
{
return e->NewObject(c, reinterpret_cast<jmethodID>(id));
}
extern "C" JNIEXPORT jlong JNICALL
Java_JNI_fromReflectedField(JNIEnv* e, jclass, jobject field)
{
return reinterpret_cast<uintptr_t>(e->FromReflectedField(field));
}
extern "C" JNIEXPORT jobject JNICALL
Java_JNI_toReflectedField(JNIEnv* e, jclass, jclass c, jlong id,
jboolean isStatic)
{
return e->ToReflectedField(c, reinterpret_cast<jfieldID>(id), isStatic);
}
extern "C" JNIEXPORT jint JNICALL
Java_JNI_getStaticIntField(JNIEnv* e, jclass, jclass c, jlong id)
{
return e->GetStaticIntField(c, reinterpret_cast<jfieldID>(id));
}
extern "C" JNIEXPORT jobject JNICALL
Java_Buffers_allocateNative(JNIEnv* e, jclass, jint capacity)
{