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
Post Details
Added on May 8 2011
1 comment
83 views