nitc :: ToJavaCallContext :: defaultinit
nitc $ ToJavaCallContext :: SELF
Type of this instance, automatically specialized in every classnitc $ ToJavaCallContext :: name_mtype
Which C name to use for typemtype
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: CallContext :: defaultinit
nitc :: ToJavaCallContext :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: CallContext :: name_mtype
Which C name to use for typemtype
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: CallContext
Describes the context of the code to be generated bybuild_ccall
and build_csignature
# Context in C, when call are from normal C to JNI
private class ToJavaCallContext
super CallContext
redef fun cast_to(mtype, name)
do
if mtype.java_is_nit_object then
return "nit_ffi_with_java_new_nit_object(nit_ffi_jni_env, {name})"
else
return "({mtype.jni_type})({name})"
end
end
redef fun cast_from(mtype, name)
do
if mtype.java_is_nit_object then
return "({mtype.cname})nit_ffi_with_java_nit_object_data(nit_ffi_jni_env, {name})"
else
return "({mtype.cname})({name})"
end
end
redef fun name_mtype(mtype) do return mtype.jni_type
end
src/ffi/java.nit:443,1--466,3