| // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| |
| // Autogenerated; DO NOT EDIT |
| // Generated by running the script in tool/gen_aux_methods.dart |
| // coverage:ignore-file |
| part of 'jni_object.dart'; |
| |
| extension JniObjectCallMethods on JniObject { |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| String callStringMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallObjectMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| final strRes = _env.asDartString(result, deleteOriginal: true); |
| _env.checkException(); |
| return strRes; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callStringMethod]. |
| String callStringMethodByName( |
| String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callStringMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| String getStringField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetObjectField(_obj, fieldID); |
| final strRes = _env.asDartString(result, deleteOriginal: true); |
| _env.checkException(); |
| return strRes; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| String getStringFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getStringField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| JniObject callObjectMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallObjectMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return JniObject.of(_env, result, nullptr); |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callObjectMethod]. |
| JniObject callObjectMethodByName( |
| String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callObjectMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| JniObject getObjectField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetObjectField(_obj, fieldID); |
| |
| _env.checkException(); |
| return JniObject.of(_env, result, nullptr); |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| JniObject getObjectFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getObjectField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| bool callBooleanMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallBooleanMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result != 0; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callBooleanMethod]. |
| bool callBooleanMethodByName( |
| String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callBooleanMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| bool getBooleanField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetBooleanField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result != 0; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| bool getBooleanFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getBooleanField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| int callByteMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallByteMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callByteMethod]. |
| int callByteMethodByName(String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callByteMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| int getByteField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetByteField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| int getByteFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getByteField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| int callCharMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallCharMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callCharMethod]. |
| int callCharMethodByName(String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callCharMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| int getCharField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetCharField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| int getCharFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getCharField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| int callShortMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallShortMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callShortMethod]. |
| int callShortMethodByName(String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callShortMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| int getShortField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetShortField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| int getShortFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getShortField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| int callIntMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallIntMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callIntMethod]. |
| int callIntMethodByName(String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callIntMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| int getIntField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetIntField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| int getIntFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getIntField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| int callLongMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallLongMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callLongMethod]. |
| int callLongMethodByName(String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callLongMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| int getLongField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetLongField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| int getLongFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getLongField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| double callFloatMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallFloatMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callFloatMethod]. |
| double callFloatMethodByName( |
| String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callFloatMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| double getFloatField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetFloatField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| double getFloatFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getFloatField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| double callDoubleMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallDoubleMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callDoubleMethod]. |
| double callDoubleMethodByName( |
| String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callDoubleMethod(mID, args); |
| return result; |
| } |
| |
| /// Retrieves the value of the field denoted by [fieldID] |
| double getDoubleField(JFieldID fieldID) { |
| _checkDeleted(); |
| final result = _env.GetDoubleField(_obj, fieldID); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Retrieve field of given [name] and [signature] |
| double getDoubleFieldByName(String name, String signature) { |
| final fID = getFieldID(name, signature); |
| final result = getDoubleField(fID); |
| return result; |
| } |
| |
| /// Calls method pointed to by [methodID] with [args] as arguments |
| void callVoidMethod(JMethodID methodID, List<dynamic> args) { |
| _checkDeleted(); |
| final jvArgs = JValueArgs(args, _env); |
| final result = _env.CallVoidMethodA(_obj, methodID, jvArgs.values); |
| jvArgs.disposeIn(_env); |
| calloc.free(jvArgs.values); |
| |
| _env.checkException(); |
| return result; |
| } |
| |
| /// Looks up method with [name] and [signature], calls it with [args] as arguments. |
| /// If calling the same method multiple times, consider using [getMethodID] |
| /// and [callVoidMethod]. |
| void callVoidMethodByName(String name, String signature, List<dynamic> args) { |
| final mID = getMethodID(name, signature); |
| final result = callVoidMethod(mID, args); |
| return result; |
| } |
| } |