[<<][libprim][>>][..]
Mon Dec 7 14:12:37 CET 2009

JNI & reflection

java.lang.Class
java.lang.reflect.Method
java.lang.reflect.Constructor

Something that bothers me in Method.invoke() is that the arguments are
an Object[] array.  Do they get automatically casted to native types
like int,long ?

I don't see anything of this sort, so it seems that the answer is yes:
this only supports objects.

It would be interesting to figure out if kawa can be used to perform
this reflection task..

Conclusion: java reflection API seems useful, but there are
complications if arguments are not an Object subclass.

Nope[2].  It is possible to represent primitive types as a Class object.



[1] http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html
[2] http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#isPrimitive()



[Reply][About]
[<<][libprim][>>][..]