public byte CallByteMethod(JavaObject obj, MethodId methodIdNative, params Value[] args) { byte res = callByteMethod(envPtr, obj.JvmHandle, methodIdNative.native, args); ExceptionTest(); return(res); }
public double CallDoubleMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { double res = callDoubleMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return(res); }
public short CallShortMethod(JavaObject obj, MethodId methodIdNative, params Value[] args) { short res = callShortMethod(envPtr, obj.JvmHandle, methodIdNative.native, args); ExceptionTest(); return(res); }
public long CallLongMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { long res = callLongMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return(res); }
public char CallCharMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { var res = (char)callCharMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return(res); }
public bool CallBooleanMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { bool res = callBooleanMethod(envPtr, obj, methodIdNative.native, args) != 0; ExceptionTest(); return(res); }
public float CallNonVirtualFloatMethod(JavaObject obj, JniHandle clazz, MethodId methodIdNative, params Value[] args) { var res = callNonvirtualFloatMethod(envPtr, obj.JvmHandle, clazz, methodIdNative.native, args); ExceptionTest(); return(res); }
public double CallNonVirtualDoubleMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args) { var res = callNonvirtualDoubleMethod(envPtr, obj, clazz, methodIdNative.native, args); ExceptionTest(); return(res); }
public byte CallStaticByteMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { byte res = callStaticByteMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return(res); }
public JniLocalHandle CallStaticObjectMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { JniLocalHandle res = callStaticObjectMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return(res); }
public short CallStaticShortMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { short res = callStaticShortMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return(res); }
public float CallFloatMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { float res = callFloatMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return(res); }
public JniLocalHandle NewObject(JniHandle clazz, MethodId methodID, params Value[] args) { JniLocalHandle res = newObject(envPtr, clazz, methodID.native, args); ExceptionTest(); return(res); }
public JniLocalHandle ToReflectedMethod(JniHandle cls, MethodId methodId, bool isStatic) { JniLocalHandle res = toReflectedMethod.Invoke(envPtr, cls, methodId.native, isStatic ? (byte)1 : (byte)0); ExceptionTest(); return(res); }
private static void InitializeClassMethods(JNIEnv env) { if (!mHasInitializedClassMethods) { JniLocalHandle classClass = env.FindClass("java/lang/Class"); mGetName = env.GetMethodID(classClass, "getName", "()Ljava/lang/String;"); mGetCanonicalName = env.GetMethodID(classClass, "getCanonicalName", "()Ljava/lang/String;"); mGetSuperclass = env.GetMethodID(classClass, "getSuperclass", "()Ljava/lang/Class;"); mHasInitializedClassMethods = true; } }
public JavaVM(IntPtr native) { if (defaultVM != null) throw new Exception("Why is a second VM being initialized?"); this.native = native; defaultVM = this; functions = *(*(JavaPtr*) native.ToPointer()).functions; Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThreadAsDaemon, ref attachCurrentThreadAsDaemon); Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThread, ref attachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.DestroyJavaVM, ref destroyJavaVM); Helper.GetDelegateForFunctionPointer(functions.DetachCurrentThread, ref detachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.GetEnv, ref getEnv); var env = JNIEnv.ThreadEnv; var classLoaderClass = env.FindClass("java/lang/ClassLoader"); findClass = env.GetMethodID(classLoaderClass, "findClass", "(Ljava/lang/String;)Ljava/lang/Class;"); }
public char CallCharMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { var res = (char) callCharMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return res; }
public byte CallByteMethod(JavaObject obj, MethodId methodIdNative, params Value[] args) { byte res = callByteMethod(envPtr, obj.JvmHandle, methodIdNative.native, args); ExceptionTest(); return res; }
public JniLocalHandle NewObject(JniHandle clazz, MethodId methodID, params Value[] args) { JniLocalHandle res = newObject(envPtr, clazz, methodID.native, args); ExceptionTest(); return res; }
public void CallNonVirtualVoidMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args) { callNonvirtualVoidMethod(envPtr, obj, clazz, methodIdNative.native, args); ExceptionTest(); }
public bool CallBooleanMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { bool res = callBooleanMethod(envPtr, obj, methodIdNative.native, args) != 0; ExceptionTest(); return res; }
public JniLocalHandle ToReflectedMethod(JniHandle cls, MethodId methodId, bool isStatic) { JniLocalHandle res = toReflectedMethod.Invoke(envPtr, cls, methodId.native, isStatic ? (byte) 1 : (byte) 0); ExceptionTest(); return res; }
public void CallStaticVoidMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { callStaticVoidMethod(envPtr, clazz, methodIdNative.native, args); //TODO result could be tested in Java 1.6 ExceptionTest(); }
public byte CallStaticByteMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { byte res = callStaticByteMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return res; }
public long CallStaticLongMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { long res = callStaticLongMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return res; }
public short CallNonVirtualShortMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args) { var res = callNonvirtualShortMethod(envPtr, obj, clazz, methodIdNative.native, args); ExceptionTest(); return res; }
public IntPtr CallNonVirtualObjectMethodPtr(JavaObject obj, JniHandle clazz, MethodId methodIdNative, params Value[] args) { var res = callNonvirtualObjectMethod(envPtr, obj.JvmHandle, clazz, methodIdNative.native, args); ExceptionTest(); return res; }
internal void CallStaticVoidMethod(JniHandle clazz, string method, string sig, params Value[] args) { MethodId idNative = GetStaticMethodID(clazz, method, sig); CallStaticVoidMethod(clazz, idNative, args); }
public int CallIntMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { int res = callIntMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return res; }
public double CallDoubleMethod(JniHandle obj, MethodId methodIdNative, params Value[] args) { double res = callDoubleMethod(envPtr, obj, methodIdNative.native, args); ExceptionTest(); return res; }
public short CallStaticShortMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { short res = callStaticShortMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return res; }
public float CallFloatMethod(JavaObject obj, MethodId methodIdNative, params Value[] args) { float res = callFloatMethod(envPtr, obj.JvmHandle, methodIdNative.native, args); ExceptionTest(); return res; }
public JniLocalHandle CallStaticObjectMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args) { JniLocalHandle res = callStaticObjectMethod(envPtr, clazz, methodIdNative.native, args); ExceptionTest(); return res; }
public void CallVoidMethod(JniHandle obj, MethodId methodId, params Value[] args) { callVoidMethod(envPtr, obj, methodId.native, args); //TODO result could be tested in Java 1.6 ExceptionTest(); }
public long CallLongMethod(JavaObject obj, MethodId methodIdNative, params Value[] args) { long res = callLongMethod(envPtr, obj.JvmHandle, methodIdNative.native, args); ExceptionTest(); return res; }