LObject NewObjectArray(jsize length,const AbstractObject& elementClass,const AbstractObject& initialElement) { jclass jElementClass=(jclass)elementClass.GetJObject(); jobject jInitialElement=initialElement.GetJObject(); jobject array=GetEnv()->NewObjectArray(length,jElementClass,jInitialElement); TranslateJavaException(); return LObject::WrapLocal(array); }
void Throw(const AbstractObject& throwable) { jthrowable jThrowable=(jthrowable)throwable.GetJObject(); int error=GetEnv()->Throw(jThrowable); if (error) { FatalError("Throw() failed with %d error.",error); } }
void SetBoolArrayRegion(const AbstractObject& array,jsize start,jsize length,const bool* buffer) { jbooleanArray jArray=(jbooleanArray)array.GetJObject(); if (JBooleanIsBool) { GetEnv()->SetBooleanArrayRegion(jArray,start,length,(const jboolean*)buffer); } else { FatalError("jni::SetBoolArrayRegion is not implemented yet."); } }
void ReleaseBoolArrayElements(const AbstractObject& array,bool* elements,jint mode) { jbooleanArray jArray=(jbooleanArray)array.GetJObject(); if (JBooleanIsBool) { GetEnv()->ReleaseBooleanArrayElements(jArray,(jboolean*)elements,mode); } else { FatalError("jni::ReleaseBoolArrayElements is not implemented yet."); } }
void SetObjectArrayElement(const AbstractObject& array,jsize index,const AbstractObject& value) { jobjectArray jArray=(jobjectArray)array.GetJObject(); jobject jValue=value.GetJObject(); GetEnv()->SetObjectArrayElement(jArray,index,jValue); TranslateJavaException(); }
LObject GetObjectArrayElement(const AbstractObject& array,jsize index) { jobjectArray jArray=(jobjectArray)array.GetJObject(); jobject object=GetEnv()->GetObjectArrayElement(jArray,index); TranslateJavaException(); return LObject::WrapLocal(object); }
jsize GetArrayLength(const AbstractObject& array) { jarray jArray=(jarray)array.GetJObject(); return GetEnv()->GetArrayLength(jArray); }
jfieldID GetStaticFieldID(const AbstractObject& clazz,const char* name,const char* signature) { jclass jClazz=(jclass)clazz.GetJObject(); jfieldID result=GetEnv()->GetStaticFieldID(jClazz,name,signature); TranslateJavaException(); return result; }
bool IsSameObject(const AbstractObject& object1,const AbstractObject& object2) { jobject jObject1=object1.GetJObject(); jobject jObject2=object2.GetJObject(); return GetEnv()->IsSameObject(jObject1,jObject2)==JNI_TRUE; }
bool IsAssignableFrom(const AbstractObject& clazz,const AbstractObject& clazzFrom) { jclass jClazz=(jclass)clazz.GetJObject(); jclass jClazzFrom=(jclass)clazzFrom.GetJObject(); return GetEnv()->IsAssignableFrom(jClazz,jClazzFrom)==JNI_TRUE; }
LObject GetSuperclass(const AbstractObject& clazz) { jclass jClazz=(jclass)clazz.GetJObject(); return LObject::WrapLocal(GetEnv()->GetSuperclass(jClazz)); }
LObject GetObjectClass(const AbstractObject& object) { jobject javaObject=object.GetJObject(); return LObject::WrapLocal(GetEnv()->GetObjectClass(javaObject)); }