protected JObject(JObject other) { if (other != null) { this.native = other.native; this.avoidDelete = false; // stop the destructor of the object being // copied to delete the local reference to the // Java object other.avoidDelete = true; } }
public JObjectArray(JObject[] source, JClass clazz) : this(source.Length, clazz) { int l = source.Length; for (int i = 0; i < l; i++) { JObject o = source[i]; if (o != null) { SetObjectArrayElement (this.Handle, i, o.Handle); } } // TODO ArrayIndexOutOfBoundsException // TODO ArrayStoreException JThrowable.CheckAndThrow (); }
public bool GetBool(JObject obj) { bool r; if (isStatic) { r = GetStaticBooleanField ( DeclaringClass.Handle, Handle); } else { if (obj == null) { throw new NullReferenceException (Name); } else { r = GetBooleanField (obj.Handle, Handle); } } JThrowable.CheckAndThrow (); return r; }
protected Prog(JObject other) : base(other) { }
public JWeak(JObject obj) : base(NewWeakGlobalRef (obj.Handle)) { }
public object Invoke(JObject obj, JValue[] args) { if (sig != null && rType == JMethodReturnType.INVALID) { DetermineReturnType (); } // all arrays are objects if (isArray) { return CallObject (obj, args); } // if not an array, call right method based on signature switch (rType) { case JMethodReturnType.BOOL: return CallBoolean (obj, args); case JMethodReturnType.BYTE: return CallByte (obj, args); case JMethodReturnType.CHAR: return CallChar (obj, args); case JMethodReturnType.SHORT: return CallShort (obj, args); case JMethodReturnType.INT: return CallInt (obj, args); case JMethodReturnType.LONG: return CallLong (obj, args); case JMethodReturnType.FLOAT: return CallFloat (obj, args); case JMethodReturnType.DOUBLE: return CallDouble (obj, args); case JMethodReturnType.VOID: CallVoid (obj, args); return null; case JMethodReturnType.OBJECT: return CallObject (obj, args); default: throw new SystemException ("Unreachable reached"); } }
public void CallVoid(JObject obj, params object[] args) { CallVoid (obj, JValue.Convert (args)); }
public short CallShort(JObject obj, params object[] args) { return CallShort (obj, JValue.Convert (args)); }
public JObject CallObject(JObject obj, JValue[] args) { IntPtr r; if (isStatic) { r = CallStaticObjectMethod ( DeclaringClass.Handle, Handle, args); } else { r = CallObjectMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); return new JObject (r); }
public long CallLong(JObject obj, JValue[] args) { long r; if (isStatic) { r = CallStaticLongMethod ( DeclaringClass.Handle, Handle, args); } else { r = CallLongMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); return r; }
public JObjectArray(JObject other) : base(other) { }
public void SetShort(JObject obj, short value) { if (isStatic) { SetStaticShortField ( DeclaringClass.Handle, Handle, value); } else { if (obj == null) { throw new NullReferenceException (Name); } else { SetShortField ( obj.Handle, Handle, value); } } JThrowable.CheckAndThrow (); }
public short GetShort(JObject obj) { short r; if (isStatic) { r = GetStaticShortField ( DeclaringClass.Handle, Handle); } else { if (obj == null) { throw new NullReferenceException (Name); } else { r = GetShortField (obj.Handle, Handle); } } JThrowable.CheckAndThrow (); return r; }
public JObject GetObject(JObject obj) { IntPtr raw; if (isStatic) { raw = GetStaticObjectField ( DeclaringClass.Handle, Handle); } else { if (obj == null) { throw new NullReferenceException (Name); } else { raw = GetObjectField (obj.Handle, Handle); } } return new JObject (raw); }
public char GetChar(JObject obj) { ushort r; if (isStatic) { r = GetStaticCharField ( DeclaringClass.Handle, Handle); } else { if (obj == null) { throw new NullReferenceException (Name); } else { r = GetCharField (obj.Handle, Handle); } } JThrowable.CheckAndThrow (); return (char) r; }
public float CallFloat(JObject obj, params object[] args) { return CallFloat (obj, JValue.Convert (args)); }
public int CallInt(JObject obj, params object[] args) { return CallInt (obj, JValue.Convert (args)); }
public bool CallBoolean(JObject obj, JValue[] args) { bool r; if (isStatic) { r = CallStaticBooleanMethod ( DeclaringClass.Handle, Handle, args); } else { r = CallBooleanMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); return r; }
public long CallLong(JObject obj, params object[] args) { return CallLong (obj, JValue.Convert (args)); }
public bool CallBoolean(JObject obj, params object[] args) { return CallBoolean (obj, JValue.Convert (args)); }
public short CallShort(JObject obj, JValue[] args) { short r; if (isStatic) { r = CallStaticShortMethod ( DeclaringClass.Handle, Handle, args); } else { r = CallShortMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); return r; }
public sbyte CallByte(JObject obj, params object[] args) { return CallByte (obj, JValue.Convert (args)); }
public void CallVoid(JObject obj, JValue[] args) { if (isStatic) { CallStaticVoidMethod ( DeclaringClass.Handle, Handle, args); } else { CallVoidMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); }
public char CallChar(JObject obj, JValue[] args) { ushort r; if (isStatic) { r = CallStaticCharMethod ( DeclaringClass.Handle, Handle, args); } else { r = CallCharMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); return (char) r; }
// convenience method // not used by generated code since it requires // boxing/unboxing on return type (performance) public object Invoke(JObject obj, params object[] args) { return Invoke (obj, JValue.Convert (args)); }
public char CallChar(JObject obj, params object[] args) { return CallChar (obj, JValue.Convert (args)); }
public JString(JObject obj) : base(obj.Handle) { }
public double CallDouble(JObject obj, JValue[] args) { double r; if (isStatic) { r = CallStaticDoubleMethod ( DeclaringClass.Handle, Handle, args); } else { r = CallDoubleMethod ( obj.Handle, Handle, args); } JThrowable.CheckAndThrow (); return r; }
public bool IsInstance(JObject obj) { return IsInstanceOf (obj.Handle, this.Handle); }
public double CallDouble(JObject obj, params object[] args) { return CallDouble (obj, JValue.Convert (args)); }