src/libtsduck/java/private/tsjni.cpp
//----------------------------------------------------------------------------
// Get/set the value of object fields in a Java object.
//----------------------------------------------------------------------------
Get/set the value of object fields in a Java object.
Get / set the value of object fields in a Java object .
jobject ts::jni::GetObjectField(JNIEnv* env, jobject obj, const char* fieldName, const char* signature)
{
    if (env == nullptr || obj == nullptr || fieldName == nullptr || signature == nullptr || env->ExceptionCheck()) {
        return nullptr;
    }
    const jfieldID fid = env->GetFieldID(env->GetObjectClass(obj), fieldName, signature);
    if (fid == nullptr) {
        return nullptr;
    }
    return env->GetObjectField(obj, fid);
}
jobject ts :: jni :: GetObjectField ( JNIEnv * env , jobject obj , const char * fieldName , const char * signature ) { if ( env == nullptr || obj == nullptr || fieldName == nullptr || signature == nullptr || env -> ExceptionCheck ( ) ) { return nullptr ; } const jfieldID fid = env -> GetFieldID ( env -> GetObjectClass ( obj ) , fieldName , signature ) ; if ( fid == nullptr ) { return nullptr ; } return env -> GetObjectField ( obj , fid ) ; }
Get/set the value of object fields in a Java object.
Get / set the value of object fields in a Java object .