Skip to Main Content

Access to a field

aecordobaMay 8 2011 — edited May 11 2011
Hi there!
I have the following situation:

class A {
String aField;
...
*String getAField(){*
return aField;
}
}

class B{
A bField;
...
*A getBField(){*
return bField;
}
}

class C{
native byte[] nativeMethod(B object);

static {
System.loadLibrary("nativelib");
}

public static void main(String args[]) {
B bObject = new B();
byte[] byteArray = nativeMethod(bObject);
...
}
}

The native method will be:

JNIEXPORT jbyteArray JNICALL Java_C_nativeMethod (JNIEnv * env, jobject jobj, jobject bObject)

But, how can I access to aField (A class field) within this c (or C++) function?

Can somebody help me?

Thank you, in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Jun 8 2011
Added on May 8 2011
1 comment
86 views