jvm :: JavaObject
jvm :: JavaObject :: defaultinit
jvm :: JavaObject :: new_global_ref
Returns a global reference to the Java object behind this referencejvm :: JavaObject :: pop_from_local_frame
Pops the current local reference frame and return a valid reference to selfjvm :: JavaObject :: pop_from_local_frame_with_env
Java implementation ofpop_from_local_frame
jvm :: JavaObject :: to_java_string
JavaString
representation of self
using Java's toString
jvm $ JavaObject :: SELF
Type of this instance, automatically specialized in every classjava :: ffi_support $ JavaObject :: to_s
Use Java'stoString
for any JavaObject
core :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
jvm :: JavaObject :: defaultinit
core :: Pointer :: 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.
jvm :: JavaObject :: new_global_ref
Returns a global reference to the Java object behind this referencecore :: Object :: output_class_name
Display class name on stdout (debug only).jvm :: JavaObject :: pop_from_local_frame
Pops the current local reference frame and return a valid reference to selfjvm :: JavaObject :: pop_from_local_frame_with_env
Java implementation ofpop_from_local_frame
jvm :: JavaObject :: to_java_string
JavaString
representation of self
using Java's toString
android :: Android_widget_Adapter
Java class: android.widget.Adapterandroid :: Android_widget_Checkable
Java class: android.widget.Checkableandroid :: NativeAssetFileDescriptor
Android AssetFileDescriptor, can be retrieve by AssetManager and used to load a sound in a SoundPooljava :: NativeFile
android.net.wifi.ScanResult
android.net.wifi.WifiManager
android :: Android_widget_AbsListView
Java class: android.widget.AbsListViewandroid :: Android_widget_ArrayAdapter
Java class: android.widget.ArrayAdapterandroid :: Android_widget_BaseAdapter
Java class: android.widget.BaseAdapterandroid :: Android_widget_CheckBox
Java class: android.widget.CheckBoxandroid :: Android_widget_CompoundButton
Java abstract class: android.widget.CompoundButtonandroid :: Android_widget_ListAdapter
Java class: android.widget.ListAdapterandroid :: Android_widget_ListView
Java class: android.widget.ListViewandroid :: Android_widget_SpinnerAdapter
Java class: android.widget.SpinnerAdapterandroid :: NativeNativeActivity
Android SDK'sandroid.app.NativeActivity
.
# Represens a jni jobject
extern class JavaObject in "Java" `{ java.lang.Object `}
end
lib/jvm/jvm.nit:438,1--440,3
redef extern class JavaObject
# Returns a global reference to the Java object behind this reference
#
# You must use a global reference when keeping a Java object
# across execution of Java code, per JNI specification.
fun new_global_ref: SELF import sys, Sys.jni_env `{
Sys sys = JavaObject_sys(self);
JNIEnv *env = Sys_jni_env(sys);
return (*env)->NewGlobalRef(env, self);
`}
# Delete this global reference
fun delete_global_ref import sys, Sys.jni_env `{
Sys sys = JavaObject_sys(self);
JNIEnv *env = Sys_jni_env(sys);
(*env)->DeleteGlobalRef(env, self);
`}
# Delete this local reference
fun delete_local_ref import sys, Sys.jni_env `{
Sys sys = JavaObject_sys(self);
JNIEnv *env = Sys_jni_env(sys);
(*env)->DeleteLocalRef(env, self);
`}
# Pops the current local reference frame and return a valid reference to self
#
# Similar to `JavaVM::pop_local_frame` but returns a value.
fun pop_from_local_frame: SELF
do
var jni_env = sys.jni_env
return pop_from_local_frame_with_env(jni_env)
end
# Java implementation of `pop_from_local_frame`
protected fun pop_from_local_frame_with_env(jni_env: JniEnv): SELF `{
return (*jni_env)->PopLocalFrame(jni_env, self);
`}
# Is `self` null in Java?
#
# Since Java type system doesn't have the same `nullable` concept as Nit's,
# the two systems are not directly compatible. Any Nit instances of
# `JavaObject` may hold a Java null.
#
# To benefit from the safer type system of Nit, it is recommended to check
# the return of all extern methods implemented in Java to ensure the value
# is not a Java null. In case it is, you should replace it by a normal Nit
# `null`.
fun is_java_null: Bool in "Java" `{ return self == null; `}
# `JavaString` representation of `self` using Java's `toString`
fun to_java_string: JavaString in "Java" `{ return self.toString(); `}
# Use Java's `toString` for any `JavaObject`
redef fun to_s
do
if is_java_null then return "<{inspect_head}:null>"
return to_java_string.to_s
end
end
lib/java/ffi_support.nit:139,1--200,3
redef class JavaObject
private fun is_exception: Bool in "Java" `{ return self instanceof Exception; `}
private fun as_exception: JavaException in "Java" `{ return (Exception)self; `}
private fun is_http_response: Bool in "Java" `{ return self instanceof HttpResponse; `}
private fun as_http_response: JavaHttpResponse in "Java" `{ return (HttpResponse)self; `}
end
lib/android/http_request.nit:94,1--100,3