Image

Imagesparkymark wrote in Imagejava_dev

JNI signature of inner class?

I have a class Clazz that can be initialised by passing in static fields of itself...

public class Clazz {
   public final static Inner MY_TRUE = new Inner();
   public final static Inner MY_FALSE = new Inner();
   public Clazz(Inner x) { ... }
   private static class Inner {}
}

So from Java I can initialise an instance of Clazz with Clazz(Clazz.MY_TRUE) without the caller needing access to the name of the inner class.

Is it possible to create an object of Clazz from JNI? Does the JNI code need to know the signature of the "" methods (i.e. constructor), and if so what is it ( "Clazz$Inner" ?) and is it accessible via an arbitrary JNI call ( i.e. not from a native method of Clazz)?

resolved: javap -p -s pointed me to the solution