diff --git a/src/Mono.Android/Android.Runtime/JValue.cs b/src/Mono.Android/Android.Runtime/JValue.cs index 5adece43f03..db7821d928b 100644 --- a/src/Mono.Android/Android.Runtime/JValue.cs +++ b/src/Mono.Android/Android.Runtime/JValue.cs @@ -3,6 +3,16 @@ namespace Android.Runtime { + /// + /// Represents a JNI jvalue union, used to pass arguments to Java methods + /// via JNI function calls. + /// + /// + /// + /// Each constructor corresponds to one of the JNI primitive types or an object reference. + /// See the JNI Type Specification. + /// + /// [StructLayout(LayoutKind.Explicit)] public struct JValue { #pragma warning disable 0414 @@ -17,62 +27,122 @@ public struct JValue { [FieldOffset(0)] IntPtr l; #pragma warning restore 0414 + /// + /// A representing a JNI NULL object reference. + /// public static JValue Zero = new JValue (IntPtr.Zero); + /// + /// Creates a from a value, + /// corresponding to the JNI jboolean type. + /// + /// The Boolean value. public JValue (bool value) { this = new JValue (); z = value; } + /// + /// Creates a from an value, + /// corresponding to the JNI jbyte type. + /// + /// The signed byte value. public JValue (sbyte value) { this = new JValue (); b = value; } + /// + /// Creates a from a value, + /// corresponding to the JNI jchar type. + /// + /// The character value. public JValue (char value) { this = new JValue (); c = value; } + /// + /// Creates a from a value, + /// corresponding to the JNI jshort type. + /// + /// The short integer value. public JValue (short value) { this = new JValue (); s = value; } + /// + /// Creates a from an value, + /// corresponding to the JNI jint type. + /// + /// The integer value. public JValue (int value) { this = new JValue (); i = value; } + /// + /// Creates a from a value, + /// corresponding to the JNI jlong type. + /// + /// The long integer value. public JValue (long value) { this = new JValue (); j = value; } + /// + /// Creates a from a value, + /// corresponding to the JNI jfloat type. + /// + /// The single-precision floating-point value. public JValue (float value) { this = new JValue (); f = value; } + /// + /// Creates a from a value, + /// corresponding to the JNI jdouble type. + /// + /// The double-precision floating-point value. public JValue (double value) { this = new JValue (); d = value; } + /// + /// Creates a from an value, + /// corresponding to a JNI jobject reference. + /// + /// The raw JNI object reference handle. public JValue (IntPtr value) { this = new JValue (); l = value; } + /// + /// Creates a from an instance, + /// corresponding to a JNI jobject reference. + /// + /// + /// The Java object instance. If , the resulting + /// will contain . + /// + /// + /// This constructor extracts the from the + /// provided object, or passes if the object is . + /// public JValue (IJavaObject value) { this = new JValue ();