[jnigen] `JniX` to `JX` rename (https://github.com/dart-lang/jnigen/issues/126)
Closed https://github.com/dart-lang/jnigen/issues/124.
Closed https://github.com/dart-lang/jnigen/issues/125.
* Added `JPrimitive` and its subclasses instead of using the typedefs from `ffi` directly.
* Renamed `JniObject`, `JniString`, and ... to the shorter `JObject`, JString`, and ...
* Made tests more robust by deleting the objects in an arena.
diff --git a/pkgs/jni/example/integration_test/on_device_jni_test.dart b/pkgs/jni/example/integration_test/on_device_jni_test.dart
index 0cc2411..2bc0d9a 100644
--- a/pkgs/jni/example/integration_test/on_device_jni_test.dart
+++ b/pkgs/jni/example/integration_test/on_device_jni_test.dart
@@ -22,7 +22,7 @@
}
}
- testWidgets("Long.intValue() using JniObject", (t) async {
+ testWidgets("Long.intValue() using JObject", (t) async {
final longClass = Jni.findJniClass("java/lang/Long");
final longCtor = longClass.getCtorID("(J)V");
@@ -38,7 +38,7 @@
testWidgets("call a static method using JniClass APIs", (t) async {
final integerClass = JniClass.fromRef(Jni.findClass("java/lang/Integer"));
- final result = integerClass.callStaticMethodByName<JniString>(
+ final result = integerClass.callStaticMethodByName<JString>(
"toHexString", "(I)Ljava/lang/String;", [31]);
final resultString = result.toDartString();
@@ -116,7 +116,7 @@
});
testWidgets("enums", (t) async {
- final ordinal = Jni.retrieveStaticField<JniObject>(
+ final ordinal = Jni.retrieveStaticField<JObject>(
"java/net/Proxy\$Type", "HTTP", "Ljava/net/Proxy\$Type;")
.use((f) => f.callMethodByName<int>("ordinal", "()I", []));
expect(ordinal, equals(1));
diff --git a/pkgs/jni/example/lib/main.dart b/pkgs/jni/example/lib/main.dart
index 00088e5..b23b279 100644
--- a/pkgs/jni/example/lib/main.dart
+++ b/pkgs/jni/example/lib/main.dart
@@ -15,7 +15,7 @@
// GlobalJniEnv is a thin abstraction over JNIEnv in JNI C API.
//
// For a more ergonomic API for common use cases of calling methods and
-// accessing fields, see next examples using JniObject and JniClass.
+// accessing fields, see next examples using JObject and JniClass.
String toJavaStringUsingEnv(int n) => using((arena) {
final env = Jni.env;
final cls = env.FindClass("java/lang/String".toNativeChars(arena));
@@ -56,7 +56,7 @@
}
void quit() {
- JniObject.fromRef(Jni.getCurrentActivity())
+ JObject.fromRef(Jni.getCurrentActivity())
.use((ac) => ac.callMethodByName<void>("finish", "()V", []));
}
@@ -68,7 +68,7 @@
// In this example, Toaster class wraps android.widget.Toast so that it
// can be called from any thread. See
// android/app/src/main/java/com/github/dart_lang/jni_example/Toaster.java
- Jni.invokeStaticMethod<JniObject>(
+ Jni.invokeStaticMethod<JObject>(
"com/github/dart_lang/jni_example/Toaster",
"makeText",
"(Landroid/app/Activity;Landroid/content/Context;"
@@ -100,7 +100,7 @@
"android/os/Build", "DEVICE", "Ljava/lang/String;")),
Example(
"Package name",
- () => JniObject.fromRef(Jni.getCurrentActivity()).use((activity) =>
+ () => JObject.fromRef(Jni.getCurrentActivity()).use((activity) =>
activity.callMethodByName<String>(
"getPackageName", "()Ljava/lang/String;", [])),
),
diff --git a/pkgs/jni/ffigen.yaml b/pkgs/jni/ffigen.yaml
index 73b9f75..8286855 100644
--- a/pkgs/jni/ffigen.yaml
+++ b/pkgs/jni/ffigen.yaml
@@ -55,32 +55,34 @@
- '__builtin_va_list'
rename:
'JNI(.*)': 'Jni$1'
- 'jint': 'JInt'
- 'jclass': 'JClass'
- 'jobject': 'JObject'
- 'jbyte': 'JByte'
- 'jsize': 'JSize'
- 'jmethodID': 'JMethodID'
- 'jfieldID': 'JFieldID'
- 'jboolean': 'JBoolean'
- 'jthrowable': 'JThrowable'
- 'jchar': 'JChar'
- 'jshort': 'JShort'
- 'jlong': 'JLong'
- 'jfloat': 'JFloat'
- 'jdouble': 'JDouble'
- 'jstring': 'JString'
- 'jarray': 'JArray'
- 'jobjectArray': 'JObjectArray'
- 'jbooleanArray': 'JBooleanArray'
- 'jbyteArray': 'JByteArray'
- 'jcharArray': 'JCharArray'
- 'jshortArray': 'JShortArray'
- 'jintArray': 'JIntArray'
- 'jlongArray': 'JLongArray'
- 'jfloatArray': 'JFloatArray'
- 'jdoubleArray': 'JDoubleArray'
- 'jweak': 'JWeak'
+ # Primitives
+ 'jbyte': 'JByteMarker'
+ 'jboolean': 'JBooleanMarker'
+ 'jchar': 'JCharMarker'
+ 'jshort': 'JShortMarker'
+ 'jint': 'JIntMarker'
+ 'jlong': 'JLongMarker'
+ 'jfloat': 'JFloatMarker'
+ 'jdouble': 'JDoubleMarker'
+ 'jsize': 'JSizeMarker'
+
+ 'jclass': 'JClassPtr'
+ 'jobject': 'JObjectPtr'
+ 'jmethodID': 'JMethodIDPtr'
+ 'jfieldID': 'JFieldIDPtr'
+ 'jthrowable': 'JThrowablePtr'
+ 'jstring': 'JStringPtr'
+ 'jarray': 'JArrayPtr'
+ 'jobjectArray': 'JObjectArrayPtr'
+ 'jbooleanArray': 'JBooleanArrayPtr'
+ 'jbyteArray': 'JByteArrayPtr'
+ 'jcharArray': 'JCharArrayPtr'
+ 'jshortArray': 'JShortArrayPtr'
+ 'jintArray': 'JIntArrayPtr'
+ 'jlongArray': 'JLongArrayPtr'
+ 'jfloatArray': 'JFloatArrayPtr'
+ 'jdoubleArray': 'JDoubleArrayPtr'
+ 'jweak': 'JWeakPtr'
'jvalue': 'JValue'
preamble: |
// Autogenerated file. Do not edit.
diff --git a/pkgs/jni/lib/internal_helpers_for_jnigen.dart b/pkgs/jni/lib/internal_helpers_for_jnigen.dart
index 9f44e7a..0ad5ce1 100644
--- a/pkgs/jni/lib/internal_helpers_for_jnigen.dart
+++ b/pkgs/jni/lib/internal_helpers_for_jnigen.dart
@@ -7,5 +7,5 @@
library internal_helpers_for_jnigen;
export 'src/jni.dart' show ProtectedJniExtensions;
-export 'src/jni_object.dart' show JniReference;
+export 'src/types.dart' show JReference;
export 'src/accessors.dart';
diff --git a/pkgs/jni/lib/jni.dart b/pkgs/jni/lib/jni.dart
index 4437e8e..72ef7582 100644
--- a/pkgs/jni/lib/jni.dart
+++ b/pkgs/jni/lib/jni.dart
@@ -64,8 +64,7 @@
hide JniBindings, JniEnv, JniEnv1, JniExceptionDetails;
export 'src/jni.dart' hide ProtectedJniExtensions;
export 'src/jvalues.dart' hide JValueArgs, toJValues;
-export 'src/jni_exceptions.dart';
-export 'src/jni_object.dart' hide JniReference;
+export 'src/types.dart' hide JReference;
export 'package:ffi/ffi.dart' show using, Arena;
export 'dart:ffi' show nullptr;
diff --git a/pkgs/jni/lib/src/accessors.dart b/pkgs/jni/lib/src/accessors.dart
index 383cfaa..6d01865 100644
--- a/pkgs/jni/lib/src/accessors.dart
+++ b/pkgs/jni/lib/src/accessors.dart
@@ -9,9 +9,9 @@
import 'third_party/jni_bindings_generated.dart';
import 'jni.dart';
-import 'jni_exceptions.dart';
+import 'types.dart';
-void _check(JThrowable exception) {
+void _check(JThrowablePtr exception) {
if (exception != nullptr) {
Jni.accessors.throwException(exception);
}
@@ -55,7 +55,7 @@
return result.d;
}
- JObject get object {
+ JObjectPtr get object {
check();
return result.l;
}
@@ -67,12 +67,12 @@
}
extension JniIdLookupResultMethods on JniPointerResult {
- JMethodID get methodID {
+ JMethodIDPtr get methodID {
_check(exception);
return id.cast<jmethodID_>();
}
- JFieldID get fieldID {
+ JFieldIDPtr get fieldID {
_check(exception);
return id.cast<jfieldID_>();
}
@@ -84,7 +84,7 @@
}
extension JniClassLookupResultMethods on JniClassLookupResult {
- JClass get checkedClassRef {
+ JClassPtr get checkedClassRef {
_check(exception);
return classRef;
}
@@ -95,7 +95,7 @@
///
/// The original exception object is deleted by this method. The message
/// and Java stack trace are included in the exception.
- void throwException(JThrowable exception) {
+ void throwException(JThrowablePtr exception) {
final details = getExceptionDetails(exception);
final env = Jni.env;
final message = env.asDartString(details.message);
@@ -108,42 +108,45 @@
// TODO(PR): How to name these methods? These only wrap toNativeChars()
// so that generated bindings are less verbose.
- JClass getClassOf(String internalName) =>
+ JClassPtr getClassOf(String internalName) =>
using((arena) => getClass(internalName.toNativeChars(arena)))
.checkedClassRef;
- JMethodID getMethodIDOf(JClass cls, String name, String signature) =>
+ JMethodIDPtr getMethodIDOf(JClassPtr cls, String name, String signature) =>
using((arena) => getMethodID(
cls, name.toNativeChars(arena), signature.toNativeChars(arena)))
.methodID;
- JMethodID getStaticMethodIDOf(JClass cls, String name, String signature) =>
+ JMethodIDPtr getStaticMethodIDOf(
+ JClassPtr cls, String name, String signature) =>
using((arena) => getStaticMethodID(
cls, name.toNativeChars(arena), signature.toNativeChars(arena)))
.methodID;
- JFieldID getFieldIDOf(JClass cls, String name, String signature) =>
+ JFieldIDPtr getFieldIDOf(JClassPtr cls, String name, String signature) =>
using((arena) => getFieldID(
cls, name.toNativeChars(arena), signature.toNativeChars(arena)))
.fieldID;
- JFieldID getStaticFieldIDOf(JClass cls, String name, String signature) =>
+ JFieldIDPtr getStaticFieldIDOf(
+ JClassPtr cls, String name, String signature) =>
using((arena) => getStaticFieldID(
cls, name.toNativeChars(arena), signature.toNativeChars(arena)))
.fieldID;
- JniResult newObjectWithArgs(JClass cls, JMethodID ctor, List<dynamic> args) =>
+ JniResult newObjectWithArgs(
+ JClassPtr cls, JMethodIDPtr ctor, List<dynamic> args) =>
using((arena) {
return newObject(cls, ctor, toJValues(args, allocator: arena));
});
JniResult callMethodWithArgs(
- JObject obj, JMethodID id, int callType, List<dynamic> args) =>
+ JObjectPtr obj, JMethodIDPtr id, int callType, List<dynamic> args) =>
using((arena) =>
callMethod(obj, id, callType, toJValues(args, allocator: arena)));
JniResult callStaticMethodWithArgs(
- JClass cls, JMethodID id, int callType, List<dynamic> args) =>
+ JClassPtr cls, JMethodIDPtr id, int callType, List<dynamic> args) =>
using((arena) => callStaticMethod(
cls, id, callType, toJValues(args, allocator: arena)));
}
diff --git a/pkgs/jni/lib/src/jni_array.dart b/pkgs/jni/lib/src/jarray.dart
similarity index 71%
rename from pkgs/jni/lib/src/jni_array.dart
rename to pkgs/jni/lib/src/jarray.dart
index f8e69c8..8ce6b30 100644
--- a/pkgs/jni/lib/src/jni_array.dart
+++ b/pkgs/jni/lib/src/jarray.dart
@@ -4,17 +4,25 @@
// ignore_for_file: unnecessary_cast
-part of 'jni_object.dart';
+part of 'types.dart';
-class JniArray<E> extends JniObject {
+class _JArrayType<T> extends JType<JArray<T>> {
+ final JType<T> elementType;
+
+ const _JArrayType(this.elementType);
+
+ @override
+ String get signature => '[${elementType.signature}';
+}
+
+class JArray<E> extends JObject {
/// The type which includes information such as the signature of this class.
- static JniType<JniArray<T>> type<T>(JniType<T> innerType) =>
- _JniArrayType(innerType);
+ static JType<JArray<T>> type<T>(JType<T> innerType) => _JArrayType(innerType);
- /// Construct a new [JniArray] with [reference] as its underlying reference.
- JniArray.fromRef(JArray reference) : super.fromRef(reference);
+ /// Construct a new [JArray] with [reference] as its underlying reference.
+ JArray.fromRef(JArrayPtr reference) : super.fromRef(reference);
- JniArray(JniType<E> typeClass, int length)
+ JArray(JType<E> typeClass, int length)
: super.fromRef(
(typeClass._type == JniCallType.objectType)
? _accessors
@@ -39,23 +47,26 @@
}
}
-extension NativeJniArray<E extends NativeType> on JniArray<E> {
- void _allocate(int size, void Function(Pointer<E> ptr) use) {
+extension NativeArray<E extends JPrimitive> on JArray<E> {
+ void _allocate<T extends NativeType>(
+ int size,
+ void Function(Pointer<T> ptr) use,
+ ) {
using((arena) {
- final ptr = arena.allocate<E>(size);
+ final ptr = arena.allocate<T>(size);
use(ptr);
}, malloc);
}
}
-extension BoolJniArray on JniArray<JBoolean> {
+extension BoolArray on JArray<JBoolean> {
bool operator [](int index) {
return elementAt(index, JniCallType.booleanType).boolean;
}
void operator []=(int index, bool value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JBoolean>(), (ptr) {
+ _allocate<JBooleanMarker>(sizeOf<JBooleanMarker>(), (ptr) {
ptr.value = value ? 1 : 0;
_env.SetBooleanArrayRegion(reference, index, 1, ptr);
});
@@ -66,7 +77,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JBoolean>() * size, (ptr) {
+ _allocate<JBooleanMarker>(sizeOf<JBooleanMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element ? 1 : 0;
});
@@ -75,14 +86,14 @@
}
}
-extension ByteJniArray on JniArray<JByte> {
+extension ByteArray on JArray<JByte> {
int operator [](int index) {
return elementAt(index, JniCallType.byteType).byte;
}
void operator []=(int index, int value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JByte>(), (ptr) {
+ _allocate<JByteMarker>(sizeOf<JByteMarker>(), (ptr) {
ptr.value = value;
_env.SetByteArrayRegion(reference, index, 1, ptr);
});
@@ -93,7 +104,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JByte>() * size, (ptr) {
+ _allocate<JByteMarker>(sizeOf<JByteMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element;
});
@@ -102,7 +113,7 @@
}
}
-extension CharJniArray on JniArray<JChar> {
+extension CharArray on JArray<JChar> {
String operator [](int index) {
return String.fromCharCode(
elementAt(index, JniCallType.charType).char,
@@ -111,7 +122,7 @@
void operator []=(int index, String value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JChar>(), (ptr) {
+ _allocate<JCharMarker>(sizeOf<JCharMarker>(), (ptr) {
ptr.value = value.codeUnits.first;
_env.SetCharArrayRegion(reference, index, 1, ptr);
});
@@ -122,7 +133,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JChar>() * size, (ptr) {
+ _allocate<JCharMarker>(sizeOf<JCharMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element.codeUnits.first;
});
@@ -131,14 +142,14 @@
}
}
-extension ShortJniArray on JniArray<JShort> {
+extension ShortArray on JArray<JShort> {
int operator [](int index) {
return elementAt(index, JniCallType.shortType).short;
}
void operator []=(int index, int value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JShort>(), (ptr) {
+ _allocate<JShortMarker>(sizeOf<JShortMarker>(), (ptr) {
ptr.value = value;
_env.SetShortArrayRegion(reference, index, 1, ptr);
});
@@ -149,7 +160,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JShort>() * size, (ptr) {
+ _allocate<JShortMarker>(sizeOf<JShortMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element;
});
@@ -158,14 +169,14 @@
}
}
-extension IntJniArray on JniArray<JInt> {
+extension IntArray on JArray<JInt> {
int operator [](int index) {
return elementAt(index, JniCallType.intType).integer;
}
void operator []=(int index, int value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JInt>(), (ptr) {
+ _allocate<JIntMarker>(sizeOf<JIntMarker>(), (ptr) {
ptr.value = value;
_env.SetIntArrayRegion(reference, index, 1, ptr);
});
@@ -176,7 +187,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JInt>() * size, (ptr) {
+ _allocate<JIntMarker>(sizeOf<JIntMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element;
});
@@ -185,14 +196,14 @@
}
}
-extension LongJniArray on JniArray<JLong> {
+extension LongArray on JArray<JLong> {
int operator [](int index) {
return elementAt(index, JniCallType.longType).long;
}
void operator []=(int index, int value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JLong>(), (ptr) {
+ _allocate<JLongMarker>(sizeOf<JLongMarker>(), (ptr) {
ptr.value = value;
_env.SetLongArrayRegion(reference, index, 1, ptr);
});
@@ -203,7 +214,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JLong>() * size, (ptr) {
+ _allocate<JLongMarker>(sizeOf<JLongMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element;
});
@@ -212,14 +223,14 @@
}
}
-extension FloatJniArray on JniArray<JFloat> {
+extension FloatArray on JArray<JFloat> {
double operator [](int index) {
return elementAt(index, JniCallType.floatType).float;
}
void operator []=(int index, double value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JFloat>(), (ptr) {
+ _allocate<JFloatMarker>(sizeOf<JFloatMarker>(), (ptr) {
ptr.value = value;
_env.SetFloatArrayRegion(reference, index, 1, ptr);
});
@@ -230,7 +241,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JFloat>() * size, (ptr) {
+ _allocate<JFloatMarker>(sizeOf<JFloatMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element;
});
@@ -239,14 +250,14 @@
}
}
-extension DoubleJniArray on JniArray<JDouble> {
+extension DoubleArray on JArray<JDouble> {
double operator [](int index) {
return elementAt(index, JniCallType.doubleType).doubleFloat;
}
void operator []=(int index, double value) {
RangeError.checkValidIndex(index, this);
- _allocate(sizeOf<JDouble>(), (ptr) {
+ _allocate<JDoubleMarker>(sizeOf<JDoubleMarker>(), (ptr) {
ptr.value = value;
_env.SetDoubleArrayRegion(reference, index, 1, ptr);
});
@@ -257,7 +268,7 @@
RangeError.checkValidRange(start, end, length);
final size = end - start;
final it = iterable.skip(skipCount).take(size);
- _allocate(sizeOf<JDouble>() * size, (ptr) {
+ _allocate<JDoubleMarker>(sizeOf<JDoubleMarker>() * size, (ptr) {
it.forEachIndexed((index, element) {
ptr[index] = element;
});
@@ -266,17 +277,17 @@
}
}
-extension ObjectJniArray<T extends JniObject> on JniArray<T> {
- JniObject operator [](int index) {
- return JniObject.fromRef(elementAt(index, JniCallType.objectType).object);
+extension ObjectArray<T extends JObject> on JArray<T> {
+ JObject operator [](int index) {
+ return JObject.fromRef(elementAt(index, JniCallType.objectType).object);
}
- void operator []=(int index, JniObject value) {
+ void operator []=(int index, JObject value) {
RangeError.checkValidIndex(index, this);
_env.SetObjectArrayElement(reference, index, value.reference);
}
- void setRange(int start, int end, Iterable<JniObject> iterable,
+ void setRange(int start, int end, Iterable<JObject> iterable,
[int skipCount = 0]) {
RangeError.checkValidRange(start, end, length);
final size = end - start;
@@ -287,22 +298,22 @@
}
}
-extension ArrayJniArray<T> on JniArray<JniArray<T>> {
- JniArray<T> operator [](int index) {
- return JniArray<T>.fromRef(elementAt(index, JniCallType.objectType).object);
+extension ArrayArray<T> on JArray<JArray<T>> {
+ JArray<T> operator [](int index) {
+ return JArray<T>.fromRef(elementAt(index, JniCallType.objectType).object);
}
- void operator []=(int index, JniArray<T> value) {
- (this as JniArray<JniObject>)[index] = value;
+ void operator []=(int index, JArray<T> value) {
+ (this as JArray<JObject>)[index] = value;
}
}
-extension StringJniArray on JniArray<JniString> {
- JniString operator [](int index) {
- return JniString.fromRef(elementAt(index, JniCallType.objectType).object);
+extension StringArray on JArray<JString> {
+ JString operator [](int index) {
+ return JString.fromRef(elementAt(index, JniCallType.objectType).object);
}
- void operator []=(int index, JniString value) {
- (this as JniArray<JniObject>)[index] = value;
+ void operator []=(int index, JString value) {
+ (this as JArray<JObject>)[index] = value;
}
}
diff --git a/pkgs/jni/lib/src/jni_exceptions.dart b/pkgs/jni/lib/src/jexceptions.dart
similarity index 77%
rename from pkgs/jni/lib/src/jni_exceptions.dart
rename to pkgs/jni/lib/src/jexceptions.dart
index 45df05d..a9a3cfc 100644
--- a/pkgs/jni/lib/src/jni_exceptions.dart
+++ b/pkgs/jni/lib/src/jexceptions.dart
@@ -2,11 +2,11 @@
// 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.
-import 'dart:ffi';
+part of 'types.dart';
-import 'third_party/jni_bindings_generated.dart';
+abstract class JException implements Exception {}
-class UseAfterFreeException implements Exception {
+class UseAfterFreeException implements JException {
dynamic object;
Pointer<Void> ptr;
UseAfterFreeException(this.object, this.ptr);
@@ -17,20 +17,20 @@
}
}
-class NullJniStringException implements Exception {
+class NullJStringException implements JException {
@override
- String toString() => 'toDartString called on null JniString reference';
+ String toString() => 'toDartString called on null JString reference';
}
-class InvalidJniStringException implements Exception {
+class InvalidJStringException implements JException {
Pointer<Void> reference;
- InvalidJniStringException(this.reference);
+ InvalidJStringException(this.reference);
@override
String toString() => 'Not a valid Java String: '
'0x${reference.address.toRadixString(16)}';
}
-class DoubleFreeException implements Exception {
+class DoubleFreeException implements JException {
dynamic object;
Pointer<Void> ptr;
DoubleFreeException(this.object, this.ptr);
@@ -41,12 +41,12 @@
}
}
-class JvmExistsException implements Exception {
+class JvmExistsException implements JException {
@override
String toString() => 'A JVM already exists';
}
-class NoJvmInstanceException implements Exception {
+class NoJvmInstanceException implements JException {
@override
String toString() => 'No JNI instance is available';
}
@@ -67,7 +67,7 @@
String str() => _names[this]!;
}
-class InvalidCallTypeException implements Exception {
+class InvalidCallTypeException implements JException {
int type;
Set<int> allowed;
InvalidCallTypeException(this.type, this.allowed);
@@ -76,7 +76,7 @@
'Allowed types are ${allowed.map((t) => t.str()).toSet()}';
}
-class JniException implements Exception {
+class JniException implements JException {
/// Error message from Java exception.
final String message;
@@ -89,7 +89,7 @@
'$message\n\n$stackTrace\n';
}
-class HelperNotFoundException implements Exception {
+class HelperNotFoundException implements JException {
HelperNotFoundException(this.path);
final String path;
diff --git a/pkgs/jni/lib/src/jni.dart b/pkgs/jni/lib/src/jni.dart
index 96ba918..7d32996 100644
--- a/pkgs/jni/lib/src/jni.dart
+++ b/pkgs/jni/lib/src/jni.dart
@@ -10,8 +10,7 @@
import 'third_party/jni_bindings_generated.dart';
import 'jvalues.dart';
-import 'jni_exceptions.dart';
-import 'jni_object.dart';
+import 'types.dart';
import 'accessors.dart';
String _getLibraryFileName(String base) {
@@ -152,22 +151,22 @@
static Pointer<JniAccessors> get accessors => _bindings.GetAccessors();
/// Returns current application context on Android.
- static JObject getCachedApplicationContext() {
+ static JObjectPtr getCachedApplicationContext() {
return _bindings.GetApplicationContext();
}
/// Returns current activity
- static JObject getCurrentActivity() => _bindings.GetCurrentActivity();
+ static JObjectPtr getCurrentActivity() => _bindings.GetCurrentActivity();
/// Get the initial classLoader of the application.
///
/// This is especially useful on Android, where
/// JNI threads cannot access application classes using
/// the usual `JniEnv.FindClass` method.
- static JObject getApplicationClassLoader() => _bindings.GetClassLoader();
+ static JObjectPtr getApplicationClassLoader() => _bindings.GetClassLoader();
/// Returns class reference found through system-specific mechanism
- static JClass findClass(String qualifiedName) => using((arena) {
+ static JClassPtr findClass(String qualifiedName) => using((arena) {
final cls = accessors.getClass(qualifiedName.toNativeChars(arena));
return cls.checkedClassRef;
});
@@ -181,7 +180,7 @@
///
/// Use it when one instance is needed, but the constructor or class aren't
/// required themselves.
- static JniObject newInstance(
+ static JObject newInstance(
String qualifiedName, String ctorSignature, List<dynamic> args) {
final cls = findJniClass(qualifiedName);
final ctor = cls.getCtorID(ctorSignature);
@@ -202,7 +201,7 @@
/// Returns the value of static field identified by [fieldName] & [signature].
///
- /// See [JniObject.getField] for more explanations about [callType] and [T].
+ /// See [JObject.getField] for more explanations about [callType] and [T].
static T retrieveStaticField<T>(
String className, String fieldName, String signature,
[int? callType]) {
@@ -215,8 +214,8 @@
/// Calls static method identified by [methodName] and [signature]
/// on [className] with [args] as and [callType].
///
- /// For more explanation on [args] and [callType], see [JniObject.getField]
- /// and [JniObject.callMethod] respectively.
+ /// For more explanation on [args] and [callType], see [JObject.getField]
+ /// and [JObject.callMethod] respectively.
static T invokeStaticMethod<T>(
String className, String methodName, String signature, List<dynamic> args,
[int? callType]) {
@@ -228,7 +227,7 @@
}
/// Delete all references in [objects].
- static void deleteAll(List<JniReference> objects) {
+ static void deleteAll(List<JReference> objects) {
for (var object in objects) {
object.delete();
}
@@ -257,28 +256,28 @@
}
extension AdditionalEnvMethods on Pointer<GlobalJniEnv> {
- /// Convenience method for converting a [JString]
+ /// Convenience method for converting a [JStringPtr]
/// to dart string.
/// if [deleteOriginal] is specified, jstring passed will be deleted using
/// DeleteLocalRef.
- String asDartString(JString jstring, {bool deleteOriginal = false}) {
- if (jstring == nullptr) {
- throw NullJniStringException();
+ String asDartString(JStringPtr jstringPtr, {bool deleteOriginal = false}) {
+ if (jstringPtr == nullptr) {
+ throw NullJStringException();
}
- final chars = GetStringUTFChars(jstring, nullptr);
+ final chars = GetStringUTFChars(jstringPtr, nullptr);
if (chars == nullptr) {
- throw InvalidJniStringException(jstring);
+ throw InvalidJStringException(jstringPtr);
}
final result = chars.cast<Utf8>().toDartString();
- ReleaseStringUTFChars(jstring, chars);
+ ReleaseStringUTFChars(jstringPtr, chars);
if (deleteOriginal) {
- DeleteGlobalRef(jstring);
+ DeleteGlobalRef(jstringPtr);
}
return result;
}
- /// Return a new [JString] from contents of [s].
- JString asJString(String s) => using((arena) {
+ /// Return a new [JStringPtr] from contents of [s].
+ JStringPtr asJString(String s) => using((arena) {
final utf = s.toNativeUtf8().cast<Char>();
final result = NewStringUTF(utf);
malloc.free(utf);
@@ -286,7 +285,7 @@
});
/// Deletes all references in [refs].
- void deleteAllRefs(List<JObject> refs) {
+ void deleteAllRefs(List<JObjectPtr> refs) {
for (final ref in refs) {
DeleteGlobalRef(ref);
}
diff --git a/pkgs/jni/lib/src/jni_type_class.dart b/pkgs/jni/lib/src/jni_type_class.dart
deleted file mode 100644
index 27b8636..0000000
--- a/pkgs/jni/lib/src/jni_type_class.dart
+++ /dev/null
@@ -1,118 +0,0 @@
-// 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.
-
-part of 'jni_object.dart';
-
-abstract class JniType<T> {
- const JniType();
-
- int get _type => JniCallType.objectType;
-
- String get signature;
-
- JniClass _getClass() => Jni.findJniClass(signature);
-}
-
-class JniBooleanType extends JniType<JBoolean> {
- const JniBooleanType();
-
- @override
- int get _type => JniCallType.booleanType;
-
- @override
- String get signature => "Z";
-}
-
-class JniByteTypeClass extends JniType<JByte> {
- const JniByteTypeClass();
-
- @override
- int get _type => JniCallType.byteType;
-
- @override
- String get signature => "B";
-}
-
-class JniCharType extends JniType<JChar> {
- const JniCharType();
-
- @override
- int get _type => JniCallType.charType;
-
- @override
- String get signature => "C";
-}
-
-class JniShortType extends JniType<JShort> {
- const JniShortType();
-
- @override
- int get _type => JniCallType.shortType;
-
- @override
- String get signature => "S";
-}
-
-class JniIntType extends JniType<JInt> {
- const JniIntType();
-
- @override
- int get _type => JniCallType.intType;
-
- @override
- String get signature => "I";
-}
-
-class JniLongType extends JniType<JLong> {
- const JniLongType();
-
- @override
- int get _type => JniCallType.longType;
-
- @override
- String get signature => "J";
-}
-
-class JniFloatType extends JniType<JFloat> {
- const JniFloatType();
-
- @override
- int get _type => JniCallType.floatType;
-
- @override
- String get signature => "F";
-}
-
-class JniDoubleType extends JniType<JDouble> {
- const JniDoubleType();
-
- @override
- int get _type => JniCallType.doubleType;
-
- @override
- String get signature => "D";
-}
-
-class _JniObjectType extends JniType<JniObject> {
- const _JniObjectType();
-
- @override
- String get signature => "Ljava/lang/Object;";
-}
-
-class _JniStringType extends JniType<JniString> {
- const _JniStringType();
-
- @override
- String get signature => "Ljava/lang/String;";
-}
-
-class _JniArrayType<T> extends JniType<JniArray<T>> {
- final JniType<T> elementType;
-
- const _JniArrayType(this.elementType);
-
- @override
- String get signature => '[${elementType.signature}';
-}
diff --git a/pkgs/jni/lib/src/jni_object.dart b/pkgs/jni/lib/src/jobject.dart
similarity index 61%
rename from pkgs/jni/lib/src/jni_object.dart
rename to pkgs/jni/lib/src/jobject.dart
index ddb78a7..1ec850a 100644
--- a/pkgs/jni/lib/src/jni_object.dart
+++ b/pkgs/jni/lib/src/jobject.dart
@@ -2,83 +2,15 @@
// 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.
-import 'dart:ffi';
+part of 'types.dart';
-import 'package:collection/collection.dart';
-import 'package:ffi/ffi.dart';
+class _JObjectType extends JType<JObject> {
+ const _JObjectType();
-import 'accessors.dart';
-import 'jni.dart';
-import 'jni_exceptions.dart';
-import 'jvalues.dart';
-import 'third_party/jni_bindings_generated.dart';
-
-part 'jni_array.dart';
-part 'jni_type_class.dart';
-
-// This typedef is needed because void is a keyword and cannot be used in
-// type switch like a regular type.
-typedef _VoidType = void;
-
-/// A class which holds one or more JNI references, and has a `delete` operation
-/// which disposes the reference(s).
-abstract class JniReference implements Finalizable {
- static final _finalizer = NativeFinalizer(_env.ref.DeleteGlobalRef);
-
- JniReference.fromRef(this.reference) {
- _finalizer.attach(this, reference, detach: this);
- }
-
- bool _deleted = false;
-
- void _ensureNotDeleted() {
- if (_deleted) throw UseAfterFreeException(this, reference);
- }
-
- /// Check whether the underlying JNI reference is `null`.
- bool get isNull => reference == nullptr;
-
- /// Returns whether this object is deleted.
- bool get isDeleted => _deleted;
-
- /// Deletes the underlying JNI reference. Further uses will throw
- /// [UseAfterFreeException].
- void delete() {
- if (_deleted) {
- throw DoubleFreeException(this, reference);
- }
- _deleted = true;
- _finalizer.detach(this);
- _env.DeleteGlobalRef(reference);
- }
-
- /// The underlying JNI global object reference.
- final JObject reference;
-
- /// Registers this object to be deleted at the end of [arena]'s lifetime.
- void deletedIn(Arena arena) => arena.onReleaseAll(delete);
+ @override
+ String get signature => "Ljava/lang/Object;";
}
-extension JniReferenceUseExtension<T extends JniReference> on T {
- /// Applies [callback] on [this] object and then delete the underlying JNI
- /// reference, returning the result of [callback].
- R use<R>(R Function(T) callback) {
- _ensureNotDeleted();
- try {
- final result = callback(this);
- delete();
- return result;
- } catch (e) {
- delete();
- rethrow;
- }
- }
-}
-
-final Pointer<JniAccessors> _accessors = Jni.accessors;
-
-final Pointer<GlobalJniEnv> _env = Jni.env;
-
Pointer<T> _getID<T extends NativeType>(
JniPointerResult Function(
Pointer<Void> ptr, Pointer<Char> name, Pointer<Char> sig)
@@ -150,14 +82,14 @@
}
break;
case String:
- case JniObject:
- case JniString:
+ case JObject:
+ case JString:
finalCallType = _getCallType(
callType, JniCallType.objectType, {JniCallType.objectType});
final ref = function(finalCallType).object;
final ctor = T == String
? (ref) => _env.asDartString(ref, deleteOriginal: true)
- : (T == JniObject ? JniObject.fromRef : JniString.fromRef);
+ : (T == JObject ? JObject.fromRef : JString.fromRef);
result = ctor(ref) as T;
break;
case _VoidType:
@@ -190,12 +122,12 @@
/// A high-level wrapper for JNI global object reference.
///
/// This is the base class for classes generated by `jnigen`.
-class JniObject extends JniReference {
+class JObject extends JReference {
/// The type which includes information such as the signature of this class.
- static const JniType<JniObject> type = _JniObjectType();
+ static const JType<JObject> type = _JObjectType();
- /// Construct a new [JniObject] with [reference] as its underlying reference.
- JniObject.fromRef(JObject reference) : super.fromRef(reference);
+ /// Construct a new [JObject] with [reference] as its underlying reference.
+ JObject.fromRef(JObjectPtr reference) : super.fromRef(reference);
JniClass? _jniClass;
@@ -211,7 +143,7 @@
super.delete();
}
- // TODO(#55): Support casting JniObject subclasses
+ // TODO(#55): Support casting JObject subclasses
/// Returns [JniClass] corresponding to concrete class of this object.
///
@@ -225,29 +157,29 @@
return JniClass.fromRef(classRef);
}
- /// Get [JFieldID] of instance field identified by [fieldName] & [signature].
- JFieldID getFieldID(String fieldName, String signature) {
+ /// Get [JFieldIDPtr] of instance field identified by [fieldName] & [signature].
+ JFieldIDPtr getFieldID(String fieldName, String signature) {
_ensureNotDeleted();
return _getID(
_accessors.getFieldID, _class.reference, fieldName, signature);
}
- /// Get [JFieldID] of static field identified by [fieldName] & [signature].
- JFieldID getStaticFieldID(String fieldName, String signature) {
+ /// Get [JFieldIDPtr] of static field identified by [fieldName] & [signature].
+ JFieldIDPtr getStaticFieldID(String fieldName, String signature) {
_ensureNotDeleted();
return _getID<jfieldID_>(
_accessors.getStaticFieldID, _class.reference, fieldName, signature);
}
- /// Get [JMethodID] of instance method [methodName] with [signature].
- JMethodID getMethodID(String methodName, String signature) {
+ /// Get [JMethodIDPtr] of instance method [methodName] with [signature].
+ JMethodIDPtr getMethodID(String methodName, String signature) {
_ensureNotDeleted();
return _getID<jmethodID_>(
_accessors.getMethodID, _class.reference, methodName, signature);
}
- /// Get [JMethodID] of static method [methodName] with [signature].
- JMethodID getStaticMethodID(String methodName, String signature) {
+ /// Get [JMethodIDPtr] of static method [methodName] with [signature].
+ JMethodIDPtr getStaticMethodID(String methodName, String signature) {
_ensureNotDeleted();
return _getID<jmethodID_>(
_accessors.getStaticMethodID, _class.reference, methodName, signature);
@@ -258,11 +190,11 @@
/// [callType] determines the return type of the underlying JNI call made.
/// If the Java field is of `long` type, this must be [JniCallType.longType] and
/// so on. Default is chosen based on return type [T], which maps int -> int,
- /// double -> double, void -> void, and JniObject types to `Object`.
+ /// double -> double, void -> void, and JObject types to `Object`.
///
- /// If [T] is String or [JniObject], required conversions are performed and
+ /// If [T] is String or [JObject], required conversions are performed and
/// final value is returned.
- T getField<T>(JFieldID fieldID, [int? callType]) {
+ T getField<T>(JFieldIDPtr fieldID, [int? callType]) {
_ensureNotDeleted();
if (callType == JniCallType.voidType) {
throw ArgumentError("void is not a valid field type.");
@@ -282,7 +214,7 @@
/// Get value of the static field using [fieldID].
///
/// See [getField] for an explanation about [callType] parameter.
- T getStaticField<T>(JFieldID fieldID, [int? callType]) {
+ T getStaticField<T>(JFieldIDPtr fieldID, [int? callType]) {
if (callType == JniCallType.voidType) {
throw ArgumentError("void is not a valid field type.");
}
@@ -302,10 +234,10 @@
/// Call the method using [methodID],
///
/// [args] can consist of primitive types, JNI primitive wrappers such as
- /// [JValueLong], strings, and subclasses of [JniObject].
+ /// [JValueLong], strings, and subclasses of [JObject].
///
/// See [getField] for an explanation about [callType] and return type [T].
- T callMethod<T>(JMethodID methodID, List<dynamic> args, [int? callType]) {
+ T callMethod<T>(JMethodIDPtr methodID, List<dynamic> args, [int? callType]) {
_ensureNotDeleted();
return _callMethod<T>(callType, args,
(ct, jvs) => _accessors.callMethod(reference, methodID, ct, jvs));
@@ -322,7 +254,7 @@
/// Call static method using [methodID]. See [callMethod] and [getField] for
/// more details about [args] and [callType].
- T callStaticMethod<T>(JMethodID methodID, List<dynamic> args,
+ T callStaticMethod<T>(JMethodIDPtr methodID, List<dynamic> args,
[int? callType]) {
_ensureNotDeleted();
return _callMethod<T>(callType, args,
@@ -340,45 +272,45 @@
}
/// A high level wrapper over a JNI class reference.
-class JniClass extends JniReference {
+class JniClass extends JReference {
/// Construct a new [JniClass] with [reference] as its underlying reference.
- JniClass.fromRef(JObject reference) : super.fromRef(reference);
+ JniClass.fromRef(JObjectPtr reference) : super.fromRef(reference);
- /// Get [JFieldID] of static field [fieldName] with [signature].
- JFieldID getStaticFieldID(String fieldName, String signature) {
+ /// Get [JFieldIDPtr] of static field [fieldName] with [signature].
+ JFieldIDPtr getStaticFieldID(String fieldName, String signature) {
_ensureNotDeleted();
return _getID<jfieldID_>(
_accessors.getStaticFieldID, reference, fieldName, signature);
}
- /// Get [JMethodID] of static method [methodName] with [signature].
- JMethodID getStaticMethodID(String methodName, String signature) {
+ /// Get [JMethodIDPtr] of static method [methodName] with [signature].
+ JMethodIDPtr getStaticMethodID(String methodName, String signature) {
_ensureNotDeleted();
return _getID<jmethodID_>(
_accessors.getStaticMethodID, reference, methodName, signature);
}
- /// Get [JFieldID] of field [fieldName] with [signature].
- JFieldID getFieldID(String fieldName, String signature) {
+ /// Get [JFieldIDPtr] of field [fieldName] with [signature].
+ JFieldIDPtr getFieldID(String fieldName, String signature) {
_ensureNotDeleted();
return _getID<jfieldID_>(
_accessors.getFieldID, reference, fieldName, signature);
}
- /// Get [JMethodID] of method [methodName] with [signature].
- JMethodID getMethodID(String methodName, String signature) {
+ /// Get [JMethodIDPtr] of method [methodName] with [signature].
+ JMethodIDPtr getMethodID(String methodName, String signature) {
_ensureNotDeleted();
return _getID<jmethodID_>(
_accessors.getMethodID, reference, methodName, signature);
}
- /// Get [JMethodID] of constructor with [signature].
- JMethodID getCtorID(String signature) => getMethodID("<init>", signature);
+ /// Get [JMethodIDPtr] of constructor with [signature].
+ JMethodIDPtr getCtorID(String signature) => getMethodID("<init>", signature);
/// Get the value of static field using [fieldID].
///
- /// See [JniObject.getField] for more explanation about [callType].
- T getStaticField<T>(JFieldID fieldID, [int? callType]) {
+ /// See [JObject.getField] for more explanation about [callType].
+ T getStaticField<T>(JFieldIDPtr fieldID, [int? callType]) {
if (callType == JniCallType.voidType) {
throw ArgumentError("void is not a valid field type.");
}
@@ -397,9 +329,9 @@
/// Call the static method using [methodID].
///
- /// See [JniObject.callMethod] and [JniObject.getField] for more explanation
+ /// See [JObject.callMethod] and [JObject.getField] for more explanation
/// about [args] and [callType].
- T callStaticMethod<T>(JMethodID methodID, List<dynamic> args,
+ T callStaticMethod<T>(JMethodIDPtr methodID, List<dynamic> args,
[int? callType]) {
_ensureNotDeleted();
return _callMethod<T>(callType, args,
@@ -416,59 +348,11 @@
}
/// Create a new instance of this class with [ctor] and [args].
- JniObject newInstance(JMethodID ctor, List<dynamic> args) => using((arena) {
+ JObject newInstance(JMethodIDPtr ctor, List<dynamic> args) => using((arena) {
_ensureNotDeleted();
final jArgs = JValueArgs(args, arena);
arena.onReleaseAll(jArgs.dispose);
final res = _accessors.newObject(reference, ctor, jArgs.values).object;
- return JniObject.fromRef(res);
+ return JObject.fromRef(res);
});
}
-
-class JniString extends JniObject {
- /// The type which includes information such as the signature of this class.
- static const JniType<JniString> type = _JniStringType();
-
- /// Construct a new [JniString] with [reference] as its underlying reference.
- JniString.fromRef(JString reference) : super.fromRef(reference);
-
- static JString _toJavaString(String s) => using((arena) {
- final chars = s.toNativeUtf8(allocator: arena).cast<Char>();
- final jstr = _env.NewStringUTF(chars);
- if (jstr == nullptr) {
- throw 'Fatal: cannot convert string to Java string: $s';
- }
- return jstr;
- });
-
- /// The number of Unicode characters in this Java string.
- int get length => _env.GetStringLength(reference);
-
- /// Construct a [JniString] from the contents of Dart string [s].
- JniString.fromString(String s) : super.fromRef(_toJavaString(s));
-
- /// Returns the contents as a Dart String.
- ///
- /// If [deleteOriginal] is true, the underlying reference is deleted
- /// after conversion and this object will be marked as deleted.
- String toDartString({bool deleteOriginal = false}) {
- _ensureNotDeleted();
- if (reference == nullptr) {
- throw NullJniStringException();
- }
- final chars = _env.GetStringUTFChars(reference, nullptr);
- final result = chars.cast<Utf8>().toDartString();
- _env.ReleaseStringUTFChars(reference, chars);
- if (deleteOriginal) {
- delete();
- }
- return result;
- }
-}
-
-extension ToJniStringMethod on String {
- /// Returns a [JniString] with the contents of this String.
- JniString jniString() {
- return JniString.fromString(this);
- }
-}
diff --git a/pkgs/jni/lib/src/jprimitives.dart b/pkgs/jni/lib/src/jprimitives.dart
new file mode 100644
index 0000000..09ac4ab
--- /dev/null
+++ b/pkgs/jni/lib/src/jprimitives.dart
@@ -0,0 +1,119 @@
+// 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.
+
+part of 'types.dart';
+
+abstract class JPrimitive {}
+
+abstract class JByte extends JPrimitive {
+ static const JType<JByte> type = _JByteTypeClass();
+}
+
+class _JByteTypeClass extends JType<JByte> {
+ const _JByteTypeClass();
+
+ @override
+ int get _type => JniCallType.byteType;
+
+ @override
+ String get signature => "B";
+}
+
+abstract class JBoolean extends JPrimitive {
+ static const JType<JBoolean> type = _JBooleanType();
+}
+
+class _JBooleanType extends JType<JBoolean> {
+ const _JBooleanType();
+
+ @override
+ int get _type => JniCallType.booleanType;
+
+ @override
+ String get signature => "Z";
+}
+
+abstract class JChar extends JPrimitive {
+ static const JType<JChar> type = _JCharType();
+}
+
+class _JCharType extends JType<JChar> {
+ const _JCharType();
+
+ @override
+ int get _type => JniCallType.charType;
+
+ @override
+ String get signature => "C";
+}
+
+abstract class JShort extends JPrimitive {
+ static const JType<JShort> type = _JShortType();
+}
+
+class _JShortType extends JType<JShort> {
+ const _JShortType();
+
+ @override
+ int get _type => JniCallType.shortType;
+
+ @override
+ String get signature => "S";
+}
+
+abstract class JInt extends JPrimitive {
+ static const JType<JInt> type = _JIntType();
+}
+
+class _JIntType extends JType<JInt> {
+ const _JIntType();
+
+ @override
+ int get _type => JniCallType.intType;
+
+ @override
+ String get signature => "I";
+}
+
+abstract class JLong extends JPrimitive {
+ static const JType<JLong> type = _JLongType();
+}
+
+class _JLongType extends JType<JLong> {
+ const _JLongType();
+
+ @override
+ int get _type => JniCallType.longType;
+
+ @override
+ String get signature => "J";
+}
+
+abstract class JFloat extends JPrimitive {
+ static const JType<JFloat> type = _JFloatType();
+}
+
+class _JFloatType extends JType<JFloat> {
+ const _JFloatType();
+
+ @override
+ int get _type => JniCallType.floatType;
+
+ @override
+ String get signature => "F";
+}
+
+abstract class JDouble extends JPrimitive {
+ static const JType<JDouble> type = _JDoubleType();
+}
+
+class _JDoubleType extends JType<JDouble> {
+ const _JDoubleType();
+
+ @override
+ int get _type => JniCallType.doubleType;
+
+ @override
+ String get signature => "D";
+}
diff --git a/pkgs/jni/lib/src/jreference.dart b/pkgs/jni/lib/src/jreference.dart
new file mode 100644
index 0000000..c115e64
--- /dev/null
+++ b/pkgs/jni/lib/src/jreference.dart
@@ -0,0 +1,60 @@
+// 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.
+
+part of 'types.dart';
+
+/// A class which holds one or more JNI references, and has a `delete` operation
+/// which disposes the reference(s).
+abstract class JReference implements Finalizable {
+ static final _finalizer = NativeFinalizer(_env.ref.DeleteGlobalRef);
+
+ JReference.fromRef(this.reference) {
+ _finalizer.attach(this, reference, detach: this);
+ }
+
+ bool _deleted = false;
+
+ void _ensureNotDeleted() {
+ if (_deleted) throw UseAfterFreeException(this, reference);
+ }
+
+ /// Check whether the underlying JNI reference is `null`.
+ bool get isNull => reference == nullptr;
+
+ /// Returns whether this object is deleted.
+ bool get isDeleted => _deleted;
+
+ /// Deletes the underlying JNI reference. Further uses will throw
+ /// [UseAfterFreeException].
+ void delete() {
+ if (_deleted) {
+ throw DoubleFreeException(this, reference);
+ }
+ _deleted = true;
+ _finalizer.detach(this);
+ _env.DeleteGlobalRef(reference);
+ }
+
+ /// The underlying JNI global object reference.
+ final JObjectPtr reference;
+
+ /// Registers this object to be deleted at the end of [arena]'s lifetime.
+ void deletedIn(Arena arena) => arena.onReleaseAll(delete);
+}
+
+extension JReferenceUseExtension<T extends JReference> on T {
+ /// Applies [callback] on [this] object and then delete the underlying JNI
+ /// reference, returning the result of [callback].
+ R use<R>(R Function(T) callback) {
+ _ensureNotDeleted();
+ try {
+ final result = callback(this);
+ delete();
+ return result;
+ } catch (e) {
+ delete();
+ rethrow;
+ }
+ }
+}
diff --git a/pkgs/jni/lib/src/jstring.dart b/pkgs/jni/lib/src/jstring.dart
new file mode 100644
index 0000000..66b1935
--- /dev/null
+++ b/pkgs/jni/lib/src/jstring.dart
@@ -0,0 +1,60 @@
+// 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.
+
+part of 'types.dart';
+
+class _JStringType extends JType<JString> {
+ const _JStringType();
+
+ @override
+ String get signature => "Ljava/lang/String;";
+}
+
+class JString extends JObject {
+ /// The type which includes information such as the signature of this class.
+ static const JType<JString> type = _JStringType();
+
+ /// Construct a new [JString] with [reference] as its underlying reference.
+ JString.fromRef(JStringPtr reference) : super.fromRef(reference);
+
+ static JStringPtr _toJavaString(String s) => using((arena) {
+ final chars = s.toNativeUtf8(allocator: arena).cast<Char>();
+ final jstr = _env.NewStringUTF(chars);
+ if (jstr == nullptr) {
+ throw 'Fatal: cannot convert string to Java string: $s';
+ }
+ return jstr;
+ });
+
+ /// The number of Unicode characters in this Java string.
+ int get length => _env.GetStringLength(reference);
+
+ /// Construct a [JString] from the contents of Dart string [s].
+ JString.fromString(String s) : super.fromRef(_toJavaString(s));
+
+ /// Returns the contents as a Dart String.
+ ///
+ /// If [deleteOriginal] is true, the underlying reference is deleted
+ /// after conversion and this object will be marked as deleted.
+ String toDartString({bool deleteOriginal = false}) {
+ _ensureNotDeleted();
+ if (reference == nullptr) {
+ throw NullJStringException();
+ }
+ final chars = _env.GetStringUTFChars(reference, nullptr);
+ final result = chars.cast<Utf8>().toDartString();
+ _env.ReleaseStringUTFChars(reference, chars);
+ if (deleteOriginal) {
+ delete();
+ }
+ return result;
+ }
+}
+
+extension ToJStringMethod on String {
+ /// Returns a [JString] with the contents of this String.
+ JString toJString() {
+ return JString.fromString(this);
+ }
+}
diff --git a/pkgs/jni/lib/src/jvalues.dart b/pkgs/jni/lib/src/jvalues.dart
index 4d1a394..8718bb1 100644
--- a/pkgs/jni/lib/src/jvalues.dart
+++ b/pkgs/jni/lib/src/jvalues.dart
@@ -7,10 +7,10 @@
import 'third_party/jni_bindings_generated.dart';
import 'jni.dart';
-import 'jni_object.dart';
+import 'types.dart';
void _fillJValue(Pointer<JValue> pos, dynamic arg) {
- if (arg is JniObject) {
+ if (arg is JObject) {
pos.ref.l = arg.reference;
return;
}
@@ -117,7 +117,7 @@
/// But default allocator may be used for string conversions.
class JValueArgs {
late Pointer<JValue> values;
- final List<JObject> createdRefs = [];
+ final List<JObjectPtr> createdRefs = [];
final _env = Jni.env;
JValueArgs(List<dynamic> args, [Allocator allocator = malloc]) {
@@ -135,7 +135,7 @@
}
}
- /// Deletes temporary references such as [JString]s.
+ /// Deletes temporary references such as [JStringPtr]s.
void dispose() {
for (var ref in createdRefs) {
_env.DeleteGlobalRef(ref);
diff --git a/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart b/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart
index 0895929..45ce03e 100644
--- a/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart
+++ b/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart
@@ -105,7 +105,7 @@
late final _SpawnJvm = _SpawnJvmPtr.asFunction<
ffi.Pointer<JniEnv> Function(ffi.Pointer<JavaVMInitArgs>)>();
- JClass LoadClass(
+ JClassPtr LoadClass(
ffi.Pointer<ffi.Char> name,
) {
return _LoadClass(
@@ -114,37 +114,38 @@
}
late final _LoadClassPtr =
- _lookup<ffi.NativeFunction<JClass Function(ffi.Pointer<ffi.Char>)>>(
+ _lookup<ffi.NativeFunction<JClassPtr Function(ffi.Pointer<ffi.Char>)>>(
'LoadClass');
late final _LoadClass =
- _LoadClassPtr.asFunction<JClass Function(ffi.Pointer<ffi.Char>)>();
+ _LoadClassPtr.asFunction<JClassPtr Function(ffi.Pointer<ffi.Char>)>();
- JObject GetClassLoader() {
+ JObjectPtr GetClassLoader() {
return _GetClassLoader();
}
late final _GetClassLoaderPtr =
- _lookup<ffi.NativeFunction<JObject Function()>>('GetClassLoader');
+ _lookup<ffi.NativeFunction<JObjectPtr Function()>>('GetClassLoader');
late final _GetClassLoader =
- _GetClassLoaderPtr.asFunction<JObject Function()>();
+ _GetClassLoaderPtr.asFunction<JObjectPtr Function()>();
- JObject GetApplicationContext() {
+ JObjectPtr GetApplicationContext() {
return _GetApplicationContext();
}
late final _GetApplicationContextPtr =
- _lookup<ffi.NativeFunction<JObject Function()>>('GetApplicationContext');
+ _lookup<ffi.NativeFunction<JObjectPtr Function()>>(
+ 'GetApplicationContext');
late final _GetApplicationContext =
- _GetApplicationContextPtr.asFunction<JObject Function()>();
+ _GetApplicationContextPtr.asFunction<JObjectPtr Function()>();
- JObject GetCurrentActivity() {
+ JObjectPtr GetCurrentActivity() {
return _GetCurrentActivity();
}
late final _GetCurrentActivityPtr =
- _lookup<ffi.NativeFunction<JObject Function()>>('GetCurrentActivity');
+ _lookup<ffi.NativeFunction<JObjectPtr Function()>>('GetCurrentActivity');
late final _GetCurrentActivity =
- _GetCurrentActivityPtr.asFunction<JObject Function()>();
+ _GetCurrentActivityPtr.asFunction<JObjectPtr Function()>();
ffi.Pointer<GlobalJniEnv> GetGlobalEnv() {
return _GetGlobalEnv();
@@ -162,45 +163,45 @@
class jmethodID_ extends ffi.Opaque {}
class JValue extends ffi.Union {
- @JBoolean()
+ @JBooleanMarker()
external int z;
- @JByte()
+ @JByteMarker()
external int b;
- @JChar()
+ @JCharMarker()
external int c;
- @JShort()
+ @JShortMarker()
external int s;
- @JInt()
+ @JIntMarker()
external int i;
- @JLong()
+ @JLongMarker()
external int j;
- @JFloat()
+ @JFloatMarker()
external double f;
- @JDouble()
+ @JDoubleMarker()
external double d;
- external JObject l;
+ external JObjectPtr l;
}
/// Primitive types that match up with Java equivalents.
-typedef JBoolean = ffi.Uint8;
-typedef JByte = ffi.Int8;
-typedef JChar = ffi.Uint16;
-typedef JShort = ffi.Int16;
-typedef JInt = ffi.Int32;
-typedef JLong = ffi.Int64;
-typedef JFloat = ffi.Float;
-typedef JDouble = ffi.Double;
+typedef JBooleanMarker = ffi.Uint8;
+typedef JByteMarker = ffi.Int8;
+typedef JCharMarker = ffi.Uint16;
+typedef JShortMarker = ffi.Int16;
+typedef JIntMarker = ffi.Int32;
+typedef JLongMarker = ffi.Int64;
+typedef JFloatMarker = ffi.Float;
+typedef JDoubleMarker = ffi.Double;
/// Reference types, in C.
-typedef JObject = ffi.Pointer<ffi.Void>;
+typedef JObjectPtr = ffi.Pointer<ffi.Void>;
abstract class jobjectRefType {
static const int JNIInvalidRefType = 0;
@@ -230,25 +231,31 @@
external ffi.Pointer<ffi.Void> reserved2;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(ffi.Pointer<JavaVM>)>>
+ external ffi
+ .Pointer<ffi.NativeFunction<JIntMarker Function(ffi.Pointer<JavaVM>)>>
DestroyJavaVM;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JavaVM>, ffi.Pointer<ffi.Pointer<JniEnv>>,
+ JIntMarker Function(
+ ffi.Pointer<JavaVM>,
+ ffi.Pointer<ffi.Pointer<JniEnv>>,
ffi.Pointer<ffi.Void>)>> AttachCurrentThread;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(ffi.Pointer<JavaVM>)>>
+ external ffi
+ .Pointer<ffi.NativeFunction<JIntMarker Function(ffi.Pointer<JavaVM>)>>
DetachCurrentThread;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JavaVM>, ffi.Pointer<ffi.Pointer<ffi.Void>>,
- JInt)>> GetEnv;
+ JIntMarker Function(ffi.Pointer<JavaVM>,
+ ffi.Pointer<ffi.Pointer<ffi.Void>>, JIntMarker)>> GetEnv;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JavaVM>, ffi.Pointer<ffi.Pointer<JniEnv>>,
+ JIntMarker Function(
+ ffi.Pointer<JavaVM>,
+ ffi.Pointer<ffi.Pointer<JniEnv>>,
ffi.Pointer<ffi.Void>)>> AttachCurrentThreadAsDaemon;
}
@@ -297,61 +304,62 @@
external ffi.Pointer<ffi.Void> reserved3;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>)>>
- GetVersion;
+ external ffi.Pointer<
+ ffi.NativeFunction<JIntMarker Function(ffi.Pointer<JniEnv1>)>> GetVersion;
external ffi.Pointer<
ffi.NativeFunction<
- JClass Function(ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Char>, JObject,
- ffi.Pointer<JByte>, JSize)>> DefineClass;
+ JClassPtr Function(ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Char>,
+ JObjectPtr, ffi.Pointer<JByteMarker>, JSizeMarker)>> DefineClass;
external ffi.Pointer<
ffi.NativeFunction<
- JClass Function(ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Char>)>>
+ JClassPtr Function(ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Char>)>>
FindClass;
external ffi.Pointer<
- ffi.NativeFunction<JMethodID Function(ffi.Pointer<JniEnv1>, JObject)>>
+ ffi.NativeFunction<
+ JMethodIDPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>>
FromReflectedMethod;
external ffi.Pointer<
- ffi.NativeFunction<JFieldID Function(ffi.Pointer<JniEnv1>, JObject)>>
+ ffi.NativeFunction<
+ JFieldIDPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>>
FromReflectedField;
/// spec doesn't show jboolean parameter
external ffi.Pointer<
- ffi.NativeFunction<
- JObject Function(
- ffi.Pointer<JniEnv1>, JClass, JMethodID, JBoolean)>>
- ToReflectedMethod;
-
- external ffi.Pointer<
- ffi.NativeFunction<JClass Function(ffi.Pointer<JniEnv1>, JClass)>>
- GetSuperclass;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JClass, JClass)>>
- IsAssignableFrom;
-
- /// spec doesn't show jboolean parameter
- external ffi.Pointer<
- ffi.NativeFunction<
- JObject Function(
- ffi.Pointer<JniEnv1>, JClass, JFieldID, JBoolean)>>
- ToReflectedField;
-
- external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>, JThrowable)>>
- Throw;
+ ffi.NativeFunction<
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
+ JBooleanMarker)>> ToReflectedMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(
- ffi.Pointer<JniEnv1>, JClass, ffi.Pointer<ffi.Char>)>> ThrowNew;
+ JClassPtr Function(ffi.Pointer<JniEnv1>, JClassPtr)>> GetSuperclass;
external ffi.Pointer<
- ffi.NativeFunction<JThrowable Function(ffi.Pointer<JniEnv1>)>>
+ ffi.NativeFunction<
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JClassPtr)>> IsAssignableFrom;
+
+ /// spec doesn't show jboolean parameter
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr,
+ JBooleanMarker)>> ToReflectedField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JThrowablePtr)>> Throw;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, ffi.Pointer<ffi.Char>)>>
+ ThrowNew;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<JThrowablePtr Function(ffi.Pointer<JniEnv1>)>>
ExceptionOccurred;
external ffi
@@ -368,1023 +376,1081 @@
FatalError;
external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>, JInt)>>
+ ffi.NativeFunction<
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JIntMarker)>>
PushLocalFrame;
external ffi.Pointer<
- ffi.NativeFunction<JObject Function(ffi.Pointer<JniEnv1>, JObject)>>
- PopLocalFrame;
-
- external ffi.Pointer<
- ffi.NativeFunction<JObject Function(ffi.Pointer<JniEnv1>, JObject)>>
- NewGlobalRef;
-
- external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(ffi.Pointer<JniEnv1>, JObject)>>
- DeleteGlobalRef;
-
- external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(ffi.Pointer<JniEnv1>, JObject)>>
- DeleteLocalRef;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JObject, JObject)>>
- IsSameObject;
-
- external ffi.Pointer<
- ffi.NativeFunction<JObject Function(ffi.Pointer<JniEnv1>, JObject)>>
- NewLocalRef;
-
- external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>, JInt)>>
- EnsureLocalCapacity;
-
- external ffi.Pointer<
- ffi.NativeFunction<JObject Function(ffi.Pointer<JniEnv1>, JClass)>>
- AllocObject;
+ ffi.NativeFunction<
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> PopLocalFrame;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>> NewObject;
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> NewGlobalRef;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> DeleteGlobalRef;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> DeleteLocalRef;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JObjectPtr)>> IsSameObject;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> NewLocalRef;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JIntMarker)>>
+ EnsureLocalCapacity;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JClassPtr)>> AllocObject;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>> NewObject;
external ffi.Pointer<ffi.Void> _NewObjectV;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> NewObjectA;
external ffi.Pointer<
- ffi.NativeFunction<JClass Function(ffi.Pointer<JniEnv1>, JObject)>>
- GetObjectClass;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JObject, JClass)>>
- IsInstanceOf;
+ ffi.NativeFunction<
+ JClassPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> GetObjectClass;
external ffi.Pointer<
ffi.NativeFunction<
- JMethodID Function(ffi.Pointer<JniEnv1>, JClass,
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr)>> IsInstanceOf;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JMethodIDPtr Function(ffi.Pointer<JniEnv1>, JClassPtr,
ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>> GetMethodID;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>>
CallObjectMethod;
external ffi.Pointer<ffi.Void> _CallObjectMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallObjectMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>>
CallBooleanMethod;
external ffi.Pointer<ffi.Void> _CallBooleanMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
- ffi.Pointer<JValue>)>> CallBooleanMethodA;
+ JBooleanMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallBooleanMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallByteMethod;
+ ffi.NativeFunction<
+ JByteMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallByteMethod;
external ffi.Pointer<ffi.Void> _CallByteMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JByteMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallByteMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallCharMethod;
+ ffi.NativeFunction<
+ JCharMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallCharMethod;
external ffi.Pointer<ffi.Void> _CallCharMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JCharMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallCharMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallShortMethod;
+ ffi.NativeFunction<
+ JShortMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallShortMethod;
external ffi.Pointer<ffi.Void> _CallShortMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JShortMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallShortMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallIntMethod;
+ ffi.NativeFunction<
+ JIntMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallIntMethod;
external ffi.Pointer<ffi.Void> _CallIntMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallIntMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallLongMethod;
+ ffi.NativeFunction<
+ JLongMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallLongMethod;
external ffi.Pointer<ffi.Void> _CallLongMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JLongMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallLongMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallFloatMethod;
+ ffi.NativeFunction<
+ JFloatMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallFloatMethod;
external ffi.Pointer<ffi.Void> _CallFloatMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JFloatMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallFloatMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
+ JDoubleMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>>
CallDoubleMethod;
external ffi.Pointer<ffi.Void> _CallDoubleMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ JDoubleMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallDoubleMethodA;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JObject, JMethodID)>>
- CallVoidMethod;
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr)>> CallVoidMethod;
external ffi.Pointer<ffi.Void> _CallVoidMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JObject, JMethodID,
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallVoidMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(
- ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualObjectMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualObjectMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualObjectMethodA;
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualObjectMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(
- ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualBooleanMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualBooleanMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualBooleanMethodA;
+ JBooleanMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualBooleanMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JByteMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualByteMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualByteMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualByteMethodA;
+ JByteMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualByteMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JCharMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualCharMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualCharMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualCharMethodA;
+ JCharMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualCharMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(
- ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JShortMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualShortMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualShortMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualShortMethodA;
+ JShortMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualShortMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JIntMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualIntMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualIntMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualIntMethodA;
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualIntMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JLongMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualLongMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualLongMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualLongMethodA;
+ JLongMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualLongMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(
- ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JFloatMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualFloatMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualFloatMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualFloatMethodA;
+ JFloatMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualFloatMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(
- ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ JDoubleMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualDoubleMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualDoubleMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualDoubleMethodA;
+ JDoubleMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualDoubleMethodA;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID)>>
+ ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualVoidMethod;
external ffi.Pointer<ffi.Void> _CallNonvirtualVoidMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JObject, JClass, JMethodID,
- ffi.Pointer<JValue>)>> CallNonvirtualVoidMethodA;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectPtr, JClassPtr,
+ JMethodIDPtr, ffi.Pointer<JValue>)>> CallNonvirtualVoidMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JFieldID Function(ffi.Pointer<JniEnv1>, JClass, ffi.Pointer<ffi.Char>,
- ffi.Pointer<ffi.Char>)>> GetFieldID;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetObjectField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetBooleanField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetByteField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetCharField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetShortField;
+ JFieldIDPtr Function(ffi.Pointer<JniEnv1>, JClassPtr,
+ ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>> GetFieldID;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>> GetIntField;
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetObjectField;
external ffi.Pointer<
- ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetLongField;
+ ffi.NativeFunction<
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetBooleanField;
external ffi.Pointer<
- ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetFloatField;
+ ffi.NativeFunction<
+ JByteMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetByteField;
external ffi.Pointer<
- ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JObject, JFieldID)>>
- GetDoubleField;
+ ffi.NativeFunction<
+ JCharMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetCharField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JShortMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetShortField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetIntField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JLongMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetLongField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JFloatMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetFloatField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JDoubleMarker Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr)>> GetDoubleField;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JObject)>>
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JObjectPtr)>>
SetObjectField;
external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr,
+ JBooleanMarker)>> SetBooleanField;
+
+ external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JBoolean)>>
- SetBooleanField;
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JByteMarker)>>
+ SetByteField;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JByte)>> SetByteField;
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JCharMarker)>>
+ SetCharField;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JChar)>> SetCharField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JShort)>> SetShortField;
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JShortMarker)>>
+ SetShortField;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JObject, JFieldID, JInt)>>
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JIntMarker)>>
SetIntField;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JLong)>> SetLongField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JFloat)>> SetFloatField;
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JLongMarker)>>
+ SetLongField;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObject, JFieldID, JDouble)>>
- SetDoubleField;
+ ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr, JFloatMarker)>>
+ SetFloatField;
external ffi.Pointer<
ffi.NativeFunction<
- JMethodID Function(ffi.Pointer<JniEnv1>, JClass,
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectPtr, JFieldIDPtr,
+ JDoubleMarker)>> SetDoubleField;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JMethodIDPtr Function(ffi.Pointer<JniEnv1>, JClassPtr,
ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>> GetStaticMethodID;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticObjectMethod;
external ffi.Pointer<ffi.Void> _CallStaticObjectMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JObjectPtr Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticObjectMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticBooleanMethod;
external ffi.Pointer<ffi.Void> _CallStaticBooleanMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JBooleanMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticBooleanMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JByteMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticByteMethod;
external ffi.Pointer<ffi.Void> _CallStaticByteMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JByteMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticByteMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JCharMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticCharMethod;
external ffi.Pointer<ffi.Void> _CallStaticCharMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JCharMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticCharMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JShortMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticShortMethod;
external ffi.Pointer<ffi.Void> _CallStaticShortMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JShortMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticShortMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JIntMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticIntMethod;
external ffi.Pointer<ffi.Void> _CallStaticIntMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticIntMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JLongMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticLongMethod;
external ffi.Pointer<ffi.Void> _CallStaticLongMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JLongMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticLongMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JFloatMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticFloatMethod;
external ffi.Pointer<ffi.Void> _CallStaticFloatMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JFloatMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticFloatMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ JDoubleMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticDoubleMethod;
external ffi.Pointer<ffi.Void> _CallStaticDoubleMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ JDoubleMarker Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticDoubleMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JClass, JMethodID)>>
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr)>>
CallStaticVoidMethod;
external ffi.Pointer<ffi.Void> _CallStaticVoidMethodV;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JClass, JMethodID,
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>> CallStaticVoidMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JFieldID Function(ffi.Pointer<JniEnv1>, JClass, ffi.Pointer<ffi.Char>,
- ffi.Pointer<ffi.Char>)>> GetStaticFieldID;
+ JFieldIDPtr Function(ffi.Pointer<JniEnv1>, JClassPtr,
+ ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>> GetStaticFieldID;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticObjectField;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JBooleanMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticBooleanField;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JByteMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticByteField;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JCharMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticCharField;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JShortMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticShortField;
external ffi.Pointer<
- ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
- GetStaticIntField;
+ ffi.NativeFunction<
+ JIntMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>> GetStaticIntField;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JLongMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticLongField;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JFloatMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticFloatField;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(ffi.Pointer<JniEnv1>, JClass, JFieldID)>>
+ JDoubleMarker Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr)>>
GetStaticDoubleField;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JClass, JFieldID, JObject)>>
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JObjectPtr)>>
SetStaticObjectField;
external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr,
+ JBooleanMarker)>> SetStaticBooleanField;
+
+ external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JClass, JFieldID, JBoolean)>>
- SetStaticBooleanField;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JClass, JFieldID, JByte)>>
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JByteMarker)>>
SetStaticByteField;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JClass, JFieldID, JChar)>>
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JCharMarker)>>
SetStaticCharField;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JClass, JFieldID, JShort)>>
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JShortMarker)>>
SetStaticShortField;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JClass, JFieldID, JInt)>>
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JIntMarker)>>
SetStaticIntField;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JClass, JFieldID, JLong)>>
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JLongMarker)>>
SetStaticLongField;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JClass, JFieldID, JFloat)>>
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JFloatMarker)>>
SetStaticFloatField;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JClass, JFieldID, JDouble)>>
+ ffi.Pointer<JniEnv1>, JClassPtr, JFieldIDPtr, JDoubleMarker)>>
SetStaticDoubleField;
external ffi.Pointer<
- ffi.NativeFunction<
- JString Function(
- ffi.Pointer<JniEnv1>, ffi.Pointer<JChar>, JSize)>> NewString;
-
- external ffi.Pointer<
- ffi.NativeFunction<JSize Function(ffi.Pointer<JniEnv1>, JString)>>
- GetStringLength;
+ ffi.NativeFunction<
+ JStringPtr Function(
+ ffi.Pointer<JniEnv1>, ffi.Pointer<JCharMarker>, JSizeMarker)>>
+ NewString;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JChar> Function(
- ffi.Pointer<JniEnv1>, JString, ffi.Pointer<JBoolean>)>>
- GetStringChars;
+ JSizeMarker Function(ffi.Pointer<JniEnv1>, JStringPtr)>>
+ GetStringLength;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Pointer<JCharMarker> Function(ffi.Pointer<JniEnv1>, JStringPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetStringChars;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JString, ffi.Pointer<JChar>)>>
+ ffi.Pointer<JniEnv1>, JStringPtr, ffi.Pointer<JCharMarker>)>>
ReleaseStringChars;
external ffi.Pointer<
ffi.NativeFunction<
- JString Function(ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Char>)>>
+ JStringPtr Function(ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Char>)>>
NewStringUTF;
external ffi.Pointer<
- ffi.NativeFunction<JSize Function(ffi.Pointer<JniEnv1>, JString)>>
+ ffi.NativeFunction<
+ JSizeMarker Function(ffi.Pointer<JniEnv1>, JStringPtr)>>
GetStringUTFLength;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<ffi.Char> Function(
- ffi.Pointer<JniEnv1>, JString, ffi.Pointer<JBoolean>)>>
- GetStringUTFChars;
+ ffi.NativeFunction<
+ ffi.Pointer<ffi.Char> Function(ffi.Pointer<JniEnv1>, JStringPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetStringUTFChars;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JString, ffi.Pointer<ffi.Char>)>>
+ ffi.Pointer<JniEnv1>, JStringPtr, ffi.Pointer<ffi.Char>)>>
ReleaseStringUTFChars;
external ffi.Pointer<
- ffi.NativeFunction<JSize Function(ffi.Pointer<JniEnv1>, JArray)>>
+ ffi.NativeFunction<
+ JSizeMarker Function(ffi.Pointer<JniEnv1>, JArrayPtr)>>
GetArrayLength;
external ffi.Pointer<
- ffi.NativeFunction<
- JObjectArray Function(
- ffi.Pointer<JniEnv1>, JSize, JClass, JObject)>> NewObjectArray;
+ ffi.NativeFunction<
+ JObjectArrayPtr Function(
+ ffi.Pointer<JniEnv1>, JSizeMarker, JClassPtr, JObjectPtr)>>
+ NewObjectArray;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(ffi.Pointer<JniEnv1>, JObjectArray, JSize)>>
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, JObjectArrayPtr, JSizeMarker)>>
GetObjectArrayElement;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JObjectArray, JSize, JObject)>>
- SetObjectArrayElement;
-
- external ffi.Pointer<
ffi.NativeFunction<
- JBooleanArray Function(ffi.Pointer<JniEnv1>, JSize)>> NewBooleanArray;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JObjectArrayPtr, JSizeMarker,
+ JObjectPtr)>> SetObjectArrayElement;
external ffi.Pointer<
- ffi.NativeFunction<JByteArray Function(ffi.Pointer<JniEnv1>, JSize)>>
+ ffi.NativeFunction<
+ JBooleanArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
+ NewBooleanArray;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JByteArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
NewByteArray;
external ffi.Pointer<
- ffi.NativeFunction<JCharArray Function(ffi.Pointer<JniEnv1>, JSize)>>
+ ffi.NativeFunction<
+ JCharArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
NewCharArray;
external ffi.Pointer<
- ffi.NativeFunction<JShortArray Function(ffi.Pointer<JniEnv1>, JSize)>>
+ ffi.NativeFunction<
+ JShortArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
NewShortArray;
external ffi.Pointer<
- ffi.NativeFunction<JIntArray Function(ffi.Pointer<JniEnv1>, JSize)>>
+ ffi.NativeFunction<
+ JIntArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
NewIntArray;
external ffi.Pointer<
- ffi.NativeFunction<JLongArray Function(ffi.Pointer<JniEnv1>, JSize)>>
+ ffi.NativeFunction<
+ JLongArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
NewLongArray;
external ffi.Pointer<
- ffi.NativeFunction<JFloatArray Function(ffi.Pointer<JniEnv1>, JSize)>>
+ ffi.NativeFunction<
+ JFloatArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
NewFloatArray;
external ffi.Pointer<
- ffi.NativeFunction<
- JDoubleArray Function(ffi.Pointer<JniEnv1>, JSize)>> NewDoubleArray;
-
- external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JBoolean> Function(
- ffi.Pointer<JniEnv1>, JBooleanArray, ffi.Pointer<JBoolean>)>>
- GetBooleanArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JByte> Function(
- ffi.Pointer<JniEnv1>, JByteArray, ffi.Pointer<JBoolean>)>>
- GetByteArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JChar> Function(
- ffi.Pointer<JniEnv1>, JCharArray, ffi.Pointer<JBoolean>)>>
- GetCharArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JShort> Function(
- ffi.Pointer<JniEnv1>, JShortArray, ffi.Pointer<JBoolean>)>>
- GetShortArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JInt> Function(
- ffi.Pointer<JniEnv1>, JIntArray, ffi.Pointer<JBoolean>)>>
- GetIntArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JLong> Function(
- ffi.Pointer<JniEnv1>, JLongArray, ffi.Pointer<JBoolean>)>>
- GetLongArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JFloat> Function(
- ffi.Pointer<JniEnv1>, JFloatArray, ffi.Pointer<JBoolean>)>>
- GetFloatArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JDouble> Function(
- ffi.Pointer<JniEnv1>, JDoubleArray, ffi.Pointer<JBoolean>)>>
- GetDoubleArrayElements;
+ JDoubleArrayPtr Function(ffi.Pointer<JniEnv1>, JSizeMarker)>>
+ NewDoubleArray;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JBooleanArray,
- ffi.Pointer<JBoolean>, JInt)>> ReleaseBooleanArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JByteArray, ffi.Pointer<JByte>, JInt)>>
- ReleaseByteArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JCharArray, ffi.Pointer<JChar>, JInt)>>
- ReleaseCharArrayElements;
+ ffi.Pointer<JBooleanMarker> Function(
+ ffi.Pointer<JniEnv1>,
+ JBooleanArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetBooleanArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JShortArray,
- ffi.Pointer<JShort>, JInt)>> ReleaseShortArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JIntArray, ffi.Pointer<JInt>, JInt)>>
- ReleaseIntArrayElements;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JLongArray, ffi.Pointer<JLong>, JInt)>>
- ReleaseLongArrayElements;
+ ffi.Pointer<JByteMarker> Function(ffi.Pointer<JniEnv1>, JByteArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetByteArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JFloatArray,
- ffi.Pointer<JFloat>, JInt)>> ReleaseFloatArrayElements;
+ ffi.Pointer<JCharMarker> Function(ffi.Pointer<JniEnv1>, JCharArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetCharArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JDoubleArray,
- ffi.Pointer<JDouble>, JInt)>> ReleaseDoubleArrayElements;
+ ffi.Pointer<JShortMarker> Function(
+ ffi.Pointer<JniEnv1>,
+ JShortArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetShortArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JBooleanArray, JSize, JSize,
- ffi.Pointer<JBoolean>)>> GetBooleanArrayRegion;
+ ffi.Pointer<JIntMarker> Function(ffi.Pointer<JniEnv1>, JIntArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetIntArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JByteArray, JSize, JSize,
- ffi.Pointer<JByte>)>> GetByteArrayRegion;
+ ffi.Pointer<JLongMarker> Function(ffi.Pointer<JniEnv1>, JLongArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetLongArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JCharArray, JSize, JSize,
- ffi.Pointer<JChar>)>> GetCharArrayRegion;
+ ffi.Pointer<JFloatMarker> Function(
+ ffi.Pointer<JniEnv1>,
+ JFloatArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetFloatArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JShortArray, JSize, JSize,
- ffi.Pointer<JShort>)>> GetShortArrayRegion;
+ ffi.Pointer<JDoubleMarker> Function(
+ ffi.Pointer<JniEnv1>,
+ JDoubleArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetDoubleArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JIntArray, JSize, JSize,
- ffi.Pointer<JInt>)>> GetIntArrayRegion;
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>,
+ JBooleanArrayPtr,
+ ffi.Pointer<JBooleanMarker>,
+ JIntMarker)>> ReleaseBooleanArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JLongArray, JSize, JSize,
- ffi.Pointer<JLong>)>> GetLongArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JByteArrayPtr,
+ ffi.Pointer<JByteMarker>, JIntMarker)>> ReleaseByteArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JFloatArray, JSize, JSize,
- ffi.Pointer<JFloat>)>> GetFloatArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JCharArrayPtr,
+ ffi.Pointer<JCharMarker>, JIntMarker)>> ReleaseCharArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JDoubleArray, JSize, JSize,
- ffi.Pointer<JDouble>)>> GetDoubleArrayRegion;
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>,
+ JShortArrayPtr,
+ ffi.Pointer<JShortMarker>,
+ JIntMarker)>> ReleaseShortArrayElements;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JIntArrayPtr,
+ ffi.Pointer<JIntMarker>, JIntMarker)>> ReleaseIntArrayElements;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JLongArrayPtr,
+ ffi.Pointer<JLongMarker>, JIntMarker)>> ReleaseLongArrayElements;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>,
+ JFloatArrayPtr,
+ ffi.Pointer<JFloatMarker>,
+ JIntMarker)>> ReleaseFloatArrayElements;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>,
+ JDoubleArrayPtr,
+ ffi.Pointer<JDoubleMarker>,
+ JIntMarker)>> ReleaseDoubleArrayElements;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JBooleanArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JBooleanMarker>)>> GetBooleanArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JByteArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JByteMarker>)>> GetByteArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JCharArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JCharMarker>)>> GetCharArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JShortArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JShortMarker>)>> GetShortArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JIntArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JIntMarker>)>> GetIntArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JLongArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JLongMarker>)>> GetLongArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JFloatArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JFloatMarker>)>> GetFloatArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JDoubleArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JDoubleMarker>)>> GetDoubleArrayRegion;
/// spec shows these without const; some jni.h do, some don't
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JBooleanArray, JSize, JSize,
- ffi.Pointer<JBoolean>)>> SetBooleanArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JBooleanArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JBooleanMarker>)>> SetBooleanArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JByteArray, JSize, JSize,
- ffi.Pointer<JByte>)>> SetByteArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JByteArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JByteMarker>)>> SetByteArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JCharArray, JSize, JSize,
- ffi.Pointer<JChar>)>> SetCharArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JCharArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JCharMarker>)>> SetCharArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JShortArray, JSize, JSize,
- ffi.Pointer<JShort>)>> SetShortArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JShortArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JShortMarker>)>> SetShortArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JIntArray, JSize, JSize,
- ffi.Pointer<JInt>)>> SetIntArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JIntArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JIntMarker>)>> SetIntArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JLongArray, JSize, JSize,
- ffi.Pointer<JLong>)>> SetLongArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JLongArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JLongMarker>)>> SetLongArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JFloatArray, JSize, JSize,
- ffi.Pointer<JFloat>)>> SetFloatArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JFloatArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JFloatMarker>)>> SetFloatArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JDoubleArray, JSize, JSize,
- ffi.Pointer<JDouble>)>> SetDoubleArrayRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JDoubleArrayPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JDoubleMarker>)>> SetDoubleArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(ffi.Pointer<JniEnv1>, JClass,
- ffi.Pointer<JNINativeMethod>, JInt)>> RegisterNatives;
-
- external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>, JClass)>>
- UnregisterNatives;
-
- external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>, JObject)>>
- MonitorEnter;
-
- external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<JniEnv1>, JObject)>>
- MonitorExit;
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JClassPtr,
+ ffi.Pointer<JNINativeMethod>, JIntMarker)>> RegisterNatives;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JClassPtr)>>
+ UnregisterNatives;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> MonitorEnter;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr)>> MonitorExit;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JIntMarker Function(
ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Pointer<JavaVM>>)>>
GetJavaVM;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JString, JSize, JSize,
- ffi.Pointer<JChar>)>> GetStringRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JStringPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<JCharMarker>)>> GetStringRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer<JniEnv1>, JString, JSize, JSize,
- ffi.Pointer<ffi.Char>)>> GetStringUTFRegion;
+ ffi.Void Function(ffi.Pointer<JniEnv1>, JStringPtr, JSizeMarker,
+ JSizeMarker, ffi.Pointer<ffi.Char>)>> GetStringUTFRegion;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<ffi.Void> Function(
- ffi.Pointer<JniEnv1>, JArray, ffi.Pointer<JBoolean>)>>
- GetPrimitiveArrayCritical;
+ ffi.NativeFunction<
+ ffi.Pointer<ffi.Void> Function(ffi.Pointer<JniEnv1>, JArrayPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetPrimitiveArrayCritical;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(
+ ffi.Pointer<JniEnv1>,
+ JArrayPtr,
+ ffi.Pointer<ffi.Void>,
+ JIntMarker)>> ReleasePrimitiveArrayCritical;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Pointer<JCharMarker> Function(ffi.Pointer<JniEnv1>, JStringPtr,
+ ffi.Pointer<JBooleanMarker>)>> GetStringCritical;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- ffi.Pointer<JniEnv1>, JArray, ffi.Pointer<ffi.Void>, JInt)>>
- ReleasePrimitiveArrayCritical;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JChar> Function(
- ffi.Pointer<JniEnv1>, JString, ffi.Pointer<JBoolean>)>>
- GetStringCritical;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer<JniEnv1>, JString, ffi.Pointer<JChar>)>>
+ ffi.Pointer<JniEnv1>, JStringPtr, ffi.Pointer<JCharMarker>)>>
ReleaseStringCritical;
external ffi.Pointer<
- ffi.NativeFunction<JWeak Function(ffi.Pointer<JniEnv1>, JObject)>>
+ ffi.NativeFunction<
+ JWeakPtr Function(ffi.Pointer<JniEnv1>, JObjectPtr)>>
NewWeakGlobalRef;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(ffi.Pointer<JniEnv1>, JWeak)>>
+ ffi.NativeFunction<ffi.Void Function(ffi.Pointer<JniEnv1>, JWeakPtr)>>
DeleteWeakGlobalRef;
- external ffi
- .Pointer<ffi.NativeFunction<JBoolean Function(ffi.Pointer<JniEnv1>)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(ffi.Pointer<JniEnv1>)>>
ExceptionCheck;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(
- ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Void>, JLong)>>
+ JObjectPtr Function(
+ ffi.Pointer<JniEnv1>, ffi.Pointer<ffi.Void>, JLongMarker)>>
NewDirectByteBuffer;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<ffi.Void> Function(ffi.Pointer<JniEnv1>, JObject)>>
+ ffi.Pointer<ffi.Void> Function(ffi.Pointer<JniEnv1>, JObjectPtr)>>
GetDirectBufferAddress;
external ffi.Pointer<
- ffi.NativeFunction<JLong Function(ffi.Pointer<JniEnv1>, JObject)>>
+ ffi.NativeFunction<
+ JLongMarker Function(ffi.Pointer<JniEnv1>, JObjectPtr)>>
GetDirectBufferCapacity;
/// added in JNI 1.6
external ffi.Pointer<
- ffi.NativeFunction<ffi.Int32 Function(ffi.Pointer<JniEnv1>, JObject)>>
+ ffi.NativeFunction<
+ ffi.Int32 Function(ffi.Pointer<JniEnv1>, JObjectPtr)>>
GetObjectRefType;
}
typedef JniEnv1 = ffi.Pointer<JNINativeInterface>;
-typedef JClass = JObject;
+typedef JClassPtr = JObjectPtr;
/// "cardinal indices and sizes"
-typedef JSize = JInt;
-typedef JMethodID = ffi.Pointer<jmethodID_>;
-typedef JFieldID = ffi.Pointer<jfieldID_>;
-typedef JThrowable = JObject;
-typedef JString = JObject;
-typedef JArray = JObject;
-typedef JObjectArray = JArray;
-typedef JBooleanArray = JArray;
-typedef JByteArray = JArray;
-typedef JCharArray = JArray;
-typedef JShortArray = JArray;
-typedef JIntArray = JArray;
-typedef JLongArray = JArray;
-typedef JFloatArray = JArray;
-typedef JDoubleArray = JArray;
-typedef JWeak = JObject;
+typedef JSizeMarker = JIntMarker;
+typedef JMethodIDPtr = ffi.Pointer<jmethodID_>;
+typedef JFieldIDPtr = ffi.Pointer<jfieldID_>;
+typedef JThrowablePtr = JObjectPtr;
+typedef JStringPtr = JObjectPtr;
+typedef JArrayPtr = JObjectPtr;
+typedef JObjectArrayPtr = JArrayPtr;
+typedef JBooleanArrayPtr = JArrayPtr;
+typedef JByteArrayPtr = JArrayPtr;
+typedef JCharArrayPtr = JArrayPtr;
+typedef JShortArrayPtr = JArrayPtr;
+typedef JIntArrayPtr = JArrayPtr;
+typedef JLongArrayPtr = JArrayPtr;
+typedef JFloatArrayPtr = JArrayPtr;
+typedef JDoubleArrayPtr = JArrayPtr;
+typedef JWeakPtr = JObjectPtr;
class JavaVMAttachArgs extends ffi.Struct {
/// must be >= JNI_VERSION_1_2
- @JInt()
+ @JIntMarker()
external int version;
/// NULL or name of thread as modified UTF-8 str
external ffi.Pointer<ffi.Char> name;
/// global ref of a ThreadGroup object, or NULL
- external JObject group;
+ external JObjectPtr group;
}
/// JNI 1.2+ initialization. (As of 1.6, the pre-1.2 structures are no
@@ -1397,15 +1463,15 @@
class JavaVMInitArgs extends ffi.Struct {
/// use JNI_VERSION_1_2 or later
- @JInt()
+ @JIntMarker()
external int version;
- @JInt()
+ @JIntMarker()
external int nOptions;
external ffi.Pointer<JavaVMOption> options;
- @JBoolean()
+ @JBooleanMarker()
external int ignoreUnrecognized;
}
@@ -1430,29 +1496,29 @@
class JniResult extends ffi.Struct {
external JValue result;
- external JThrowable exception;
+ external JThrowablePtr exception;
}
/// Similar to [JniResult] but for class lookups.
class JniClassLookupResult extends ffi.Struct {
- external JClass classRef;
+ external JClassPtr classRef;
- external JThrowable exception;
+ external JThrowablePtr exception;
}
/// Similar to [JniResult] but for method/field ID lookups.
class JniPointerResult extends ffi.Struct {
external ffi.Pointer<ffi.Void> id;
- external JThrowable exception;
+ external JThrowablePtr exception;
}
/// JniExceptionDetails holds 2 jstring objects, one is the result of
/// calling `toString` on exception object, other is stack trace;
class JniExceptionDetails extends ffi.Struct {
- external JString message;
+ external JStringPtr message;
- external JString stacktrace;
+ external JStringPtr stacktrace;
}
/// This struct contains functions which wrap method call / field access conveniently along with
@@ -1469,65 +1535,67 @@
external ffi.Pointer<
ffi.NativeFunction<
JniPointerResult Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
getFieldID;
external ffi.Pointer<
ffi.NativeFunction<
JniPointerResult Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
getStaticFieldID;
external ffi.Pointer<
ffi.NativeFunction<
JniPointerResult Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
getMethodID;
external ffi.Pointer<
ffi.NativeFunction<
JniPointerResult Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
getStaticMethodID;
external ffi.Pointer<
ffi.NativeFunction<
- JniResult Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JniResult Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
newObject;
external ffi.Pointer<
- ffi.NativeFunction<JniPointerResult Function(JSize, ffi.Int)>>
+ ffi.NativeFunction<JniPointerResult Function(JSizeMarker, ffi.Int)>>
newPrimitiveArray;
external ffi.Pointer<
- ffi.NativeFunction<JniPointerResult Function(JSize, JClass, JObject)>>
+ ffi.NativeFunction<
+ JniPointerResult Function(JSizeMarker, JClassPtr, JObjectPtr)>>
newObjectArray;
external ffi.Pointer<
- ffi.NativeFunction<JniResult Function(JArray, ffi.Int, ffi.Int)>>
+ ffi.NativeFunction<JniResult Function(JArrayPtr, ffi.Int, ffi.Int)>>
getArrayElement;
external ffi.Pointer<
- ffi.NativeFunction<
- JniResult Function(
- JObject, JMethodID, ffi.Int, ffi.Pointer<JValue>)>> callMethod;
-
- external ffi.Pointer<
ffi.NativeFunction<
JniResult Function(
- JClass, JMethodID, ffi.Int, ffi.Pointer<JValue>)>>
+ JObjectPtr, JMethodIDPtr, ffi.Int, ffi.Pointer<JValue>)>>
+ callMethod;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ JniResult Function(
+ JClassPtr, JMethodIDPtr, ffi.Int, ffi.Pointer<JValue>)>>
callStaticMethod;
external ffi.Pointer<
- ffi.NativeFunction<JniResult Function(JObject, JFieldID, ffi.Int)>>
- getField;
+ ffi.NativeFunction<
+ JniResult Function(JObjectPtr, JFieldIDPtr, ffi.Int)>> getField;
external ffi.Pointer<
- ffi.NativeFunction<JniResult Function(JClass, JFieldID, ffi.Int)>>
- getStaticField;
+ ffi.NativeFunction<
+ JniResult Function(JClassPtr, JFieldIDPtr, ffi.Int)>> getStaticField;
- external ffi
- .Pointer<ffi.NativeFunction<JniExceptionDetails Function(JThrowable)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JniExceptionDetails Function(JThrowablePtr)>>
getExceptionDetails;
}
@@ -1538,38 +1606,39 @@
internalName);
}
- JniPointerResult getFieldID(JClass cls, ffi.Pointer<ffi.Char> fieldName,
+ JniPointerResult getFieldID(JClassPtr cls, ffi.Pointer<ffi.Char> fieldName,
ffi.Pointer<ffi.Char> signature) {
return ref.getFieldID.asFunction<
- JniPointerResult Function(JClass, ffi.Pointer<ffi.Char>,
+ JniPointerResult Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(cls, fieldName, signature);
}
- JniPointerResult getStaticFieldID(JClass cls, ffi.Pointer<ffi.Char> fieldName,
- ffi.Pointer<ffi.Char> signature) {
+ JniPointerResult getStaticFieldID(JClassPtr cls,
+ ffi.Pointer<ffi.Char> fieldName, ffi.Pointer<ffi.Char> signature) {
return ref.getStaticFieldID.asFunction<
- JniPointerResult Function(JClass, ffi.Pointer<ffi.Char>,
+ JniPointerResult Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(cls, fieldName, signature);
}
- JniPointerResult getMethodID(JClass cls, ffi.Pointer<ffi.Char> methodName,
+ JniPointerResult getMethodID(JClassPtr cls, ffi.Pointer<ffi.Char> methodName,
ffi.Pointer<ffi.Char> signature) {
return ref.getMethodID.asFunction<
- JniPointerResult Function(JClass, ffi.Pointer<ffi.Char>,
+ JniPointerResult Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(cls, methodName, signature);
}
- JniPointerResult getStaticMethodID(JClass cls,
+ JniPointerResult getStaticMethodID(JClassPtr cls,
ffi.Pointer<ffi.Char> methodName, ffi.Pointer<ffi.Char> signature) {
return ref.getStaticMethodID.asFunction<
- JniPointerResult Function(JClass, ffi.Pointer<ffi.Char>,
+ JniPointerResult Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(cls, methodName, signature);
}
- JniResult newObject(JClass cls, JMethodID ctor, ffi.Pointer<JValue> args) {
+ JniResult newObject(
+ JClassPtr cls, JMethodIDPtr ctor, ffi.Pointer<JValue> args) {
return ref.newObject.asFunction<
JniResult Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(cls, ctor, args);
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(cls, ctor, args);
}
JniPointerResult newPrimitiveArray(int length, int type) {
@@ -1578,46 +1647,47 @@
}
JniPointerResult newObjectArray(
- int length, JClass elementClass, JObject initialElement) {
- return ref.newObjectArray
- .asFunction<JniPointerResult Function(int, JClass, JObject)>()(
+ int length, JClassPtr elementClass, JObjectPtr initialElement) {
+ return ref.newObjectArray.asFunction<
+ JniPointerResult Function(int, JClassPtr, JObjectPtr)>()(
length, elementClass, initialElement);
}
- JniResult getArrayElement(JArray array, int index, int type) {
+ JniResult getArrayElement(JArrayPtr array, int index, int type) {
return ref.getArrayElement
- .asFunction<JniResult Function(JArray, int, int)>()(array, index, type);
+ .asFunction<JniResult Function(JArrayPtr, int, int)>()(
+ array, index, type);
}
- JniResult callMethod(
- JObject obj, JMethodID methodID, int callType, ffi.Pointer<JValue> args) {
+ JniResult callMethod(JObjectPtr obj, JMethodIDPtr methodID, int callType,
+ ffi.Pointer<JValue> args) {
return ref.callMethod.asFunction<
- JniResult Function(JObject, JMethodID, int, ffi.Pointer<JValue>)>()(
- obj, methodID, callType, args);
+ JniResult Function(JObjectPtr, JMethodIDPtr, int,
+ ffi.Pointer<JValue>)>()(obj, methodID, callType, args);
}
- JniResult callStaticMethod(
- JClass cls, JMethodID methodID, int callType, ffi.Pointer<JValue> args) {
+ JniResult callStaticMethod(JClassPtr cls, JMethodIDPtr methodID, int callType,
+ ffi.Pointer<JValue> args) {
return ref.callStaticMethod.asFunction<
- JniResult Function(JClass, JMethodID, int, ffi.Pointer<JValue>)>()(
- cls, methodID, callType, args);
+ JniResult Function(JClassPtr, JMethodIDPtr, int,
+ ffi.Pointer<JValue>)>()(cls, methodID, callType, args);
}
- JniResult getField(JObject obj, JFieldID fieldID, int callType) {
+ JniResult getField(JObjectPtr obj, JFieldIDPtr fieldID, int callType) {
return ref.getField
- .asFunction<JniResult Function(JObject, JFieldID, int)>()(
+ .asFunction<JniResult Function(JObjectPtr, JFieldIDPtr, int)>()(
obj, fieldID, callType);
}
- JniResult getStaticField(JClass cls, JFieldID fieldID, int callType) {
+ JniResult getStaticField(JClassPtr cls, JFieldIDPtr fieldID, int callType) {
return ref.getStaticField
- .asFunction<JniResult Function(JClass, JFieldID, int)>()(
+ .asFunction<JniResult Function(JClassPtr, JFieldIDPtr, int)>()(
cls, fieldID, callType);
}
- JniExceptionDetails getExceptionDetails(JThrowable exception) {
+ JniExceptionDetails getExceptionDetails(JThrowablePtr exception) {
return ref.getExceptionDetails
- .asFunction<JniExceptionDetails Function(JThrowable)>()(exception);
+ .asFunction<JniExceptionDetails Function(JThrowablePtr)>()(exception);
}
}
@@ -1635,45 +1705,47 @@
/// information about using the JNI:
/// https://developer.android.com/training/articles/perf-jni
class GlobalJniEnv extends ffi.Struct {
- external ffi.Pointer<ffi.NativeFunction<JInt Function()>> GetVersion;
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function()>> GetVersion;
external ffi.Pointer<
- ffi.NativeFunction<
- JClass Function(
- ffi.Pointer<ffi.Char>, JObject, ffi.Pointer<JByte>, JSize)>>
- DefineClass;
+ ffi.NativeFunction<
+ JClassPtr Function(ffi.Pointer<ffi.Char>, JObjectPtr,
+ ffi.Pointer<JByteMarker>, JSizeMarker)>> DefineClass;
- external ffi
- .Pointer<ffi.NativeFunction<JClass Function(ffi.Pointer<ffi.Char>)>>
- FindClass;
+ external ffi.Pointer<
+ ffi.NativeFunction<JClassPtr Function(ffi.Pointer<ffi.Char>)>> FindClass;
- external ffi.Pointer<ffi.NativeFunction<JMethodID Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JMethodIDPtr Function(JObjectPtr)>>
FromReflectedMethod;
- external ffi.Pointer<ffi.NativeFunction<JFieldID Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JFieldIDPtr Function(JObjectPtr)>>
FromReflectedField;
external ffi.Pointer<
- ffi.NativeFunction<JObject Function(JClass, JMethodID, JBoolean)>>
+ ffi.NativeFunction<
+ JObjectPtr Function(JClassPtr, JMethodIDPtr, JBooleanMarker)>>
ToReflectedMethod;
- external ffi.Pointer<ffi.NativeFunction<JClass Function(JClass)>>
+ external ffi.Pointer<ffi.NativeFunction<JClassPtr Function(JClassPtr)>>
GetSuperclass;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function(JClass, JClass)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JClassPtr, JClassPtr)>>
IsAssignableFrom;
external ffi.Pointer<
- ffi.NativeFunction<JObject Function(JClass, JFieldID, JBoolean)>>
+ ffi.NativeFunction<
+ JObjectPtr Function(JClassPtr, JFieldIDPtr, JBooleanMarker)>>
ToReflectedField;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JThrowable)>> Throw;
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function(JThrowablePtr)>>
+ Throw;
external ffi.Pointer<
- ffi.NativeFunction<JInt Function(JClass, ffi.Pointer<ffi.Char>)>>
- ThrowNew;
+ ffi.NativeFunction<
+ JIntMarker Function(JClassPtr, ffi.Pointer<ffi.Char>)>> ThrowNew;
- external ffi.Pointer<ffi.NativeFunction<JThrowable Function()>>
+ external ffi.Pointer<ffi.NativeFunction<JThrowablePtr Function()>>
ExceptionOccurred;
external ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>>
@@ -1685,749 +1757,857 @@
.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Char>)>>
FatalError;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JInt)>> PushLocalFrame;
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function(JIntMarker)>>
+ PushLocalFrame;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JObjectPtr Function(JObjectPtr)>>
PopLocalFrame;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JObjectPtr Function(JObjectPtr)>>
NewGlobalRef;
- external ffi.Pointer<ffi.NativeFunction<ffi.Void Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<ffi.Void Function(JObjectPtr)>>
DeleteGlobalRef;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function(JObject, JObject)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JObjectPtr, JObjectPtr)>>
IsSameObject;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JInt)>>
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function(JIntMarker)>>
EnsureLocalCapacity;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JClass)>>
+ external ffi.Pointer<ffi.NativeFunction<JObjectPtr Function(JClassPtr)>>
AllocObject;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JObjectPtr Function(JClassPtr, JMethodIDPtr)>>
NewObject;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(JClass, JMethodID, ffi.Pointer<JValue>)>> NewObjectA;
+ JObjectPtr Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> NewObjectA;
- external ffi.Pointer<ffi.NativeFunction<JClass Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JClassPtr Function(JObjectPtr)>>
GetObjectClass;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function(JObject, JClass)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JObjectPtr, JClassPtr)>>
IsInstanceOf;
external ffi.Pointer<
ffi.NativeFunction<
- JMethodID Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JMethodIDPtr Function(
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
GetMethodID;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JObjectPtr Function(JObjectPtr, JMethodIDPtr)>>
CallObjectMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
+ JObjectPtr Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallObjectMethodA;
- external ffi
- .Pointer<ffi.NativeFunction<JBoolean Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JObjectPtr, JMethodIDPtr)>>
CallBooleanMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
+ JBooleanMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallBooleanMethodA;
- external ffi.Pointer<ffi.NativeFunction<JByte Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JByteMarker Function(JObjectPtr, JMethodIDPtr)>>
CallByteMethod;
external ffi.Pointer<
- ffi.NativeFunction<
- JByte Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
- CallByteMethodA;
+ ffi.NativeFunction<
+ JByteMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> CallByteMethodA;
- external ffi.Pointer<ffi.NativeFunction<JChar Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JCharMarker Function(JObjectPtr, JMethodIDPtr)>>
CallCharMethod;
external ffi.Pointer<
- ffi.NativeFunction<
- JChar Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
- CallCharMethodA;
+ ffi.NativeFunction<
+ JCharMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> CallCharMethodA;
- external ffi.Pointer<ffi.NativeFunction<JShort Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JShortMarker Function(JObjectPtr, JMethodIDPtr)>>
CallShortMethod;
external ffi.Pointer<
- ffi.NativeFunction<
- JShort Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
- CallShortMethodA;
+ ffi.NativeFunction<
+ JShortMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> CallShortMethodA;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JIntMarker Function(JObjectPtr, JMethodIDPtr)>>
CallIntMethod;
external ffi.Pointer<
- ffi.NativeFunction<
- JInt Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
- CallIntMethodA;
+ ffi.NativeFunction<
+ JIntMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> CallIntMethodA;
- external ffi.Pointer<ffi.NativeFunction<JLong Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JLongMarker Function(JObjectPtr, JMethodIDPtr)>>
CallLongMethod;
external ffi.Pointer<
- ffi.NativeFunction<
- JLong Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
- CallLongMethodA;
+ ffi.NativeFunction<
+ JLongMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> CallLongMethodA;
- external ffi.Pointer<ffi.NativeFunction<JFloat Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JFloatMarker Function(JObjectPtr, JMethodIDPtr)>>
CallFloatMethod;
external ffi.Pointer<
- ffi.NativeFunction<
- JFloat Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
- CallFloatMethodA;
+ ffi.NativeFunction<
+ JFloatMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>> CallFloatMethodA;
- external ffi.Pointer<ffi.NativeFunction<JDouble Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JDoubleMarker Function(JObjectPtr, JMethodIDPtr)>>
CallDoubleMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
+ JDoubleMarker Function(
+ JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallDoubleMethodA;
- external ffi
- .Pointer<ffi.NativeFunction<ffi.Void Function(JObject, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<ffi.Void Function(JObjectPtr, JMethodIDPtr)>>
CallVoidMethod;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JObject, JMethodID, ffi.Pointer<JValue>)>>
+ ffi.Void Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallVoidMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JObject Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JObjectPtr Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualObjectMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(
- JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JObjectPtr Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualObjectMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JBoolean Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JBooleanMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualBooleanMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(
- JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JBooleanMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualBooleanMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JByte Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JByteMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualByteMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JByteMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualByteMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JChar Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JCharMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualCharMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JCharMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualCharMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JShort Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JShortMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualShortMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JShortMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualShortMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JInt Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JIntMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualIntMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JIntMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualIntMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JLong Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JLongMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualLongMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JLongMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualLongMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JFloat Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JFloatMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualFloatMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JFloatMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualFloatMethodA;
external ffi.Pointer<
- ffi.NativeFunction<JDouble Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ JDoubleMarker Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualDoubleMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(
- JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JDoubleMarker Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualDoubleMethodA;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JClass, JMethodID)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JClassPtr, JMethodIDPtr)>>
CallNonvirtualVoidMethod;
external ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
- JObject, JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JObjectPtr, JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallNonvirtualVoidMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JFieldID Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JFieldIDPtr Function(
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
GetFieldID;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JObjectPtr Function(JObjectPtr, JFieldIDPtr)>>
GetObjectField;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JObjectPtr, JFieldIDPtr)>>
GetBooleanField;
- external ffi.Pointer<ffi.NativeFunction<JByte Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JByteMarker Function(JObjectPtr, JFieldIDPtr)>>
GetByteField;
- external ffi.Pointer<ffi.NativeFunction<JChar Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JCharMarker Function(JObjectPtr, JFieldIDPtr)>>
GetCharField;
- external ffi.Pointer<ffi.NativeFunction<JShort Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JShortMarker Function(JObjectPtr, JFieldIDPtr)>>
GetShortField;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JIntMarker Function(JObjectPtr, JFieldIDPtr)>>
GetIntField;
- external ffi.Pointer<ffi.NativeFunction<JLong Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JLongMarker Function(JObjectPtr, JFieldIDPtr)>>
GetLongField;
- external ffi.Pointer<ffi.NativeFunction<JFloat Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JFloatMarker Function(JObjectPtr, JFieldIDPtr)>>
GetFloatField;
- external ffi.Pointer<ffi.NativeFunction<JDouble Function(JObject, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JDoubleMarker Function(JObjectPtr, JFieldIDPtr)>>
GetDoubleField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JObject)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JObjectPtr)>>
SetObjectField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JBoolean)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JBooleanMarker)>>
SetBooleanField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JByte)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JByteMarker)>>
SetByteField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JChar)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JCharMarker)>>
SetCharField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JShort)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JShortMarker)>>
SetShortField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JInt)>>
- SetIntField;
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JIntMarker)>> SetIntField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JLong)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JLongMarker)>>
SetLongField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JFloat)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JFloatMarker)>>
SetFloatField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObject, JFieldID, JDouble)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectPtr, JFieldIDPtr, JDoubleMarker)>>
SetDoubleField;
external ffi.Pointer<
ffi.NativeFunction<
- JMethodID Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JMethodIDPtr Function(
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
GetStaticMethodID;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JObjectPtr Function(JClassPtr, JMethodIDPtr)>>
CallStaticObjectMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JObject Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JObjectPtr Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticObjectMethodA;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticBooleanMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JBoolean Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JBooleanMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticBooleanMethodA;
- external ffi.Pointer<ffi.NativeFunction<JByte Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JByteMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticByteMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JByte Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JByteMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticByteMethodA;
- external ffi.Pointer<ffi.NativeFunction<JChar Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JCharMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticCharMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JChar Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JCharMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticCharMethodA;
- external ffi.Pointer<ffi.NativeFunction<JShort Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JShortMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticShortMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JShort Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JShortMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticShortMethodA;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JIntMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticIntMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JInt Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JIntMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticIntMethodA;
- external ffi.Pointer<ffi.NativeFunction<JLong Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JLongMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticLongMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JLong Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JLongMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticLongMethodA;
- external ffi.Pointer<ffi.NativeFunction<JFloat Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JFloatMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticFloatMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JFloat Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JFloatMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticFloatMethodA;
- external ffi.Pointer<ffi.NativeFunction<JDouble Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JDoubleMarker Function(JClassPtr, JMethodIDPtr)>>
CallStaticDoubleMethod;
external ffi.Pointer<
ffi.NativeFunction<
- JDouble Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ JDoubleMarker Function(
+ JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticDoubleMethodA;
- external ffi.Pointer<ffi.NativeFunction<ffi.Void Function(JClass, JMethodID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<ffi.Void Function(JClassPtr, JMethodIDPtr)>>
CallStaticVoidMethod;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JClass, JMethodID, ffi.Pointer<JValue>)>>
+ ffi.Void Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>>
CallStaticVoidMethodA;
external ffi.Pointer<
ffi.NativeFunction<
- JFieldID Function(
- JClass, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
+ JFieldIDPtr Function(
+ JClassPtr, ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>
GetStaticFieldID;
- external ffi.Pointer<ffi.NativeFunction<JObject Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JObjectPtr Function(JClassPtr, JFieldIDPtr)>>
GetStaticObjectField;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JBooleanMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticBooleanField;
- external ffi.Pointer<ffi.NativeFunction<JByte Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JByteMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticByteField;
- external ffi.Pointer<ffi.NativeFunction<JChar Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JCharMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticCharField;
- external ffi.Pointer<ffi.NativeFunction<JShort Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JShortMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticShortField;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JIntMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticIntField;
- external ffi.Pointer<ffi.NativeFunction<JLong Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JLongMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticLongField;
- external ffi.Pointer<ffi.NativeFunction<JFloat Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JFloatMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticFloatField;
- external ffi.Pointer<ffi.NativeFunction<JDouble Function(JClass, JFieldID)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JDoubleMarker Function(JClassPtr, JFieldIDPtr)>>
GetStaticDoubleField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JObject)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JObjectPtr)>>
SetStaticObjectField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JBoolean)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JBooleanMarker)>>
SetStaticBooleanField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JByte)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JByteMarker)>>
SetStaticByteField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JChar)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JCharMarker)>>
SetStaticCharField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JShort)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JShortMarker)>>
SetStaticShortField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JInt)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JIntMarker)>>
SetStaticIntField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JLong)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JLongMarker)>>
SetStaticLongField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JFloat)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JFloatMarker)>>
SetStaticFloatField;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JClass, JFieldID, JDouble)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JClassPtr, JFieldIDPtr, JDoubleMarker)>>
SetStaticDoubleField;
external ffi.Pointer<
- ffi.NativeFunction<JString Function(ffi.Pointer<JChar>, JSize)>>
+ ffi.NativeFunction<
+ JStringPtr Function(ffi.Pointer<JCharMarker>, JSizeMarker)>>
NewString;
- external ffi.Pointer<ffi.NativeFunction<JSize Function(JString)>>
+ external ffi.Pointer<ffi.NativeFunction<JSizeMarker Function(JStringPtr)>>
GetStringLength;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JChar> Function(JString, ffi.Pointer<JBoolean>)>>
- GetStringChars;
+ ffi.NativeFunction<
+ ffi.Pointer<JCharMarker> Function(
+ JStringPtr, ffi.Pointer<JBooleanMarker>)>> GetStringChars;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JString, ffi.Pointer<JChar>)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JStringPtr, ffi.Pointer<JCharMarker>)>>
ReleaseStringChars;
- external ffi
- .Pointer<ffi.NativeFunction<JString Function(ffi.Pointer<ffi.Char>)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JStringPtr Function(ffi.Pointer<ffi.Char>)>>
NewStringUTF;
- external ffi.Pointer<ffi.NativeFunction<JSize Function(JString)>>
+ external ffi.Pointer<ffi.NativeFunction<JSizeMarker Function(JStringPtr)>>
GetStringUTFLength;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<ffi.Char> Function(JString, ffi.Pointer<JBoolean>)>>
- GetStringUTFChars;
+ ffi.NativeFunction<
+ ffi.Pointer<ffi.Char> Function(
+ JStringPtr, ffi.Pointer<JBooleanMarker>)>> GetStringUTFChars;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JString, ffi.Pointer<ffi.Char>)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JStringPtr, ffi.Pointer<ffi.Char>)>>
ReleaseStringUTFChars;
- external ffi.Pointer<ffi.NativeFunction<JSize Function(JArray)>>
+ external ffi.Pointer<ffi.NativeFunction<JSizeMarker Function(JArrayPtr)>>
GetArrayLength;
external ffi.Pointer<
- ffi.NativeFunction<JObjectArray Function(JSize, JClass, JObject)>>
+ ffi.NativeFunction<
+ JObjectArrayPtr Function(JSizeMarker, JClassPtr, JObjectPtr)>>
NewObjectArray;
- external ffi
- .Pointer<ffi.NativeFunction<JObject Function(JObjectArray, JSize)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<JObjectPtr Function(JObjectArrayPtr, JSizeMarker)>>
GetObjectArrayElement;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JObjectArray, JSize, JObject)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JObjectArrayPtr, JSizeMarker, JObjectPtr)>>
SetObjectArrayElement;
- external ffi.Pointer<ffi.NativeFunction<JBooleanArray Function(JSize)>>
+ external ffi
+ .Pointer<ffi.NativeFunction<JBooleanArrayPtr Function(JSizeMarker)>>
NewBooleanArray;
- external ffi.Pointer<ffi.NativeFunction<JByteArray Function(JSize)>>
+ external ffi.Pointer<ffi.NativeFunction<JByteArrayPtr Function(JSizeMarker)>>
NewByteArray;
- external ffi.Pointer<ffi.NativeFunction<JCharArray Function(JSize)>>
+ external ffi.Pointer<ffi.NativeFunction<JCharArrayPtr Function(JSizeMarker)>>
NewCharArray;
- external ffi.Pointer<ffi.NativeFunction<JShortArray Function(JSize)>>
+ external ffi.Pointer<ffi.NativeFunction<JShortArrayPtr Function(JSizeMarker)>>
NewShortArray;
- external ffi.Pointer<ffi.NativeFunction<JIntArray Function(JSize)>>
+ external ffi.Pointer<ffi.NativeFunction<JIntArrayPtr Function(JSizeMarker)>>
NewIntArray;
- external ffi.Pointer<ffi.NativeFunction<JLongArray Function(JSize)>>
+ external ffi.Pointer<ffi.NativeFunction<JLongArrayPtr Function(JSizeMarker)>>
NewLongArray;
- external ffi.Pointer<ffi.NativeFunction<JFloatArray Function(JSize)>>
+ external ffi.Pointer<ffi.NativeFunction<JFloatArrayPtr Function(JSizeMarker)>>
NewFloatArray;
- external ffi.Pointer<ffi.NativeFunction<JDoubleArray Function(JSize)>>
+ external ffi
+ .Pointer<ffi.NativeFunction<JDoubleArrayPtr Function(JSizeMarker)>>
NewDoubleArray;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JBoolean> Function(
- JBooleanArray, ffi.Pointer<JBoolean>)>> GetBooleanArrayElements;
+ ffi.NativeFunction<
+ ffi.Pointer<JBooleanMarker> Function(
+ JBooleanArrayPtr, ffi.Pointer<JBooleanMarker>)>>
+ GetBooleanArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JByte> Function(JByteArray, ffi.Pointer<JBoolean>)>>
+ ffi.Pointer<JByteMarker> Function(
+ JByteArrayPtr, ffi.Pointer<JBooleanMarker>)>>
GetByteArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JChar> Function(JCharArray, ffi.Pointer<JBoolean>)>>
+ ffi.Pointer<JCharMarker> Function(
+ JCharArrayPtr, ffi.Pointer<JBooleanMarker>)>>
GetCharArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JShort> Function(JShortArray, ffi.Pointer<JBoolean>)>>
+ ffi.Pointer<JShortMarker> Function(
+ JShortArrayPtr, ffi.Pointer<JBooleanMarker>)>>
GetShortArrayElements;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JInt> Function(JIntArray, ffi.Pointer<JBoolean>)>>
- GetIntArrayElements;
+ ffi.NativeFunction<
+ ffi.Pointer<JIntMarker> Function(
+ JIntArrayPtr, ffi.Pointer<JBooleanMarker>)>> GetIntArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JLong> Function(JLongArray, ffi.Pointer<JBoolean>)>>
+ ffi.Pointer<JLongMarker> Function(
+ JLongArrayPtr, ffi.Pointer<JBooleanMarker>)>>
GetLongArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<JFloat> Function(JFloatArray, ffi.Pointer<JBoolean>)>>
+ ffi.Pointer<JFloatMarker> Function(
+ JFloatArrayPtr, ffi.Pointer<JBooleanMarker>)>>
GetFloatArrayElements;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JDouble> Function(
- JDoubleArray, ffi.Pointer<JBoolean>)>> GetDoubleArrayElements;
+ ffi.NativeFunction<
+ ffi.Pointer<JDoubleMarker> Function(
+ JDoubleArrayPtr, ffi.Pointer<JBooleanMarker>)>>
+ GetDoubleArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JBooleanArray, ffi.Pointer<JBoolean>, JInt)>>
+ ffi.Void Function(
+ JBooleanArrayPtr, ffi.Pointer<JBooleanMarker>, JIntMarker)>>
ReleaseBooleanArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JByteArray, ffi.Pointer<JByte>, JInt)>>
+ ffi.Void Function(
+ JByteArrayPtr, ffi.Pointer<JByteMarker>, JIntMarker)>>
ReleaseByteArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JCharArray, ffi.Pointer<JChar>, JInt)>>
+ ffi.Void Function(
+ JCharArrayPtr, ffi.Pointer<JCharMarker>, JIntMarker)>>
ReleaseCharArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JShortArray, ffi.Pointer<JShort>, JInt)>>
+ ffi.Void Function(
+ JShortArrayPtr, ffi.Pointer<JShortMarker>, JIntMarker)>>
ReleaseShortArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JIntArray, ffi.Pointer<JInt>, JInt)>>
+ ffi.Void Function(
+ JIntArrayPtr, ffi.Pointer<JIntMarker>, JIntMarker)>>
ReleaseIntArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JLongArray, ffi.Pointer<JLong>, JInt)>>
+ ffi.Void Function(
+ JLongArrayPtr, ffi.Pointer<JLongMarker>, JIntMarker)>>
ReleaseLongArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JFloatArray, ffi.Pointer<JFloat>, JInt)>>
+ ffi.Void Function(
+ JFloatArrayPtr, ffi.Pointer<JFloatMarker>, JIntMarker)>>
ReleaseFloatArrayElements;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JDoubleArray, ffi.Pointer<JDouble>, JInt)>>
+ ffi.Void Function(
+ JDoubleArrayPtr, ffi.Pointer<JDoubleMarker>, JIntMarker)>>
ReleaseDoubleArrayElements;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JBooleanArray, JSize, JSize, ffi.Pointer<JBoolean>)>>
- GetBooleanArrayRegion;
+ ffi.NativeFunction<
+ ffi.Void Function(JBooleanArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JBooleanMarker>)>> GetBooleanArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JByteArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JByteMarker>)>> GetByteArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JCharArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JCharMarker>)>> GetCharArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JShortArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JShortMarker>)>> GetShortArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JIntArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JIntMarker>)>> GetIntArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JLongArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JLongMarker>)>> GetLongArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JFloatArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JFloatMarker>)>> GetFloatArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JDoubleArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JDoubleMarker>)>> GetDoubleArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JBooleanArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JBooleanMarker>)>> SetBooleanArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JByteArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JByteMarker>)>> SetByteArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JCharArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JCharMarker>)>> SetCharArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JShortArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JShortMarker>)>> SetShortArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JIntArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JIntMarker>)>> SetIntArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JLongArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JLongMarker>)>> SetLongArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JFloatArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JFloatMarker>)>> SetFloatArrayRegion;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JDoubleArrayPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JDoubleMarker>)>> SetDoubleArrayRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JByteArray, JSize, JSize, ffi.Pointer<JByte>)>>
- GetByteArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JCharArray, JSize, JSize, ffi.Pointer<JChar>)>>
- GetCharArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JShortArray, JSize, JSize, ffi.Pointer<JShort>)>>
- GetShortArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JIntArray, JSize, JSize, ffi.Pointer<JInt>)>>
- GetIntArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JLongArray, JSize, JSize, ffi.Pointer<JLong>)>>
- GetLongArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JFloatArray, JSize, JSize, ffi.Pointer<JFloat>)>>
- GetFloatArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JDoubleArray, JSize, JSize, ffi.Pointer<JDouble>)>>
- GetDoubleArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JBooleanArray, JSize, JSize, ffi.Pointer<JBoolean>)>>
- SetBooleanArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JByteArray, JSize, JSize, ffi.Pointer<JByte>)>>
- SetByteArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JCharArray, JSize, JSize, ffi.Pointer<JChar>)>>
- SetCharArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JShortArray, JSize, JSize, ffi.Pointer<JShort>)>>
- SetShortArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JIntArray, JSize, JSize, ffi.Pointer<JInt>)>>
- SetIntArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JLongArray, JSize, JSize, ffi.Pointer<JLong>)>>
- SetLongArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JFloatArray, JSize, JSize, ffi.Pointer<JFloat>)>>
- SetFloatArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- JDoubleArray, JSize, JSize, ffi.Pointer<JDouble>)>>
- SetDoubleArrayRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- JInt Function(JClass, ffi.Pointer<JNINativeMethod>, JInt)>>
+ JIntMarker Function(
+ JClassPtr, ffi.Pointer<JNINativeMethod>, JIntMarker)>>
RegisterNatives;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JClass)>>
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function(JClassPtr)>>
UnregisterNatives;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JObject)>> MonitorEnter;
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function(JObjectPtr)>>
+ MonitorEnter;
- external ffi.Pointer<ffi.NativeFunction<JInt Function(JObject)>> MonitorExit;
+ external ffi.Pointer<ffi.NativeFunction<JIntMarker Function(JObjectPtr)>>
+ MonitorExit;
external ffi.Pointer<
- ffi.NativeFunction<JInt Function(ffi.Pointer<ffi.Pointer<JavaVM>>)>>
- GetJavaVM;
+ ffi.NativeFunction<
+ JIntMarker Function(ffi.Pointer<ffi.Pointer<JavaVM>>)>> GetJavaVM;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(JStringPtr, JSizeMarker, JSizeMarker,
+ ffi.Pointer<JCharMarker>)>> GetStringRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JString, JSize, JSize, ffi.Pointer<JChar>)>>
- GetStringRegion;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(JString, JSize, JSize, ffi.Pointer<ffi.Char>)>>
+ ffi.Void Function(
+ JStringPtr, JSizeMarker, JSizeMarker, ffi.Pointer<ffi.Char>)>>
GetStringUTFRegion;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Pointer<ffi.Void> Function(JArray, ffi.Pointer<JBoolean>)>>
+ ffi.Pointer<ffi.Void> Function(
+ JArrayPtr, ffi.Pointer<JBooleanMarker>)>>
GetPrimitiveArrayCritical;
external ffi.Pointer<
ffi.NativeFunction<
- ffi.Void Function(JArray, ffi.Pointer<ffi.Void>, JInt)>>
+ ffi.Void Function(JArrayPtr, ffi.Pointer<ffi.Void>, JIntMarker)>>
ReleasePrimitiveArrayCritical;
external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Pointer<JChar> Function(JString, ffi.Pointer<JBoolean>)>>
- GetStringCritical;
+ ffi.NativeFunction<
+ ffi.Pointer<JCharMarker> Function(
+ JStringPtr, ffi.Pointer<JBooleanMarker>)>> GetStringCritical;
external ffi.Pointer<
- ffi.NativeFunction<ffi.Void Function(JString, ffi.Pointer<JChar>)>>
+ ffi.NativeFunction<
+ ffi.Void Function(JStringPtr, ffi.Pointer<JCharMarker>)>>
ReleaseStringCritical;
- external ffi.Pointer<ffi.NativeFunction<JWeak Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JWeakPtr Function(JObjectPtr)>>
NewWeakGlobalRef;
- external ffi.Pointer<ffi.NativeFunction<ffi.Void Function(JWeak)>>
+ external ffi.Pointer<ffi.NativeFunction<ffi.Void Function(JWeakPtr)>>
DeleteWeakGlobalRef;
- external ffi.Pointer<ffi.NativeFunction<JBoolean Function()>> ExceptionCheck;
+ external ffi.Pointer<ffi.NativeFunction<JBooleanMarker Function()>>
+ ExceptionCheck;
external ffi.Pointer<
- ffi.NativeFunction<JObject Function(ffi.Pointer<ffi.Void>, JLong)>>
+ ffi.NativeFunction<
+ JObjectPtr Function(ffi.Pointer<ffi.Void>, JLongMarker)>>
NewDirectByteBuffer;
- external ffi
- .Pointer<ffi.NativeFunction<ffi.Pointer<ffi.Void> Function(JObject)>>
+ external ffi.Pointer<
+ ffi.NativeFunction<ffi.Pointer<ffi.Void> Function(JObjectPtr)>>
GetDirectBufferAddress;
- external ffi.Pointer<ffi.NativeFunction<JLong Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<JLongMarker Function(JObjectPtr)>>
GetDirectBufferCapacity;
- external ffi.Pointer<ffi.NativeFunction<ffi.Int32 Function(JObject)>>
+ external ffi.Pointer<ffi.NativeFunction<ffi.Int32 Function(JObjectPtr)>>
GetObjectRefType;
}
@@ -2436,58 +2616,62 @@
return ref.GetVersion.asFunction<int Function()>()();
}
- JClass DefineClass(ffi.Pointer<ffi.Char> name, JObject loader,
- ffi.Pointer<JByte> buf, int bufLen) {
+ JClassPtr DefineClass(ffi.Pointer<ffi.Char> name, JObjectPtr loader,
+ ffi.Pointer<JByteMarker> buf, int bufLen) {
return ref.DefineClass.asFunction<
- JClass Function(ffi.Pointer<ffi.Char>, JObject, ffi.Pointer<JByte>,
- int)>()(name, loader, buf, bufLen);
+ JClassPtr Function(ffi.Pointer<ffi.Char>, JObjectPtr,
+ ffi.Pointer<JByteMarker>, int)>()(name, loader, buf, bufLen);
}
- JClass FindClass(ffi.Pointer<ffi.Char> name) {
- return ref.FindClass.asFunction<JClass Function(ffi.Pointer<ffi.Char>)>()(
- name);
+ JClassPtr FindClass(ffi.Pointer<ffi.Char> name) {
+ return ref.FindClass.asFunction<
+ JClassPtr Function(ffi.Pointer<ffi.Char>)>()(name);
}
- JMethodID FromReflectedMethod(JObject method) {
- return ref.FromReflectedMethod.asFunction<JMethodID Function(JObject)>()(
- method);
+ JMethodIDPtr FromReflectedMethod(JObjectPtr method) {
+ return ref.FromReflectedMethod.asFunction<
+ JMethodIDPtr Function(JObjectPtr)>()(method);
}
- JFieldID FromReflectedField(JObject field) {
- return ref.FromReflectedField.asFunction<JFieldID Function(JObject)>()(
- field);
+ JFieldIDPtr FromReflectedField(JObjectPtr field) {
+ return ref.FromReflectedField.asFunction<
+ JFieldIDPtr Function(JObjectPtr)>()(field);
}
- JObject ToReflectedMethod(JClass cls, JMethodID methodId, int isStatic) {
+ JObjectPtr ToReflectedMethod(
+ JClassPtr cls, JMethodIDPtr methodId, int isStatic) {
return ref.ToReflectedMethod.asFunction<
- JObject Function(JClass, JMethodID, int)>()(cls, methodId, isStatic);
+ JObjectPtr Function(
+ JClassPtr, JMethodIDPtr, int)>()(cls, methodId, isStatic);
}
- JClass GetSuperclass(JClass clazz) {
- return ref.GetSuperclass.asFunction<JClass Function(JClass)>()(clazz);
+ JClassPtr GetSuperclass(JClassPtr clazz) {
+ return ref.GetSuperclass.asFunction<JClassPtr Function(JClassPtr)>()(clazz);
}
- int IsAssignableFrom(JClass clazz1, JClass clazz2) {
- return ref.IsAssignableFrom.asFunction<int Function(JClass, JClass)>()(
- clazz1, clazz2);
+ int IsAssignableFrom(JClassPtr clazz1, JClassPtr clazz2) {
+ return ref.IsAssignableFrom.asFunction<
+ int Function(JClassPtr, JClassPtr)>()(clazz1, clazz2);
}
- JObject ToReflectedField(JClass cls, JFieldID fieldID, int isStatic) {
+ JObjectPtr ToReflectedField(
+ JClassPtr cls, JFieldIDPtr fieldID, int isStatic) {
return ref.ToReflectedField.asFunction<
- JObject Function(JClass, JFieldID, int)>()(cls, fieldID, isStatic);
+ JObjectPtr Function(
+ JClassPtr, JFieldIDPtr, int)>()(cls, fieldID, isStatic);
}
- int Throw(JThrowable obj) {
- return ref.Throw.asFunction<int Function(JThrowable)>()(obj);
+ int Throw(JThrowablePtr obj) {
+ return ref.Throw.asFunction<int Function(JThrowablePtr)>()(obj);
}
- int ThrowNew(JClass clazz, ffi.Pointer<ffi.Char> message) {
+ int ThrowNew(JClassPtr clazz, ffi.Pointer<ffi.Char> message) {
return ref.ThrowNew.asFunction<
- int Function(JClass, ffi.Pointer<ffi.Char>)>()(clazz, message);
+ int Function(JClassPtr, ffi.Pointer<ffi.Char>)>()(clazz, message);
}
- JThrowable ExceptionOccurred() {
- return ref.ExceptionOccurred.asFunction<JThrowable Function()>()();
+ JThrowablePtr ExceptionOccurred() {
+ return ref.ExceptionOccurred.asFunction<JThrowablePtr Function()>()();
}
void ExceptionDescribe() {
@@ -2507,20 +2691,22 @@
return ref.PushLocalFrame.asFunction<int Function(int)>()(capacity);
}
- JObject PopLocalFrame(JObject result) {
- return ref.PopLocalFrame.asFunction<JObject Function(JObject)>()(result);
+ JObjectPtr PopLocalFrame(JObjectPtr result) {
+ return ref.PopLocalFrame.asFunction<JObjectPtr Function(JObjectPtr)>()(
+ result);
}
- JObject NewGlobalRef(JObject obj) {
- return ref.NewGlobalRef.asFunction<JObject Function(JObject)>()(obj);
+ JObjectPtr NewGlobalRef(JObjectPtr obj) {
+ return ref.NewGlobalRef.asFunction<JObjectPtr Function(JObjectPtr)>()(obj);
}
- void DeleteGlobalRef(JObject globalRef) {
- return ref.DeleteGlobalRef.asFunction<void Function(JObject)>()(globalRef);
+ void DeleteGlobalRef(JObjectPtr globalRef) {
+ return ref.DeleteGlobalRef.asFunction<void Function(JObjectPtr)>()(
+ globalRef);
}
- int IsSameObject(JObject ref1, JObject ref2) {
- return ref.IsSameObject.asFunction<int Function(JObject, JObject)>()(
+ int IsSameObject(JObjectPtr ref1, JObjectPtr ref2) {
+ return ref.IsSameObject.asFunction<int Function(JObjectPtr, JObjectPtr)>()(
ref1, ref2);
}
@@ -2528,936 +2714,955 @@
return ref.EnsureLocalCapacity.asFunction<int Function(int)>()(capacity);
}
- JObject AllocObject(JClass clazz) {
- return ref.AllocObject.asFunction<JObject Function(JClass)>()(clazz);
+ JObjectPtr AllocObject(JClassPtr clazz) {
+ return ref.AllocObject.asFunction<JObjectPtr Function(JClassPtr)>()(clazz);
}
- JObject NewObject(JClass arg1, JMethodID arg2) {
- return ref.NewObject.asFunction<JObject Function(JClass, JMethodID)>()(
- arg1, arg2);
+ JObjectPtr NewObject(JClassPtr arg1, JMethodIDPtr arg2) {
+ return ref.NewObject.asFunction<
+ JObjectPtr Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
- JObject NewObjectA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr NewObjectA(
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.NewObjectA.asFunction<
- JObject Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ JObjectPtr Function(JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(clazz, methodID, args);
}
- JClass GetObjectClass(JObject obj) {
- return ref.GetObjectClass.asFunction<JClass Function(JObject)>()(obj);
+ JClassPtr GetObjectClass(JObjectPtr obj) {
+ return ref.GetObjectClass.asFunction<JClassPtr Function(JObjectPtr)>()(obj);
}
- int IsInstanceOf(JObject obj, JClass clazz) {
- return ref.IsInstanceOf.asFunction<int Function(JObject, JClass)>()(
+ int IsInstanceOf(JObjectPtr obj, JClassPtr clazz) {
+ return ref.IsInstanceOf.asFunction<int Function(JObjectPtr, JClassPtr)>()(
obj, clazz);
}
- JMethodID GetMethodID(
- JClass clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
+ JMethodIDPtr GetMethodID(
+ JClassPtr clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
return ref.GetMethodID.asFunction<
- JMethodID Function(JClass, ffi.Pointer<ffi.Char>,
+ JMethodIDPtr Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(clazz, name, sig);
}
- JObject CallObjectMethod(JObject arg1, JMethodID arg2) {
+ JObjectPtr CallObjectMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
return ref.CallObjectMethod.asFunction<
- JObject Function(JObject, JMethodID)>()(arg1, arg2);
+ JObjectPtr Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
- JObject CallObjectMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr CallObjectMethodA(
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallObjectMethodA.asFunction<
- JObject Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ JObjectPtr Function(JObjectPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, methodID, args);
}
- int CallBooleanMethod(JObject arg1, JMethodID arg2) {
- return ref.CallBooleanMethod.asFunction<int Function(JObject, JMethodID)>()(
- arg1, arg2);
+ int CallBooleanMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallBooleanMethod.asFunction<
+ int Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallBooleanMethodA(
- JObject obj, JMethodID methodId, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodId, ffi.Pointer<JValue> args) {
return ref.CallBooleanMethodA.asFunction<
- int Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodId, args);
+ int Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodId, args);
}
- int CallByteMethod(JObject arg1, JMethodID arg2) {
- return ref.CallByteMethod.asFunction<int Function(JObject, JMethodID)>()(
- arg1, arg2);
+ int CallByteMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallByteMethod.asFunction<
+ int Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallByteMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallByteMethodA.asFunction<
- int Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ int Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- int CallCharMethod(JObject arg1, JMethodID arg2) {
- return ref.CallCharMethod.asFunction<int Function(JObject, JMethodID)>()(
- arg1, arg2);
+ int CallCharMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallCharMethod.asFunction<
+ int Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallCharMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallCharMethodA.asFunction<
- int Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ int Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- int CallShortMethod(JObject arg1, JMethodID arg2) {
- return ref.CallShortMethod.asFunction<int Function(JObject, JMethodID)>()(
- arg1, arg2);
+ int CallShortMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallShortMethod.asFunction<
+ int Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallShortMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallShortMethodA.asFunction<
- int Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ int Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- int CallIntMethod(JObject arg1, JMethodID arg2) {
- return ref.CallIntMethod.asFunction<int Function(JObject, JMethodID)>()(
- arg1, arg2);
+ int CallIntMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallIntMethod.asFunction<
+ int Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallIntMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallIntMethodA.asFunction<
- int Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ int Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- int CallLongMethod(JObject arg1, JMethodID arg2) {
- return ref.CallLongMethod.asFunction<int Function(JObject, JMethodID)>()(
- arg1, arg2);
+ int CallLongMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallLongMethod.asFunction<
+ int Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallLongMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallLongMethodA.asFunction<
- int Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ int Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- double CallFloatMethod(JObject arg1, JMethodID arg2) {
+ double CallFloatMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
return ref.CallFloatMethod.asFunction<
- double Function(JObject, JMethodID)>()(arg1, arg2);
+ double Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
double CallFloatMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallFloatMethodA.asFunction<
- double Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ double Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- double CallDoubleMethod(JObject arg1, JMethodID arg2) {
+ double CallDoubleMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
return ref.CallDoubleMethod.asFunction<
- double Function(JObject, JMethodID)>()(arg1, arg2);
+ double Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
double CallDoubleMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallDoubleMethodA.asFunction<
- double Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ double Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- void CallVoidMethod(JObject arg1, JMethodID arg2) {
- return ref.CallVoidMethod.asFunction<void Function(JObject, JMethodID)>()(
- arg1, arg2);
+ void CallVoidMethod(JObjectPtr arg1, JMethodIDPtr arg2) {
+ return ref.CallVoidMethod.asFunction<
+ void Function(JObjectPtr, JMethodIDPtr)>()(arg1, arg2);
}
void CallVoidMethodA(
- JObject obj, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr obj, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallVoidMethodA.asFunction<
- void Function(
- JObject, JMethodID, ffi.Pointer<JValue>)>()(obj, methodID, args);
+ void Function(JObjectPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ obj, methodID, args);
}
- JObject CallNonvirtualObjectMethod(
- JObject arg1, JClass arg2, JMethodID arg3) {
+ JObjectPtr CallNonvirtualObjectMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualObjectMethod.asFunction<
- JObject Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ JObjectPtr Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- JObject CallNonvirtualObjectMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr CallNonvirtualObjectMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualObjectMethodA.asFunction<
- JObject Function(JObject, JClass, JMethodID,
+ JObjectPtr Function(JObjectPtr, JClassPtr, JMethodIDPtr,
ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- int CallNonvirtualBooleanMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ int CallNonvirtualBooleanMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualBooleanMethod.asFunction<
- int Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- int CallNonvirtualBooleanMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ int CallNonvirtualBooleanMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualBooleanMethodA.asFunction<
- int Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- int CallNonvirtualByteMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ int CallNonvirtualByteMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualByteMethod.asFunction<
- int Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- int CallNonvirtualByteMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ int CallNonvirtualByteMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualByteMethodA.asFunction<
- int Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- int CallNonvirtualCharMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ int CallNonvirtualCharMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualCharMethod.asFunction<
- int Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- int CallNonvirtualCharMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ int CallNonvirtualCharMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualCharMethodA.asFunction<
- int Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- int CallNonvirtualShortMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ int CallNonvirtualShortMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualShortMethod.asFunction<
- int Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- int CallNonvirtualShortMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ int CallNonvirtualShortMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualShortMethodA.asFunction<
- int Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- int CallNonvirtualIntMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ int CallNonvirtualIntMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualIntMethod.asFunction<
- int Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- int CallNonvirtualIntMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ int CallNonvirtualIntMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualIntMethodA.asFunction<
- int Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- int CallNonvirtualLongMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ int CallNonvirtualLongMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualLongMethod.asFunction<
- int Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- int CallNonvirtualLongMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ int CallNonvirtualLongMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualLongMethodA.asFunction<
- int Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ int Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- double CallNonvirtualFloatMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ double CallNonvirtualFloatMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualFloatMethod.asFunction<
- double Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ double Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- double CallNonvirtualFloatMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ double CallNonvirtualFloatMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualFloatMethodA.asFunction<
- double Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ double Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- double CallNonvirtualDoubleMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ double CallNonvirtualDoubleMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualDoubleMethod.asFunction<
- double Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ double Function(
+ JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- double CallNonvirtualDoubleMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ double CallNonvirtualDoubleMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualDoubleMethodA.asFunction<
- double Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ double Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- void CallNonvirtualVoidMethod(JObject arg1, JClass arg2, JMethodID arg3) {
+ void CallNonvirtualVoidMethod(
+ JObjectPtr arg1, JClassPtr arg2, JMethodIDPtr arg3) {
return ref.CallNonvirtualVoidMethod.asFunction<
- void Function(JObject, JClass, JMethodID)>()(arg1, arg2, arg3);
+ void Function(JObjectPtr, JClassPtr, JMethodIDPtr)>()(arg1, arg2, arg3);
}
- void CallNonvirtualVoidMethodA(
- JObject obj, JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ void CallNonvirtualVoidMethodA(JObjectPtr obj, JClassPtr clazz,
+ JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallNonvirtualVoidMethodA.asFunction<
- void Function(JObject, JClass, JMethodID, ffi.Pointer<JValue>)>()(
- obj, clazz, methodID, args);
+ void Function(JObjectPtr, JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(obj, clazz, methodID, args);
}
- JFieldID GetFieldID(
- JClass clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
+ JFieldIDPtr GetFieldID(
+ JClassPtr clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
return ref.GetFieldID.asFunction<
- JFieldID Function(JClass, ffi.Pointer<ffi.Char>,
+ JFieldIDPtr Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(clazz, name, sig);
}
- JObject GetObjectField(JObject obj, JFieldID fieldID) {
- return ref.GetObjectField.asFunction<JObject Function(JObject, JFieldID)>()(
+ JObjectPtr GetObjectField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetObjectField.asFunction<
+ JObjectPtr Function(JObjectPtr, JFieldIDPtr)>()(obj, fieldID);
+ }
+
+ int GetBooleanField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetBooleanField.asFunction<
+ int Function(JObjectPtr, JFieldIDPtr)>()(obj, fieldID);
+ }
+
+ int GetByteField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetByteField.asFunction<int Function(JObjectPtr, JFieldIDPtr)>()(
obj, fieldID);
}
- int GetBooleanField(JObject obj, JFieldID fieldID) {
- return ref.GetBooleanField.asFunction<int Function(JObject, JFieldID)>()(
+ int GetCharField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetCharField.asFunction<int Function(JObjectPtr, JFieldIDPtr)>()(
obj, fieldID);
}
- int GetByteField(JObject obj, JFieldID fieldID) {
- return ref.GetByteField.asFunction<int Function(JObject, JFieldID)>()(
+ int GetShortField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetShortField.asFunction<
+ int Function(JObjectPtr, JFieldIDPtr)>()(obj, fieldID);
+ }
+
+ int GetIntField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetIntField.asFunction<int Function(JObjectPtr, JFieldIDPtr)>()(
obj, fieldID);
}
- int GetCharField(JObject obj, JFieldID fieldID) {
- return ref.GetCharField.asFunction<int Function(JObject, JFieldID)>()(
+ int GetLongField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetLongField.asFunction<int Function(JObjectPtr, JFieldIDPtr)>()(
obj, fieldID);
}
- int GetShortField(JObject obj, JFieldID fieldID) {
- return ref.GetShortField.asFunction<int Function(JObject, JFieldID)>()(
- obj, fieldID);
+ double GetFloatField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetFloatField.asFunction<
+ double Function(JObjectPtr, JFieldIDPtr)>()(obj, fieldID);
}
- int GetIntField(JObject obj, JFieldID fieldID) {
- return ref.GetIntField.asFunction<int Function(JObject, JFieldID)>()(
- obj, fieldID);
+ double GetDoubleField(JObjectPtr obj, JFieldIDPtr fieldID) {
+ return ref.GetDoubleField.asFunction<
+ double Function(JObjectPtr, JFieldIDPtr)>()(obj, fieldID);
}
- int GetLongField(JObject obj, JFieldID fieldID) {
- return ref.GetLongField.asFunction<int Function(JObject, JFieldID)>()(
- obj, fieldID);
- }
-
- double GetFloatField(JObject obj, JFieldID fieldID) {
- return ref.GetFloatField.asFunction<double Function(JObject, JFieldID)>()(
- obj, fieldID);
- }
-
- double GetDoubleField(JObject obj, JFieldID fieldID) {
- return ref.GetDoubleField.asFunction<double Function(JObject, JFieldID)>()(
- obj, fieldID);
- }
-
- void SetObjectField(JObject obj, JFieldID fieldID, JObject val) {
+ void SetObjectField(JObjectPtr obj, JFieldIDPtr fieldID, JObjectPtr val) {
return ref.SetObjectField.asFunction<
- void Function(JObject, JFieldID, JObject)>()(obj, fieldID, val);
+ void Function(
+ JObjectPtr, JFieldIDPtr, JObjectPtr)>()(obj, fieldID, val);
}
- void SetBooleanField(JObject obj, JFieldID fieldID, int val) {
+ void SetBooleanField(JObjectPtr obj, JFieldIDPtr fieldID, int val) {
return ref.SetBooleanField.asFunction<
- void Function(JObject, JFieldID, int)>()(obj, fieldID, val);
+ void Function(JObjectPtr, JFieldIDPtr, int)>()(obj, fieldID, val);
}
- void SetByteField(JObject obj, JFieldID fieldID, int val) {
- return ref.SetByteField.asFunction<void Function(JObject, JFieldID, int)>()(
- obj, fieldID, val);
+ void SetByteField(JObjectPtr obj, JFieldIDPtr fieldID, int val) {
+ return ref.SetByteField.asFunction<
+ void Function(JObjectPtr, JFieldIDPtr, int)>()(obj, fieldID, val);
}
- void SetCharField(JObject obj, JFieldID fieldID, int val) {
- return ref.SetCharField.asFunction<void Function(JObject, JFieldID, int)>()(
- obj, fieldID, val);
+ void SetCharField(JObjectPtr obj, JFieldIDPtr fieldID, int val) {
+ return ref.SetCharField.asFunction<
+ void Function(JObjectPtr, JFieldIDPtr, int)>()(obj, fieldID, val);
}
- void SetShortField(JObject obj, JFieldID fieldID, int val) {
+ void SetShortField(JObjectPtr obj, JFieldIDPtr fieldID, int val) {
return ref.SetShortField.asFunction<
- void Function(JObject, JFieldID, int)>()(obj, fieldID, val);
+ void Function(JObjectPtr, JFieldIDPtr, int)>()(obj, fieldID, val);
}
- void SetIntField(JObject obj, JFieldID fieldID, int val) {
- return ref.SetIntField.asFunction<void Function(JObject, JFieldID, int)>()(
- obj, fieldID, val);
+ void SetIntField(JObjectPtr obj, JFieldIDPtr fieldID, int val) {
+ return ref.SetIntField.asFunction<
+ void Function(JObjectPtr, JFieldIDPtr, int)>()(obj, fieldID, val);
}
- void SetLongField(JObject obj, JFieldID fieldID, int val) {
- return ref.SetLongField.asFunction<void Function(JObject, JFieldID, int)>()(
- obj, fieldID, val);
+ void SetLongField(JObjectPtr obj, JFieldIDPtr fieldID, int val) {
+ return ref.SetLongField.asFunction<
+ void Function(JObjectPtr, JFieldIDPtr, int)>()(obj, fieldID, val);
}
- void SetFloatField(JObject obj, JFieldID fieldID, double val) {
+ void SetFloatField(JObjectPtr obj, JFieldIDPtr fieldID, double val) {
return ref.SetFloatField.asFunction<
- void Function(JObject, JFieldID, double)>()(obj, fieldID, val);
+ void Function(JObjectPtr, JFieldIDPtr, double)>()(obj, fieldID, val);
}
- void SetDoubleField(JObject obj, JFieldID fieldID, double val) {
+ void SetDoubleField(JObjectPtr obj, JFieldIDPtr fieldID, double val) {
return ref.SetDoubleField.asFunction<
- void Function(JObject, JFieldID, double)>()(obj, fieldID, val);
+ void Function(JObjectPtr, JFieldIDPtr, double)>()(obj, fieldID, val);
}
- JMethodID GetStaticMethodID(
- JClass clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
+ JMethodIDPtr GetStaticMethodID(
+ JClassPtr clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
return ref.GetStaticMethodID.asFunction<
- JMethodID Function(JClass, ffi.Pointer<ffi.Char>,
+ JMethodIDPtr Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(clazz, name, sig);
}
- JObject CallStaticObjectMethod(JClass arg1, JMethodID arg2) {
+ JObjectPtr CallStaticObjectMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticObjectMethod.asFunction<
- JObject Function(JClass, JMethodID)>()(arg1, arg2);
+ JObjectPtr Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
- JObject CallStaticObjectMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JObjectPtr CallStaticObjectMethodA(
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticObjectMethodA.asFunction<
- JObject Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ JObjectPtr Function(JClassPtr, JMethodIDPtr,
+ ffi.Pointer<JValue>)>()(clazz, methodID, args);
}
- int CallStaticBooleanMethod(JClass arg1, JMethodID arg2) {
+ int CallStaticBooleanMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticBooleanMethod.asFunction<
- int Function(JClass, JMethodID)>()(arg1, arg2);
+ int Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallStaticBooleanMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticBooleanMethodA.asFunction<
- int Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ int Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- int CallStaticByteMethod(JClass arg1, JMethodID arg2) {
+ int CallStaticByteMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticByteMethod.asFunction<
- int Function(JClass, JMethodID)>()(arg1, arg2);
+ int Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallStaticByteMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticByteMethodA.asFunction<
- int Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ int Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- int CallStaticCharMethod(JClass arg1, JMethodID arg2) {
+ int CallStaticCharMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticCharMethod.asFunction<
- int Function(JClass, JMethodID)>()(arg1, arg2);
+ int Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallStaticCharMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticCharMethodA.asFunction<
- int Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ int Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- int CallStaticShortMethod(JClass arg1, JMethodID arg2) {
+ int CallStaticShortMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticShortMethod.asFunction<
- int Function(JClass, JMethodID)>()(arg1, arg2);
+ int Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallStaticShortMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticShortMethodA.asFunction<
- int Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ int Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- int CallStaticIntMethod(JClass arg1, JMethodID arg2) {
+ int CallStaticIntMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticIntMethod.asFunction<
- int Function(JClass, JMethodID)>()(arg1, arg2);
+ int Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallStaticIntMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticIntMethodA.asFunction<
- int Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ int Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- int CallStaticLongMethod(JClass arg1, JMethodID arg2) {
+ int CallStaticLongMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticLongMethod.asFunction<
- int Function(JClass, JMethodID)>()(arg1, arg2);
+ int Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
int CallStaticLongMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticLongMethodA.asFunction<
- int Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ int Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- double CallStaticFloatMethod(JClass arg1, JMethodID arg2) {
+ double CallStaticFloatMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticFloatMethod.asFunction<
- double Function(JClass, JMethodID)>()(arg1, arg2);
+ double Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
double CallStaticFloatMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticFloatMethodA.asFunction<
- double Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ double Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- double CallStaticDoubleMethod(JClass arg1, JMethodID arg2) {
+ double CallStaticDoubleMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticDoubleMethod.asFunction<
- double Function(JClass, JMethodID)>()(arg1, arg2);
+ double Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
double CallStaticDoubleMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticDoubleMethodA.asFunction<
- double Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ double Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- void CallStaticVoidMethod(JClass arg1, JMethodID arg2) {
+ void CallStaticVoidMethod(JClassPtr arg1, JMethodIDPtr arg2) {
return ref.CallStaticVoidMethod.asFunction<
- void Function(JClass, JMethodID)>()(arg1, arg2);
+ void Function(JClassPtr, JMethodIDPtr)>()(arg1, arg2);
}
void CallStaticVoidMethodA(
- JClass clazz, JMethodID methodID, ffi.Pointer<JValue> args) {
+ JClassPtr clazz, JMethodIDPtr methodID, ffi.Pointer<JValue> args) {
return ref.CallStaticVoidMethodA.asFunction<
- void Function(
- JClass, JMethodID, ffi.Pointer<JValue>)>()(clazz, methodID, args);
+ void Function(JClassPtr, JMethodIDPtr, ffi.Pointer<JValue>)>()(
+ clazz, methodID, args);
}
- JFieldID GetStaticFieldID(
- JClass clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
+ JFieldIDPtr GetStaticFieldID(
+ JClassPtr clazz, ffi.Pointer<ffi.Char> name, ffi.Pointer<ffi.Char> sig) {
return ref.GetStaticFieldID.asFunction<
- JFieldID Function(JClass, ffi.Pointer<ffi.Char>,
+ JFieldIDPtr Function(JClassPtr, ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>)>()(clazz, name, sig);
}
- JObject GetStaticObjectField(JClass clazz, JFieldID fieldID) {
+ JObjectPtr GetStaticObjectField(JClassPtr clazz, JFieldIDPtr fieldID) {
return ref.GetStaticObjectField.asFunction<
- JObject Function(JClass, JFieldID)>()(clazz, fieldID);
+ JObjectPtr Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- int GetStaticBooleanField(JClass clazz, JFieldID fieldID) {
+ int GetStaticBooleanField(JClassPtr clazz, JFieldIDPtr fieldID) {
return ref.GetStaticBooleanField.asFunction<
- int Function(JClass, JFieldID)>()(clazz, fieldID);
+ int Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- int GetStaticByteField(JClass clazz, JFieldID fieldID) {
- return ref.GetStaticByteField.asFunction<int Function(JClass, JFieldID)>()(
- clazz, fieldID);
+ int GetStaticByteField(JClassPtr clazz, JFieldIDPtr fieldID) {
+ return ref.GetStaticByteField.asFunction<
+ int Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- int GetStaticCharField(JClass clazz, JFieldID fieldID) {
- return ref.GetStaticCharField.asFunction<int Function(JClass, JFieldID)>()(
- clazz, fieldID);
+ int GetStaticCharField(JClassPtr clazz, JFieldIDPtr fieldID) {
+ return ref.GetStaticCharField.asFunction<
+ int Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- int GetStaticShortField(JClass clazz, JFieldID fieldID) {
- return ref.GetStaticShortField.asFunction<int Function(JClass, JFieldID)>()(
- clazz, fieldID);
+ int GetStaticShortField(JClassPtr clazz, JFieldIDPtr fieldID) {
+ return ref.GetStaticShortField.asFunction<
+ int Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- int GetStaticIntField(JClass clazz, JFieldID fieldID) {
- return ref.GetStaticIntField.asFunction<int Function(JClass, JFieldID)>()(
- clazz, fieldID);
+ int GetStaticIntField(JClassPtr clazz, JFieldIDPtr fieldID) {
+ return ref.GetStaticIntField.asFunction<
+ int Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- int GetStaticLongField(JClass clazz, JFieldID fieldID) {
- return ref.GetStaticLongField.asFunction<int Function(JClass, JFieldID)>()(
- clazz, fieldID);
+ int GetStaticLongField(JClassPtr clazz, JFieldIDPtr fieldID) {
+ return ref.GetStaticLongField.asFunction<
+ int Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- double GetStaticFloatField(JClass clazz, JFieldID fieldID) {
+ double GetStaticFloatField(JClassPtr clazz, JFieldIDPtr fieldID) {
return ref.GetStaticFloatField.asFunction<
- double Function(JClass, JFieldID)>()(clazz, fieldID);
+ double Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- double GetStaticDoubleField(JClass clazz, JFieldID fieldID) {
+ double GetStaticDoubleField(JClassPtr clazz, JFieldIDPtr fieldID) {
return ref.GetStaticDoubleField.asFunction<
- double Function(JClass, JFieldID)>()(clazz, fieldID);
+ double Function(JClassPtr, JFieldIDPtr)>()(clazz, fieldID);
}
- void SetStaticObjectField(JClass clazz, JFieldID fieldID, JObject val) {
+ void SetStaticObjectField(
+ JClassPtr clazz, JFieldIDPtr fieldID, JObjectPtr val) {
return ref.SetStaticObjectField.asFunction<
- void Function(JClass, JFieldID, JObject)>()(clazz, fieldID, val);
+ void Function(
+ JClassPtr, JFieldIDPtr, JObjectPtr)>()(clazz, fieldID, val);
}
- void SetStaticBooleanField(JClass clazz, JFieldID fieldID, int val) {
+ void SetStaticBooleanField(JClassPtr clazz, JFieldIDPtr fieldID, int val) {
return ref.SetStaticBooleanField.asFunction<
- void Function(JClass, JFieldID, int)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, int)>()(clazz, fieldID, val);
}
- void SetStaticByteField(JClass clazz, JFieldID fieldID, int val) {
+ void SetStaticByteField(JClassPtr clazz, JFieldIDPtr fieldID, int val) {
return ref.SetStaticByteField.asFunction<
- void Function(JClass, JFieldID, int)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, int)>()(clazz, fieldID, val);
}
- void SetStaticCharField(JClass clazz, JFieldID fieldID, int val) {
+ void SetStaticCharField(JClassPtr clazz, JFieldIDPtr fieldID, int val) {
return ref.SetStaticCharField.asFunction<
- void Function(JClass, JFieldID, int)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, int)>()(clazz, fieldID, val);
}
- void SetStaticShortField(JClass clazz, JFieldID fieldID, int val) {
+ void SetStaticShortField(JClassPtr clazz, JFieldIDPtr fieldID, int val) {
return ref.SetStaticShortField.asFunction<
- void Function(JClass, JFieldID, int)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, int)>()(clazz, fieldID, val);
}
- void SetStaticIntField(JClass clazz, JFieldID fieldID, int val) {
+ void SetStaticIntField(JClassPtr clazz, JFieldIDPtr fieldID, int val) {
return ref.SetStaticIntField.asFunction<
- void Function(JClass, JFieldID, int)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, int)>()(clazz, fieldID, val);
}
- void SetStaticLongField(JClass clazz, JFieldID fieldID, int val) {
+ void SetStaticLongField(JClassPtr clazz, JFieldIDPtr fieldID, int val) {
return ref.SetStaticLongField.asFunction<
- void Function(JClass, JFieldID, int)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, int)>()(clazz, fieldID, val);
}
- void SetStaticFloatField(JClass clazz, JFieldID fieldID, double val) {
+ void SetStaticFloatField(JClassPtr clazz, JFieldIDPtr fieldID, double val) {
return ref.SetStaticFloatField.asFunction<
- void Function(JClass, JFieldID, double)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, double)>()(clazz, fieldID, val);
}
- void SetStaticDoubleField(JClass clazz, JFieldID fieldID, double val) {
+ void SetStaticDoubleField(JClassPtr clazz, JFieldIDPtr fieldID, double val) {
return ref.SetStaticDoubleField.asFunction<
- void Function(JClass, JFieldID, double)>()(clazz, fieldID, val);
+ void Function(JClassPtr, JFieldIDPtr, double)>()(clazz, fieldID, val);
}
- JString NewString(ffi.Pointer<JChar> unicodeChars, int len) {
+ JStringPtr NewString(ffi.Pointer<JCharMarker> unicodeChars, int len) {
return ref.NewString.asFunction<
- JString Function(ffi.Pointer<JChar>, int)>()(unicodeChars, len);
+ JStringPtr Function(
+ ffi.Pointer<JCharMarker>, int)>()(unicodeChars, len);
}
- int GetStringLength(JString string) {
- return ref.GetStringLength.asFunction<int Function(JString)>()(string);
+ int GetStringLength(JStringPtr string) {
+ return ref.GetStringLength.asFunction<int Function(JStringPtr)>()(string);
}
- ffi.Pointer<JChar> GetStringChars(
- JString string, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JCharMarker> GetStringChars(
+ JStringPtr string, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetStringChars.asFunction<
- ffi.Pointer<JChar> Function(
- JString, ffi.Pointer<JBoolean>)>()(string, isCopy);
+ ffi.Pointer<JCharMarker> Function(
+ JStringPtr, ffi.Pointer<JBooleanMarker>)>()(string, isCopy);
}
- void ReleaseStringChars(JString string, ffi.Pointer<JChar> isCopy) {
+ void ReleaseStringChars(JStringPtr string, ffi.Pointer<JCharMarker> isCopy) {
return ref.ReleaseStringChars.asFunction<
- void Function(JString, ffi.Pointer<JChar>)>()(string, isCopy);
+ void Function(JStringPtr, ffi.Pointer<JCharMarker>)>()(string, isCopy);
}
- JString NewStringUTF(ffi.Pointer<ffi.Char> bytes) {
+ JStringPtr NewStringUTF(ffi.Pointer<ffi.Char> bytes) {
return ref.NewStringUTF.asFunction<
- JString Function(ffi.Pointer<ffi.Char>)>()(bytes);
+ JStringPtr Function(ffi.Pointer<ffi.Char>)>()(bytes);
}
- int GetStringUTFLength(JString string) {
- return ref.GetStringUTFLength.asFunction<int Function(JString)>()(string);
+ int GetStringUTFLength(JStringPtr string) {
+ return ref.GetStringUTFLength.asFunction<int Function(JStringPtr)>()(
+ string);
}
ffi.Pointer<ffi.Char> GetStringUTFChars(
- JString string, ffi.Pointer<JBoolean> isCopy) {
+ JStringPtr string, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetStringUTFChars.asFunction<
ffi.Pointer<ffi.Char> Function(
- JString, ffi.Pointer<JBoolean>)>()(string, isCopy);
+ JStringPtr, ffi.Pointer<JBooleanMarker>)>()(string, isCopy);
}
- void ReleaseStringUTFChars(JString string, ffi.Pointer<ffi.Char> utf) {
+ void ReleaseStringUTFChars(JStringPtr string, ffi.Pointer<ffi.Char> utf) {
return ref.ReleaseStringUTFChars.asFunction<
- void Function(JString, ffi.Pointer<ffi.Char>)>()(string, utf);
+ void Function(JStringPtr, ffi.Pointer<ffi.Char>)>()(string, utf);
}
- int GetArrayLength(JArray array) {
- return ref.GetArrayLength.asFunction<int Function(JArray)>()(array);
+ int GetArrayLength(JArrayPtr array) {
+ return ref.GetArrayLength.asFunction<int Function(JArrayPtr)>()(array);
}
- JObjectArray NewObjectArray(
- int length, JClass elementClass, JObject initialElement) {
+ JObjectArrayPtr NewObjectArray(
+ int length, JClassPtr elementClass, JObjectPtr initialElement) {
return ref.NewObjectArray.asFunction<
- JObjectArray Function(
- int, JClass, JObject)>()(length, elementClass, initialElement);
+ JObjectArrayPtr Function(int, JClassPtr, JObjectPtr)>()(
+ length, elementClass, initialElement);
}
- JObject GetObjectArrayElement(JObjectArray array, int index) {
+ JObjectPtr GetObjectArrayElement(JObjectArrayPtr array, int index) {
return ref.GetObjectArrayElement.asFunction<
- JObject Function(JObjectArray, int)>()(array, index);
+ JObjectPtr Function(JObjectArrayPtr, int)>()(array, index);
}
- void SetObjectArrayElement(JObjectArray array, int index, JObject val) {
+ void SetObjectArrayElement(JObjectArrayPtr array, int index, JObjectPtr val) {
return ref.SetObjectArrayElement.asFunction<
- void Function(JObjectArray, int, JObject)>()(array, index, val);
+ void Function(JObjectArrayPtr, int, JObjectPtr)>()(array, index, val);
}
- JBooleanArray NewBooleanArray(int length) {
- return ref.NewBooleanArray.asFunction<JBooleanArray Function(int)>()(
+ JBooleanArrayPtr NewBooleanArray(int length) {
+ return ref.NewBooleanArray.asFunction<JBooleanArrayPtr Function(int)>()(
length);
}
- JByteArray NewByteArray(int length) {
- return ref.NewByteArray.asFunction<JByteArray Function(int)>()(length);
+ JByteArrayPtr NewByteArray(int length) {
+ return ref.NewByteArray.asFunction<JByteArrayPtr Function(int)>()(length);
}
- JCharArray NewCharArray(int length) {
- return ref.NewCharArray.asFunction<JCharArray Function(int)>()(length);
+ JCharArrayPtr NewCharArray(int length) {
+ return ref.NewCharArray.asFunction<JCharArrayPtr Function(int)>()(length);
}
- JShortArray NewShortArray(int length) {
- return ref.NewShortArray.asFunction<JShortArray Function(int)>()(length);
+ JShortArrayPtr NewShortArray(int length) {
+ return ref.NewShortArray.asFunction<JShortArrayPtr Function(int)>()(length);
}
- JIntArray NewIntArray(int length) {
- return ref.NewIntArray.asFunction<JIntArray Function(int)>()(length);
+ JIntArrayPtr NewIntArray(int length) {
+ return ref.NewIntArray.asFunction<JIntArrayPtr Function(int)>()(length);
}
- JLongArray NewLongArray(int length) {
- return ref.NewLongArray.asFunction<JLongArray Function(int)>()(length);
+ JLongArrayPtr NewLongArray(int length) {
+ return ref.NewLongArray.asFunction<JLongArrayPtr Function(int)>()(length);
}
- JFloatArray NewFloatArray(int length) {
- return ref.NewFloatArray.asFunction<JFloatArray Function(int)>()(length);
+ JFloatArrayPtr NewFloatArray(int length) {
+ return ref.NewFloatArray.asFunction<JFloatArrayPtr Function(int)>()(length);
}
- JDoubleArray NewDoubleArray(int length) {
- return ref.NewDoubleArray.asFunction<JDoubleArray Function(int)>()(length);
+ JDoubleArrayPtr NewDoubleArray(int length) {
+ return ref.NewDoubleArray.asFunction<JDoubleArrayPtr Function(int)>()(
+ length);
}
- ffi.Pointer<JBoolean> GetBooleanArrayElements(
- JBooleanArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JBooleanMarker> GetBooleanArrayElements(
+ JBooleanArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetBooleanArrayElements.asFunction<
- ffi.Pointer<JBoolean> Function(
- JBooleanArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JBooleanMarker> Function(
+ JBooleanArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JByte> GetByteArrayElements(
- JByteArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JByteMarker> GetByteArrayElements(
+ JByteArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetByteArrayElements.asFunction<
- ffi.Pointer<JByte> Function(
- JByteArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JByteMarker> Function(
+ JByteArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JChar> GetCharArrayElements(
- JCharArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JCharMarker> GetCharArrayElements(
+ JCharArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetCharArrayElements.asFunction<
- ffi.Pointer<JChar> Function(
- JCharArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JCharMarker> Function(
+ JCharArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JShort> GetShortArrayElements(
- JShortArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JShortMarker> GetShortArrayElements(
+ JShortArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetShortArrayElements.asFunction<
- ffi.Pointer<JShort> Function(
- JShortArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JShortMarker> Function(
+ JShortArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JInt> GetIntArrayElements(
- JIntArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JIntMarker> GetIntArrayElements(
+ JIntArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetIntArrayElements.asFunction<
- ffi.Pointer<JInt> Function(
- JIntArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JIntMarker> Function(
+ JIntArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JLong> GetLongArrayElements(
- JLongArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JLongMarker> GetLongArrayElements(
+ JLongArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetLongArrayElements.asFunction<
- ffi.Pointer<JLong> Function(
- JLongArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JLongMarker> Function(
+ JLongArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JFloat> GetFloatArrayElements(
- JFloatArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JFloatMarker> GetFloatArrayElements(
+ JFloatArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetFloatArrayElements.asFunction<
- ffi.Pointer<JFloat> Function(
- JFloatArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JFloatMarker> Function(
+ JFloatArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
- ffi.Pointer<JDouble> GetDoubleArrayElements(
- JDoubleArray array, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JDoubleMarker> GetDoubleArrayElements(
+ JDoubleArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetDoubleArrayElements.asFunction<
- ffi.Pointer<JDouble> Function(
- JDoubleArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ ffi.Pointer<JDoubleMarker> Function(
+ JDoubleArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
void ReleaseBooleanArrayElements(
- JBooleanArray array, ffi.Pointer<JBoolean> elems, int mode) {
+ JBooleanArrayPtr array, ffi.Pointer<JBooleanMarker> elems, int mode) {
return ref.ReleaseBooleanArrayElements.asFunction<
- void Function(
- JBooleanArray, ffi.Pointer<JBoolean>, int)>()(array, elems, mode);
+ void Function(JBooleanArrayPtr, ffi.Pointer<JBooleanMarker>,
+ int)>()(array, elems, mode);
}
void ReleaseByteArrayElements(
- JByteArray array, ffi.Pointer<JByte> elems, int mode) {
+ JByteArrayPtr array, ffi.Pointer<JByteMarker> elems, int mode) {
return ref.ReleaseByteArrayElements.asFunction<
- void Function(
- JByteArray, ffi.Pointer<JByte>, int)>()(array, elems, mode);
+ void Function(JByteArrayPtr, ffi.Pointer<JByteMarker>, int)>()(
+ array, elems, mode);
}
void ReleaseCharArrayElements(
- JCharArray array, ffi.Pointer<JChar> elems, int mode) {
+ JCharArrayPtr array, ffi.Pointer<JCharMarker> elems, int mode) {
return ref.ReleaseCharArrayElements.asFunction<
- void Function(
- JCharArray, ffi.Pointer<JChar>, int)>()(array, elems, mode);
+ void Function(JCharArrayPtr, ffi.Pointer<JCharMarker>, int)>()(
+ array, elems, mode);
}
void ReleaseShortArrayElements(
- JShortArray array, ffi.Pointer<JShort> elems, int mode) {
+ JShortArrayPtr array, ffi.Pointer<JShortMarker> elems, int mode) {
return ref.ReleaseShortArrayElements.asFunction<
- void Function(
- JShortArray, ffi.Pointer<JShort>, int)>()(array, elems, mode);
+ void Function(JShortArrayPtr, ffi.Pointer<JShortMarker>, int)>()(
+ array, elems, mode);
}
void ReleaseIntArrayElements(
- JIntArray array, ffi.Pointer<JInt> elems, int mode) {
+ JIntArrayPtr array, ffi.Pointer<JIntMarker> elems, int mode) {
return ref.ReleaseIntArrayElements.asFunction<
- void Function(JIntArray, ffi.Pointer<JInt>, int)>()(array, elems, mode);
+ void Function(
+ JIntArrayPtr, ffi.Pointer<JIntMarker>, int)>()(array, elems, mode);
}
void ReleaseLongArrayElements(
- JLongArray array, ffi.Pointer<JLong> elems, int mode) {
+ JLongArrayPtr array, ffi.Pointer<JLongMarker> elems, int mode) {
return ref.ReleaseLongArrayElements.asFunction<
- void Function(
- JLongArray, ffi.Pointer<JLong>, int)>()(array, elems, mode);
+ void Function(JLongArrayPtr, ffi.Pointer<JLongMarker>, int)>()(
+ array, elems, mode);
}
void ReleaseFloatArrayElements(
- JFloatArray array, ffi.Pointer<JFloat> elems, int mode) {
+ JFloatArrayPtr array, ffi.Pointer<JFloatMarker> elems, int mode) {
return ref.ReleaseFloatArrayElements.asFunction<
- void Function(
- JFloatArray, ffi.Pointer<JFloat>, int)>()(array, elems, mode);
+ void Function(JFloatArrayPtr, ffi.Pointer<JFloatMarker>, int)>()(
+ array, elems, mode);
}
void ReleaseDoubleArrayElements(
- JDoubleArray array, ffi.Pointer<JDouble> elems, int mode) {
+ JDoubleArrayPtr array, ffi.Pointer<JDoubleMarker> elems, int mode) {
return ref.ReleaseDoubleArrayElements.asFunction<
- void Function(
- JDoubleArray, ffi.Pointer<JDouble>, int)>()(array, elems, mode);
+ void Function(JDoubleArrayPtr, ffi.Pointer<JDoubleMarker>, int)>()(
+ array, elems, mode);
}
- void GetBooleanArrayRegion(
- JBooleanArray array, int start, int len, ffi.Pointer<JBoolean> buf) {
+ void GetBooleanArrayRegion(JBooleanArrayPtr array, int start, int len,
+ ffi.Pointer<JBooleanMarker> buf) {
return ref.GetBooleanArrayRegion.asFunction<
- void Function(JBooleanArray, int, int, ffi.Pointer<JBoolean>)>()(
- array, start, len, buf);
+ void Function(JBooleanArrayPtr, int, int,
+ ffi.Pointer<JBooleanMarker>)>()(array, start, len, buf);
}
void GetByteArrayRegion(
- JByteArray array, int start, int len, ffi.Pointer<JByte> buf) {
+ JByteArrayPtr array, int start, int len, ffi.Pointer<JByteMarker> buf) {
return ref.GetByteArrayRegion.asFunction<
- void Function(JByteArray, int, int, ffi.Pointer<JByte>)>()(
+ void Function(JByteArrayPtr, int, int, ffi.Pointer<JByteMarker>)>()(
array, start, len, buf);
}
void GetCharArrayRegion(
- JCharArray array, int start, int len, ffi.Pointer<JChar> buf) {
+ JCharArrayPtr array, int start, int len, ffi.Pointer<JCharMarker> buf) {
return ref.GetCharArrayRegion.asFunction<
- void Function(JCharArray, int, int, ffi.Pointer<JChar>)>()(
+ void Function(JCharArrayPtr, int, int, ffi.Pointer<JCharMarker>)>()(
array, start, len, buf);
}
void GetShortArrayRegion(
- JShortArray array, int start, int len, ffi.Pointer<JShort> buf) {
+ JShortArrayPtr array, int start, int len, ffi.Pointer<JShortMarker> buf) {
return ref.GetShortArrayRegion.asFunction<
- void Function(JShortArray, int, int, ffi.Pointer<JShort>)>()(
- array, start, len, buf);
+ void Function(JShortArrayPtr, int, int,
+ ffi.Pointer<JShortMarker>)>()(array, start, len, buf);
}
void GetIntArrayRegion(
- JIntArray array, int start, int len, ffi.Pointer<JInt> buf) {
+ JIntArrayPtr array, int start, int len, ffi.Pointer<JIntMarker> buf) {
return ref.GetIntArrayRegion.asFunction<
- void Function(
- JIntArray, int, int, ffi.Pointer<JInt>)>()(array, start, len, buf);
+ void Function(JIntArrayPtr, int, int, ffi.Pointer<JIntMarker>)>()(
+ array, start, len, buf);
}
void GetLongArrayRegion(
- JLongArray array, int start, int len, ffi.Pointer<JLong> buf) {
+ JLongArrayPtr array, int start, int len, ffi.Pointer<JLongMarker> buf) {
return ref.GetLongArrayRegion.asFunction<
- void Function(JLongArray, int, int, ffi.Pointer<JLong>)>()(
+ void Function(JLongArrayPtr, int, int, ffi.Pointer<JLongMarker>)>()(
array, start, len, buf);
}
void GetFloatArrayRegion(
- JFloatArray array, int start, int len, ffi.Pointer<JFloat> buf) {
+ JFloatArrayPtr array, int start, int len, ffi.Pointer<JFloatMarker> buf) {
return ref.GetFloatArrayRegion.asFunction<
- void Function(JFloatArray, int, int, ffi.Pointer<JFloat>)>()(
- array, start, len, buf);
+ void Function(JFloatArrayPtr, int, int,
+ ffi.Pointer<JFloatMarker>)>()(array, start, len, buf);
}
- void GetDoubleArrayRegion(
- JDoubleArray array, int start, int len, ffi.Pointer<JDouble> buf) {
+ void GetDoubleArrayRegion(JDoubleArrayPtr array, int start, int len,
+ ffi.Pointer<JDoubleMarker> buf) {
return ref.GetDoubleArrayRegion.asFunction<
- void Function(JDoubleArray, int, int, ffi.Pointer<JDouble>)>()(
- array, start, len, buf);
+ void Function(JDoubleArrayPtr, int, int,
+ ffi.Pointer<JDoubleMarker>)>()(array, start, len, buf);
}
- void SetBooleanArrayRegion(
- JBooleanArray array, int start, int len, ffi.Pointer<JBoolean> buf) {
+ void SetBooleanArrayRegion(JBooleanArrayPtr array, int start, int len,
+ ffi.Pointer<JBooleanMarker> buf) {
return ref.SetBooleanArrayRegion.asFunction<
- void Function(JBooleanArray, int, int, ffi.Pointer<JBoolean>)>()(
- array, start, len, buf);
+ void Function(JBooleanArrayPtr, int, int,
+ ffi.Pointer<JBooleanMarker>)>()(array, start, len, buf);
}
void SetByteArrayRegion(
- JByteArray array, int start, int len, ffi.Pointer<JByte> buf) {
+ JByteArrayPtr array, int start, int len, ffi.Pointer<JByteMarker> buf) {
return ref.SetByteArrayRegion.asFunction<
- void Function(JByteArray, int, int, ffi.Pointer<JByte>)>()(
+ void Function(JByteArrayPtr, int, int, ffi.Pointer<JByteMarker>)>()(
array, start, len, buf);
}
void SetCharArrayRegion(
- JCharArray array, int start, int len, ffi.Pointer<JChar> buf) {
+ JCharArrayPtr array, int start, int len, ffi.Pointer<JCharMarker> buf) {
return ref.SetCharArrayRegion.asFunction<
- void Function(JCharArray, int, int, ffi.Pointer<JChar>)>()(
+ void Function(JCharArrayPtr, int, int, ffi.Pointer<JCharMarker>)>()(
array, start, len, buf);
}
void SetShortArrayRegion(
- JShortArray array, int start, int len, ffi.Pointer<JShort> buf) {
+ JShortArrayPtr array, int start, int len, ffi.Pointer<JShortMarker> buf) {
return ref.SetShortArrayRegion.asFunction<
- void Function(JShortArray, int, int, ffi.Pointer<JShort>)>()(
- array, start, len, buf);
+ void Function(JShortArrayPtr, int, int,
+ ffi.Pointer<JShortMarker>)>()(array, start, len, buf);
}
void SetIntArrayRegion(
- JIntArray array, int start, int len, ffi.Pointer<JInt> buf) {
+ JIntArrayPtr array, int start, int len, ffi.Pointer<JIntMarker> buf) {
return ref.SetIntArrayRegion.asFunction<
- void Function(
- JIntArray, int, int, ffi.Pointer<JInt>)>()(array, start, len, buf);
+ void Function(JIntArrayPtr, int, int, ffi.Pointer<JIntMarker>)>()(
+ array, start, len, buf);
}
void SetLongArrayRegion(
- JLongArray array, int start, int len, ffi.Pointer<JLong> buf) {
+ JLongArrayPtr array, int start, int len, ffi.Pointer<JLongMarker> buf) {
return ref.SetLongArrayRegion.asFunction<
- void Function(JLongArray, int, int, ffi.Pointer<JLong>)>()(
+ void Function(JLongArrayPtr, int, int, ffi.Pointer<JLongMarker>)>()(
array, start, len, buf);
}
void SetFloatArrayRegion(
- JFloatArray array, int start, int len, ffi.Pointer<JFloat> buf) {
+ JFloatArrayPtr array, int start, int len, ffi.Pointer<JFloatMarker> buf) {
return ref.SetFloatArrayRegion.asFunction<
- void Function(JFloatArray, int, int, ffi.Pointer<JFloat>)>()(
- array, start, len, buf);
+ void Function(JFloatArrayPtr, int, int,
+ ffi.Pointer<JFloatMarker>)>()(array, start, len, buf);
}
- void SetDoubleArrayRegion(
- JDoubleArray array, int start, int len, ffi.Pointer<JDouble> buf) {
+ void SetDoubleArrayRegion(JDoubleArrayPtr array, int start, int len,
+ ffi.Pointer<JDoubleMarker> buf) {
return ref.SetDoubleArrayRegion.asFunction<
- void Function(JDoubleArray, int, int, ffi.Pointer<JDouble>)>()(
- array, start, len, buf);
+ void Function(JDoubleArrayPtr, int, int,
+ ffi.Pointer<JDoubleMarker>)>()(array, start, len, buf);
}
int RegisterNatives(
- JClass clazz, ffi.Pointer<JNINativeMethod> methods, int nMethods) {
+ JClassPtr clazz, ffi.Pointer<JNINativeMethod> methods, int nMethods) {
return ref.RegisterNatives.asFunction<
- int Function(JClass, ffi.Pointer<JNINativeMethod>, int)>()(
+ int Function(JClassPtr, ffi.Pointer<JNINativeMethod>, int)>()(
clazz, methods, nMethods);
}
- int UnregisterNatives(JClass clazz) {
- return ref.UnregisterNatives.asFunction<int Function(JClass)>()(clazz);
+ int UnregisterNatives(JClassPtr clazz) {
+ return ref.UnregisterNatives.asFunction<int Function(JClassPtr)>()(clazz);
}
- int MonitorEnter(JObject obj) {
- return ref.MonitorEnter.asFunction<int Function(JObject)>()(obj);
+ int MonitorEnter(JObjectPtr obj) {
+ return ref.MonitorEnter.asFunction<int Function(JObjectPtr)>()(obj);
}
- int MonitorExit(JObject obj) {
- return ref.MonitorExit.asFunction<int Function(JObject)>()(obj);
+ int MonitorExit(JObjectPtr obj) {
+ return ref.MonitorExit.asFunction<int Function(JObjectPtr)>()(obj);
}
int GetJavaVM(ffi.Pointer<ffi.Pointer<JavaVM>> vm) {
@@ -3466,73 +3671,75 @@
}
void GetStringRegion(
- JString str, int start, int len, ffi.Pointer<JChar> buf) {
+ JStringPtr str, int start, int len, ffi.Pointer<JCharMarker> buf) {
return ref.GetStringRegion.asFunction<
- void Function(
- JString, int, int, ffi.Pointer<JChar>)>()(str, start, len, buf);
+ void Function(JStringPtr, int, int, ffi.Pointer<JCharMarker>)>()(
+ str, start, len, buf);
}
void GetStringUTFRegion(
- JString str, int start, int len, ffi.Pointer<ffi.Char> buf) {
+ JStringPtr str, int start, int len, ffi.Pointer<ffi.Char> buf) {
return ref.GetStringUTFRegion.asFunction<
- void Function(
- JString, int, int, ffi.Pointer<ffi.Char>)>()(str, start, len, buf);
+ void Function(JStringPtr, int, int, ffi.Pointer<ffi.Char>)>()(
+ str, start, len, buf);
}
ffi.Pointer<ffi.Void> GetPrimitiveArrayCritical(
- JArray array, ffi.Pointer<JBoolean> isCopy) {
+ JArrayPtr array, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetPrimitiveArrayCritical.asFunction<
ffi.Pointer<ffi.Void> Function(
- JArray, ffi.Pointer<JBoolean>)>()(array, isCopy);
+ JArrayPtr, ffi.Pointer<JBooleanMarker>)>()(array, isCopy);
}
void ReleasePrimitiveArrayCritical(
- JArray array, ffi.Pointer<ffi.Void> carray, int mode) {
+ JArrayPtr array, ffi.Pointer<ffi.Void> carray, int mode) {
return ref.ReleasePrimitiveArrayCritical.asFunction<
void Function(
- JArray, ffi.Pointer<ffi.Void>, int)>()(array, carray, mode);
+ JArrayPtr, ffi.Pointer<ffi.Void>, int)>()(array, carray, mode);
}
- ffi.Pointer<JChar> GetStringCritical(
- JString str, ffi.Pointer<JBoolean> isCopy) {
+ ffi.Pointer<JCharMarker> GetStringCritical(
+ JStringPtr str, ffi.Pointer<JBooleanMarker> isCopy) {
return ref.GetStringCritical.asFunction<
- ffi.Pointer<JChar> Function(
- JString, ffi.Pointer<JBoolean>)>()(str, isCopy);
+ ffi.Pointer<JCharMarker> Function(
+ JStringPtr, ffi.Pointer<JBooleanMarker>)>()(str, isCopy);
}
- void ReleaseStringCritical(JString str, ffi.Pointer<JChar> carray) {
+ void ReleaseStringCritical(JStringPtr str, ffi.Pointer<JCharMarker> carray) {
return ref.ReleaseStringCritical.asFunction<
- void Function(JString, ffi.Pointer<JChar>)>()(str, carray);
+ void Function(JStringPtr, ffi.Pointer<JCharMarker>)>()(str, carray);
}
- JWeak NewWeakGlobalRef(JObject obj) {
- return ref.NewWeakGlobalRef.asFunction<JWeak Function(JObject)>()(obj);
+ JWeakPtr NewWeakGlobalRef(JObjectPtr obj) {
+ return ref.NewWeakGlobalRef.asFunction<JWeakPtr Function(JObjectPtr)>()(
+ obj);
}
- void DeleteWeakGlobalRef(JWeak obj) {
- return ref.DeleteWeakGlobalRef.asFunction<void Function(JWeak)>()(obj);
+ void DeleteWeakGlobalRef(JWeakPtr obj) {
+ return ref.DeleteWeakGlobalRef.asFunction<void Function(JWeakPtr)>()(obj);
}
int ExceptionCheck() {
return ref.ExceptionCheck.asFunction<int Function()>()();
}
- JObject NewDirectByteBuffer(ffi.Pointer<ffi.Void> address, int capacity) {
+ JObjectPtr NewDirectByteBuffer(ffi.Pointer<ffi.Void> address, int capacity) {
return ref.NewDirectByteBuffer.asFunction<
- JObject Function(ffi.Pointer<ffi.Void>, int)>()(address, capacity);
+ JObjectPtr Function(ffi.Pointer<ffi.Void>, int)>()(address, capacity);
}
- ffi.Pointer<ffi.Void> GetDirectBufferAddress(JObject buf) {
+ ffi.Pointer<ffi.Void> GetDirectBufferAddress(JObjectPtr buf) {
return ref.GetDirectBufferAddress.asFunction<
- ffi.Pointer<ffi.Void> Function(JObject)>()(buf);
+ ffi.Pointer<ffi.Void> Function(JObjectPtr)>()(buf);
}
- int GetDirectBufferCapacity(JObject buf) {
- return ref.GetDirectBufferCapacity.asFunction<int Function(JObject)>()(buf);
+ int GetDirectBufferCapacity(JObjectPtr buf) {
+ return ref.GetDirectBufferCapacity.asFunction<int Function(JObjectPtr)>()(
+ buf);
}
- int GetObjectRefType(JObject obj) {
- return ref.GetObjectRefType.asFunction<int Function(JObject)>()(obj);
+ int GetObjectRefType(JObjectPtr obj) {
+ return ref.GetObjectRefType.asFunction<int Function(JObjectPtr)>()(obj);
}
}
diff --git a/pkgs/jni/lib/src/types.dart b/pkgs/jni/lib/src/types.dart
new file mode 100644
index 0000000..c9265a7
--- /dev/null
+++ b/pkgs/jni/lib/src/types.dart
@@ -0,0 +1,36 @@
+// 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.
+
+import 'dart:ffi';
+
+import 'package:collection/collection.dart';
+import 'package:ffi/ffi.dart';
+
+import 'accessors.dart';
+import 'jni.dart';
+import 'jvalues.dart';
+import 'third_party/jni_bindings_generated.dart';
+
+part 'jarray.dart';
+part 'jexceptions.dart';
+part 'jprimitives.dart';
+part 'jreference.dart';
+part 'jobject.dart';
+part 'jstring.dart';
+
+final Pointer<JniAccessors> _accessors = Jni.accessors;
+final Pointer<GlobalJniEnv> _env = Jni.env;
+// This typedef is needed because void is a keyword and cannot be used in
+// type switch like a regular type.
+typedef _VoidType = void;
+
+abstract class JType<T> {
+ const JType();
+
+ int get _type => JniCallType.objectType;
+
+ String get signature;
+
+ JniClass _getClass() => Jni.findJniClass(signature);
+}
diff --git a/pkgs/jni/test/jarray_test.dart b/pkgs/jni/test/jarray_test.dart
new file mode 100644
index 0000000..ad14c0f
--- /dev/null
+++ b/pkgs/jni/test/jarray_test.dart
@@ -0,0 +1,259 @@
+// 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.
+
+import 'dart:io';
+
+import 'package:jni/jni.dart';
+import 'package:test/test.dart';
+
+void main() {
+ // Don't forget to initialize JNI.
+ if (!Platform.isAndroid) {
+ try {
+ Jni.spawn(dylibDir: "build/jni_libs", jvmOptions: ["-Xmx128m"]);
+ } on JvmExistsException catch (_) {
+ // TODO(#51): Support destroying and reinstantiating JVM.
+ }
+ }
+ test("Java boolean array", () {
+ using((arena) {
+ final array = JArray(JBoolean.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = true;
+ array[1] = false;
+ array[2] = false;
+ expect(array[0], true);
+ expect(array[1], false);
+ expect(array[2], false);
+ array.setRange(0, 3, [false, true, true, true], 1);
+ expect(array[0], true);
+ expect(array[1], true);
+ expect(array[2], true);
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = false;
+ }, throwsRangeError);
+ expect(() {
+ array[3] = false;
+ }, throwsRangeError);
+ });
+ });
+ test("Java char array", () {
+ using((arena) {
+ final array = JArray(JChar.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = 'Ø';
+ array[1] = '2';
+ array[2] = '3';
+ expect(array[0], 'Ø');
+ expect(array[1], '2');
+ expect(array[2], '3');
+ array.setRange(0, 3, ['4', '5', '6', '7'], 1);
+ expect(array[0], '5');
+ expect(array[1], '6');
+ expect(array[2], '7');
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = '4';
+ }, throwsRangeError);
+ expect(() {
+ array[3] = '4';
+ }, throwsRangeError);
+ });
+ });
+ test("Java byte array", () {
+ using((arena) {
+ final array = JArray(JByte.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = 1;
+ array[1] = 2;
+ array[2] = 3 + 256 * 5; // truncates the input;
+ expect(array[0], 1);
+ expect(array[1], 2);
+ expect(array[2], 3);
+ array.setRange(0, 3, [4, 5, 6, 7], 1);
+ expect(array[0], 5);
+ expect(array[1], 6);
+ expect(array[2], 7);
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = 4;
+ }, throwsRangeError);
+ expect(() {
+ array[3] = 4;
+ }, throwsRangeError);
+ });
+ });
+ test("Java short array", () {
+ using((arena) {
+ final array = JArray(JShort.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = 1;
+ array[1] = 2;
+ array[2] = 3 + 256 * 256 * 5; // truncates the input
+ expect(array[0], 1);
+ expect(array[1], 2);
+ expect(array[2], 3);
+ array.setRange(0, 3, [4, 5, 6, 7], 1);
+ expect(array[0], 5);
+ expect(array[1], 6);
+ expect(array[2], 7);
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = 4;
+ }, throwsRangeError);
+ expect(() {
+ array[3] = 4;
+ }, throwsRangeError);
+ });
+ });
+ test("Java int array", () {
+ using((arena) {
+ final array = JArray(JInt.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = 1;
+ array[1] = 2;
+ array[2] = 3 + 256 * 256 * 256 * 256 * 5; // truncates the input
+ expect(array[0], 1);
+ expect(array[1], 2);
+ expect(array[2], 3);
+ array.setRange(0, 3, [4, 5, 6, 7], 1);
+ expect(array[0], 5);
+ expect(array[1], 6);
+ expect(array[2], 7);
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = 4;
+ }, throwsRangeError);
+ expect(() {
+ array[3] = 4;
+ }, throwsRangeError);
+ });
+ });
+ const epsilon = 1e-6;
+ test("Java float array", () {
+ using((arena) {
+ final array = JArray(JFloat.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = 0.5;
+ array[1] = 2;
+ array[2] = 3;
+ expect(array[0], closeTo(0.5, epsilon));
+ expect(array[1], closeTo(2, epsilon));
+ expect(array[2], closeTo(3, epsilon));
+ array.setRange(0, 3, [4, 5, 6, 7], 1);
+ expect(array[0], closeTo(5, epsilon));
+ expect(array[1], closeTo(6, epsilon));
+ expect(array[2], closeTo(7, epsilon));
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = 4;
+ }, throwsRangeError);
+ expect(() {
+ array[3] = 4;
+ }, throwsRangeError);
+ });
+ });
+ test("Java double array", () {
+ using((arena) {
+ final array = JArray(JDouble.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = 0.5;
+ array[1] = 2;
+ array[2] = 3;
+ expect(array[0], closeTo(0.5, epsilon));
+ expect(array[1], closeTo(2, epsilon));
+ expect(array[2], closeTo(3, epsilon));
+ array.setRange(0, 3, [4, 5, 6, 7], 1);
+ expect(array[0], closeTo(5, epsilon));
+ expect(array[1], closeTo(6, epsilon));
+ expect(array[2], closeTo(7, epsilon));
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = 4;
+ }, throwsRangeError);
+ expect(() {
+ array[3] = 4;
+ }, throwsRangeError);
+ });
+ });
+ test("Java string array", () {
+ using((arena) {
+ final array = JArray(JString.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ array[0] = "ØØ³".toJString()..deletedIn(arena);
+ array[1] = "\$".toJString()..deletedIn(arena);
+ array[2] = "33".toJString()..deletedIn(arena);
+ expect(array[0].toDartString(), "ØØ³");
+ expect(array[1].toDartString(), "\$");
+ expect(array[2].toDartString(), "33");
+ array.setRange(
+ 0,
+ 3,
+ [
+ "44".toJString()..deletedIn(arena),
+ "55".toJString()..deletedIn(arena),
+ "66".toJString()..deletedIn(arena),
+ "77".toJString()..deletedIn(arena),
+ ],
+ 1,
+ );
+ expect(array[0].toDartString(), "55");
+ expect(array[1].toDartString(), "66");
+ expect(array[2].toDartString(), "77");
+ expect(() {
+ final _ = array[-1];
+ }, throwsRangeError);
+ expect(() {
+ array[-1] = "44".toJString()..deletedIn(arena);
+ }, throwsRangeError);
+ expect(() {
+ array[3] = "44".toJString()..deletedIn(arena);
+ }, throwsRangeError);
+ });
+ });
+ test("Java object array", () {
+ using((arena) {
+ final array = JArray(JObject.type, 3)..deletedIn(arena);
+ expect(array.length, 3);
+ expect(array[0].reference, nullptr);
+ expect(array[1].reference, nullptr);
+ expect(array[2].reference, nullptr);
+ });
+ });
+ test("Java 2d array", () {
+ using((arena) {
+ final array = JArray(JInt.type, 3)..deletedIn(arena);
+ array[0] = 1;
+ array[1] = 2;
+ array[2] = 3;
+ final twoDimArray = JArray(JArray.type(JInt.type), 3)..deletedIn(arena);
+ expect(twoDimArray.length, 3);
+ twoDimArray[0] = array;
+ twoDimArray[1] = array;
+ twoDimArray[2] = array;
+ for (var i = 0; i < 3; ++i) {
+ expect(twoDimArray[i][0], 1);
+ expect(twoDimArray[i][1], 2);
+ expect(twoDimArray[i][2], 3);
+ }
+ twoDimArray[2][2] = 4;
+ expect(twoDimArray[2][2], 4);
+ });
+ });
+}
diff --git a/pkgs/jni/test/jni_array_test.dart b/pkgs/jni/test/jni_array_test.dart
deleted file mode 100644
index 2965474..0000000
--- a/pkgs/jni/test/jni_array_test.dart
+++ /dev/null
@@ -1,237 +0,0 @@
-// 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.
-
-import 'dart:io';
-
-import 'package:jni/jni.dart';
-import 'package:test/test.dart';
-
-void main() {
- // Don't forget to initialize JNI.
- if (!Platform.isAndroid) {
- try {
- Jni.spawn(dylibDir: "build/jni_libs", jvmOptions: ["-Xmx128m"]);
- } on JvmExistsException catch (_) {
- // TODO(#51): Support destroying and reinstantiating JVM.
- }
- }
- test("Java boolean array", () {
- final array = JniArray(const JniBooleanType(), 3);
- expect(array.length, 3);
- array[0] = true;
- array[1] = false;
- array[2] = false;
- expect(array[0], true);
- expect(array[1], false);
- expect(array[2], false);
- array.setRange(0, 3, [false, true, true, true], 1);
- expect(array[0], true);
- expect(array[1], true);
- expect(array[2], true);
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = false;
- }, throwsRangeError);
- expect(() {
- array[3] = false;
- }, throwsRangeError);
- array.delete();
- });
- test("Java char array", () {
- final array = JniArray(const JniCharType(), 3);
- expect(array.length, 3);
- array[0] = 'Ø';
- array[1] = '2';
- array[2] = '3';
- expect(array[0], 'Ø');
- expect(array[1], '2');
- expect(array[2], '3');
- array.setRange(0, 3, ['4', '5', '6', '7'], 1);
- expect(array[0], '5');
- expect(array[1], '6');
- expect(array[2], '7');
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = '4';
- }, throwsRangeError);
- expect(() {
- array[3] = '4';
- }, throwsRangeError);
- array.delete();
- });
- test("Java byte array", () {
- final array = JniArray(const JniByteTypeClass(), 3);
- expect(array.length, 3);
- array[0] = 1;
- array[1] = 2;
- array[2] = 3 + 256 * 5; // truncates the input;
- expect(array[0], 1);
- expect(array[1], 2);
- expect(array[2], 3);
- array.setRange(0, 3, [4, 5, 6, 7], 1);
- expect(array[0], 5);
- expect(array[1], 6);
- expect(array[2], 7);
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = 4;
- }, throwsRangeError);
- expect(() {
- array[3] = 4;
- }, throwsRangeError);
- array.delete();
- });
- test("Java short array", () {
- final array = JniArray(const JniShortType(), 3);
- expect(array.length, 3);
- array[0] = 1;
- array[1] = 2;
- array[2] = 3 + 256 * 256 * 5; // truncates the input
- expect(array[0], 1);
- expect(array[1], 2);
- expect(array[2], 3);
- array.setRange(0, 3, [4, 5, 6, 7], 1);
- expect(array[0], 5);
- expect(array[1], 6);
- expect(array[2], 7);
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = 4;
- }, throwsRangeError);
- expect(() {
- array[3] = 4;
- }, throwsRangeError);
- array.delete();
- });
- test("Java int array", () {
- final array = JniArray(const JniIntType(), 3);
- expect(array.length, 3);
- array[0] = 1;
- array[1] = 2;
- array[2] = 3 + 256 * 256 * 256 * 256 * 5; // truncates the input
- expect(array[0], 1);
- expect(array[1], 2);
- expect(array[2], 3);
- array.setRange(0, 3, [4, 5, 6, 7], 1);
- expect(array[0], 5);
- expect(array[1], 6);
- expect(array[2], 7);
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = 4;
- }, throwsRangeError);
- expect(() {
- array[3] = 4;
- }, throwsRangeError);
- array.delete();
- });
- const epsilon = 1e-6;
- test("Java float array", () {
- final array = JniArray(const JniFloatType(), 3);
- expect(array.length, 3);
- array[0] = 0.5;
- array[1] = 2;
- array[2] = 3;
- expect(array[0], closeTo(0.5, epsilon));
- expect(array[1], closeTo(2, epsilon));
- expect(array[2], closeTo(3, epsilon));
- array.setRange(0, 3, [4, 5, 6, 7], 1);
- expect(array[0], closeTo(5, epsilon));
- expect(array[1], closeTo(6, epsilon));
- expect(array[2], closeTo(7, epsilon));
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = 4;
- }, throwsRangeError);
- expect(() {
- array[3] = 4;
- }, throwsRangeError);
- array.delete();
- });
- test("Java double array", () {
- final array = JniArray(const JniDoubleType(), 3);
- expect(array.length, 3);
- array[0] = 0.5;
- array[1] = 2;
- array[2] = 3;
- expect(array[0], closeTo(0.5, epsilon));
- expect(array[1], closeTo(2, epsilon));
- expect(array[2], closeTo(3, epsilon));
- array.setRange(0, 3, [4, 5, 6, 7], 1);
- expect(array[0], closeTo(5, epsilon));
- expect(array[1], closeTo(6, epsilon));
- expect(array[2], closeTo(7, epsilon));
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = 4;
- }, throwsRangeError);
- expect(() {
- array[3] = 4;
- }, throwsRangeError);
- array.delete();
- });
- test("Java string array", () {
- final array = JniArray(JniString.type, 3);
- expect(array.length, 3);
- array[0] = "ØØ³".jniString();
- array[1] = "\$".jniString();
- array[2] = "33".jniString();
- expect(array[0].toDartString(), "ØØ³");
- expect(array[1].toDartString(), "\$");
- expect(array[2].toDartString(), "33");
- array.setRange(
- 0,
- 3,
- ["44".jniString(), "55".jniString(), "66".jniString(), "77".jniString()],
- 1,
- );
- expect(array[0].toDartString(), "55");
- expect(array[1].toDartString(), "66");
- expect(array[2].toDartString(), "77");
- expect(() {
- final _ = array[-1];
- }, throwsRangeError);
- expect(() {
- array[-1] = "44".jniString();
- }, throwsRangeError);
- expect(() {
- array[3] = "44".jniString();
- }, throwsRangeError);
- array.delete();
- });
- test("Java 2d array", () {
- final array = JniArray(const JniIntType(), 3);
- array[0] = 1;
- array[1] = 2;
- array[2] = 3;
- final twoDimArray = JniArray(JniArray.type(const JniIntType()), 3);
- expect(twoDimArray.length, 3);
- twoDimArray[0] = array;
- twoDimArray[1] = array;
- twoDimArray[2] = array;
- for (var i = 0; i < 3; ++i) {
- expect(twoDimArray[i][0], 1);
- expect(twoDimArray[i][1], 2);
- expect(twoDimArray[i][2], 3);
- }
- twoDimArray[2][2] = 4;
- expect(twoDimArray[2][2], 4);
- twoDimArray.delete();
- array.delete();
- });
-}
diff --git a/pkgs/jni/test/jni_object_test.dart b/pkgs/jni/test/jobject_test.dart
similarity index 90%
rename from pkgs/jni/test/jni_object_test.dart
rename to pkgs/jni/test/jobject_test.dart
index 3bbd317..9722c7c 100644
--- a/pkgs/jni/test/jni_object_test.dart
+++ b/pkgs/jni/test/jobject_test.dart
@@ -22,11 +22,11 @@
// The API based on JniEnv is intended to closely mimic C API of JNI,
// And thus can be too verbose for simple experimenting and one-off uses
- // JniObject API provides an easier way to perform some common operations.
+ // JObject API provides an easier way to perform some common operations.
//
// However, if binding generation using jnigen is possible, that should be
// the first choice.
- test("Long.intValue() using JniObject", () {
+ test("Long.intValue() using JObject", () {
// JniClass wraps a local class reference, and
// provides convenience functions.
final longClass = Jni.findJniClass("java/lang/Long");
@@ -36,7 +36,7 @@
final longCtor = longClass.getCtorID("(J)V");
// note that the arguments are just passed as a list.
- // allowed argument types are primitive types, JniObject and its subclasses,
+ // allowed argument types are primitive types, JObject and its subclasses,
// and raw JNI references (JObject). Strings will be automatically converted
// to JNI strings.
final long = longClass.newInstance(longCtor, [176]);
@@ -44,7 +44,7 @@
final intValue = long.callMethodByName<int>("intValue", "()I", []);
expect(intValue, equals(176));
- // delete any JniObject and JniClass instances using .delete() after use.
+ // delete any JObject and JniClass instances using .delete() after use.
// Deletion is not strictly required since JNI objects / classes have
// a NativeFinalizer. But deleting them after use is a good practice.
long.delete();
@@ -53,7 +53,7 @@
test("call a static method using JniClass APIs", () {
final integerClass = Jni.findJniClass("java/lang/Integer");
- final result = integerClass.callStaticMethodByName<JniString>(
+ final result = integerClass.callStaticMethodByName<JString>(
"toHexString", "(I)Ljava/lang/String;", [31]);
// if the object is supposed to be a Java string
@@ -138,14 +138,14 @@
longClass.delete();
});
- // In JniObject, JniClass, and retrieve_/invoke_ methods
+ // In JObject, JniClass, and retrieve_/invoke_ methods
// you can also pass Dart strings, apart from range of types
// allowed by Jni.jvalues
// They will be converted automatically.
test(
"Passing strings in arguments",
() {
- final out = Jni.retrieveStaticField<JniObject>(
+ final out = Jni.retrieveStaticField<JObject>(
"java/lang/System", "out", "Ljava/io/PrintStream;");
// uncomment next line to see output
// (\n because test runner prints first char at end of the line)
@@ -161,17 +161,17 @@
expect(twelve, equals(12));
});
- // You can use() method on JniObject for using once and deleting.
+ // You can use() method on JObject for using once and deleting.
test("use() method", () {
final randomInt = Jni.newInstance("java/util/Random", "()V", [])
.use((random) => random.callMethodByName<int>("nextInt", "(I)I", [15]));
expect(randomInt, lessThan(15));
});
- // The JniObject and JniClass have NativeFinalizer. However, it's possible to
+ // The JObject and JniClass have NativeFinalizer. However, it's possible to
// explicitly use `Arena`.
test('Using arena', () {
- final objects = <JniObject>[];
+ final objects = <JObject>[];
using((arena) {
final r = Jni.findJniClass('java/util/Random')..deletedIn(arena);
final ctor = r.getCtorID("()V");
@@ -186,7 +186,7 @@
test("enums", () {
// Don't forget to escape $ in nested type names
- final ordinal = Jni.retrieveStaticField<JniObject>(
+ final ordinal = Jni.retrieveStaticField<JObject>(
"java/net/Proxy\$Type", "HTTP", "Ljava/net/Proxy\$Type;")
.use((f) => f.callMethodByName<int>("ordinal", "()I", []));
expect(ordinal, equals(1));
diff --git a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
index d8f37a0..9bc9ef6 100644
--- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
+++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
@@ -21,11 +21,11 @@
ProtectedJniExtensions.initGeneratedLibrary("android_utils");
/// from: com.example.in_app_java.AndroidUtils
-class AndroidUtils extends jni.JniObject {
+class AndroidUtils extends jni.JObject {
AndroidUtils.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<AndroidUtils> type = _$AndroidUtilsType();
+ static const jni.JType<AndroidUtils> type = _$AndroidUtilsType();
static final _showToast = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(ffi.Pointer<ffi.Void>,
@@ -36,34 +36,34 @@
/// from: static public void showToast(android.app.Activity mainActivity, java.lang.CharSequence text, int duration)
static void showToast(
- jni.JniObject mainActivity, jni.JniObject text, int duration) =>
+ jni.JObject mainActivity, jni.JObject text, int duration) =>
_showToast(mainActivity.reference, text.reference, duration).check();
}
-class _$AndroidUtilsType extends jni.JniType<AndroidUtils> {
+class _$AndroidUtilsType extends jni.JType<AndroidUtils> {
const _$AndroidUtilsType();
@override
String get signature => r"Lcom/example/in_app_java/AndroidUtils;";
}
-extension $AndroidUtilsJniArray on jni.JniArray<AndroidUtils> {
+extension $AndroidUtilsArray on jni.JArray<AndroidUtils> {
AndroidUtils operator [](int index) {
return AndroidUtils.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, AndroidUtils value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
/// from: android.os.Build
-class Build extends jni.JniObject {
+class Build extends jni.JObject {
Build.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<Build> type = _$BuildType();
+ static const jni.JType<Build> type = _$BuildType();
static final _get_BOARD =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
"get_Build__BOARD")
@@ -71,7 +71,7 @@
/// from: static public final java.lang.String BOARD
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get BOARD => jni.JniString.fromRef(_get_BOARD().object);
+ static jni.JString get BOARD => jni.JString.fromRef(_get_BOARD().object);
static final _get_BOOTLOADER =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -80,8 +80,8 @@
/// from: static public final java.lang.String BOOTLOADER
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get BOOTLOADER =>
- jni.JniString.fromRef(_get_BOOTLOADER().object);
+ static jni.JString get BOOTLOADER =>
+ jni.JString.fromRef(_get_BOOTLOADER().object);
static final _get_BRAND =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -90,7 +90,7 @@
/// from: static public final java.lang.String BRAND
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get BRAND => jni.JniString.fromRef(_get_BRAND().object);
+ static jni.JString get BRAND => jni.JString.fromRef(_get_BRAND().object);
static final _get_CPU_ABI =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -99,8 +99,7 @@
/// from: static public final java.lang.String CPU_ABI
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get CPU_ABI =>
- jni.JniString.fromRef(_get_CPU_ABI().object);
+ static jni.JString get CPU_ABI => jni.JString.fromRef(_get_CPU_ABI().object);
static final _get_CPU_ABI2 =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -109,8 +108,8 @@
/// from: static public final java.lang.String CPU_ABI2
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get CPU_ABI2 =>
- jni.JniString.fromRef(_get_CPU_ABI2().object);
+ static jni.JString get CPU_ABI2 =>
+ jni.JString.fromRef(_get_CPU_ABI2().object);
static final _get_DEVICE =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -119,8 +118,7 @@
/// from: static public final java.lang.String DEVICE
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get DEVICE =>
- jni.JniString.fromRef(_get_DEVICE().object);
+ static jni.JString get DEVICE => jni.JString.fromRef(_get_DEVICE().object);
static final _get_DISPLAY =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -129,8 +127,7 @@
/// from: static public final java.lang.String DISPLAY
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get DISPLAY =>
- jni.JniString.fromRef(_get_DISPLAY().object);
+ static jni.JString get DISPLAY => jni.JString.fromRef(_get_DISPLAY().object);
static final _get_FINGERPRINT =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -139,8 +136,8 @@
/// from: static public final java.lang.String FINGERPRINT
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get FINGERPRINT =>
- jni.JniString.fromRef(_get_FINGERPRINT().object);
+ static jni.JString get FINGERPRINT =>
+ jni.JString.fromRef(_get_FINGERPRINT().object);
static final _get_HARDWARE =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -149,8 +146,8 @@
/// from: static public final java.lang.String HARDWARE
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get HARDWARE =>
- jni.JniString.fromRef(_get_HARDWARE().object);
+ static jni.JString get HARDWARE =>
+ jni.JString.fromRef(_get_HARDWARE().object);
static final _get_HOST =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("get_Build__HOST")
@@ -158,7 +155,7 @@
/// from: static public final java.lang.String HOST
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get HOST => jni.JniString.fromRef(_get_HOST().object);
+ static jni.JString get HOST => jni.JString.fromRef(_get_HOST().object);
static final _get_ID =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("get_Build__ID")
@@ -166,7 +163,7 @@
/// from: static public final java.lang.String ID
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get ID => jni.JniString.fromRef(_get_ID().object);
+ static jni.JString get ID => jni.JString.fromRef(_get_ID().object);
static final _get_MANUFACTURER =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -175,8 +172,8 @@
/// from: static public final java.lang.String MANUFACTURER
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get MANUFACTURER =>
- jni.JniString.fromRef(_get_MANUFACTURER().object);
+ static jni.JString get MANUFACTURER =>
+ jni.JString.fromRef(_get_MANUFACTURER().object);
static final _get_MODEL =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -185,7 +182,7 @@
/// from: static public final java.lang.String MODEL
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get MODEL => jni.JniString.fromRef(_get_MODEL().object);
+ static jni.JString get MODEL => jni.JString.fromRef(_get_MODEL().object);
static final _get_ODM_SKU =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -194,8 +191,7 @@
/// from: static public final java.lang.String ODM_SKU
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get ODM_SKU =>
- jni.JniString.fromRef(_get_ODM_SKU().object);
+ static jni.JString get ODM_SKU => jni.JString.fromRef(_get_ODM_SKU().object);
static final _get_PRODUCT =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -204,8 +200,7 @@
/// from: static public final java.lang.String PRODUCT
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get PRODUCT =>
- jni.JniString.fromRef(_get_PRODUCT().object);
+ static jni.JString get PRODUCT => jni.JString.fromRef(_get_PRODUCT().object);
static final _get_RADIO =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -214,7 +209,7 @@
/// from: static public final java.lang.String RADIO
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get RADIO => jni.JniString.fromRef(_get_RADIO().object);
+ static jni.JString get RADIO => jni.JString.fromRef(_get_RADIO().object);
static final _get_SERIAL =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -223,8 +218,7 @@
/// from: static public final java.lang.String SERIAL
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get SERIAL =>
- jni.JniString.fromRef(_get_SERIAL().object);
+ static jni.JString get SERIAL => jni.JString.fromRef(_get_SERIAL().object);
static final _get_SKU =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("get_Build__SKU")
@@ -232,7 +226,7 @@
/// from: static public final java.lang.String SKU
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get SKU => jni.JniString.fromRef(_get_SKU().object);
+ static jni.JString get SKU => jni.JString.fromRef(_get_SKU().object);
static final _get_SOC_MANUFACTURER =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -241,8 +235,8 @@
/// from: static public final java.lang.String SOC_MANUFACTURER
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get SOC_MANUFACTURER =>
- jni.JniString.fromRef(_get_SOC_MANUFACTURER().object);
+ static jni.JString get SOC_MANUFACTURER =>
+ jni.JString.fromRef(_get_SOC_MANUFACTURER().object);
static final _get_SOC_MODEL =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -251,8 +245,8 @@
/// from: static public final java.lang.String SOC_MODEL
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get SOC_MODEL =>
- jni.JniString.fromRef(_get_SOC_MODEL().object);
+ static jni.JString get SOC_MODEL =>
+ jni.JString.fromRef(_get_SOC_MODEL().object);
static final _get_SUPPORTED_32_BIT_ABIS =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -261,8 +255,8 @@
/// from: static public final java.lang.String[] SUPPORTED_32_BIT_ABIS
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<jni.JniString> get SUPPORTED_32_BIT_ABIS =>
- jni.JniArray<jni.JniString>.fromRef(_get_SUPPORTED_32_BIT_ABIS().object);
+ static jni.JArray<jni.JString> get SUPPORTED_32_BIT_ABIS =>
+ jni.JArray<jni.JString>.fromRef(_get_SUPPORTED_32_BIT_ABIS().object);
static final _get_SUPPORTED_64_BIT_ABIS =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -271,8 +265,8 @@
/// from: static public final java.lang.String[] SUPPORTED_64_BIT_ABIS
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<jni.JniString> get SUPPORTED_64_BIT_ABIS =>
- jni.JniArray<jni.JniString>.fromRef(_get_SUPPORTED_64_BIT_ABIS().object);
+ static jni.JArray<jni.JString> get SUPPORTED_64_BIT_ABIS =>
+ jni.JArray<jni.JString>.fromRef(_get_SUPPORTED_64_BIT_ABIS().object);
static final _get_SUPPORTED_ABIS =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -281,8 +275,8 @@
/// from: static public final java.lang.String[] SUPPORTED_ABIS
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<jni.JniString> get SUPPORTED_ABIS =>
- jni.JniArray<jni.JniString>.fromRef(_get_SUPPORTED_ABIS().object);
+ static jni.JArray<jni.JString> get SUPPORTED_ABIS =>
+ jni.JArray<jni.JString>.fromRef(_get_SUPPORTED_ABIS().object);
static final _get_TAGS =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("get_Build__TAGS")
@@ -290,7 +284,7 @@
/// from: static public final java.lang.String TAGS
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get TAGS => jni.JniString.fromRef(_get_TAGS().object);
+ static jni.JString get TAGS => jni.JString.fromRef(_get_TAGS().object);
static final _get_TIME =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("get_Build__TIME")
@@ -305,7 +299,7 @@
/// from: static public final java.lang.String TYPE
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get TYPE => jni.JniString.fromRef(_get_TYPE().object);
+ static jni.JString get TYPE => jni.JString.fromRef(_get_TYPE().object);
/// from: static public final java.lang.String UNKNOWN
static const UNKNOWN = "unknown";
@@ -316,7 +310,7 @@
/// from: static public final java.lang.String USER
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString get USER => jni.JniString.fromRef(_get_USER().object);
+ static jni.JString get USER => jni.JString.fromRef(_get_USER().object);
static final _ctor =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Build__ctor")
@@ -332,8 +326,7 @@
/// from: static public java.lang.String getSerial()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString getSerial() =>
- jni.JniString.fromRef(_getSerial().object);
+ static jni.JString getSerial() => jni.JString.fromRef(_getSerial().object);
static final _getFingerprintedPartitions =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -342,8 +335,8 @@
/// from: static public java.util.List getFingerprintedPartitions()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniObject getFingerprintedPartitions() =>
- jni.JniObject.fromRef(_getFingerprintedPartitions().object);
+ static jni.JObject getFingerprintedPartitions() =>
+ jni.JObject.fromRef(_getFingerprintedPartitions().object);
static final _getRadioVersion =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
@@ -352,23 +345,23 @@
/// from: static public java.lang.String getRadioVersion()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniString getRadioVersion() =>
- jni.JniString.fromRef(_getRadioVersion().object);
+ static jni.JString getRadioVersion() =>
+ jni.JString.fromRef(_getRadioVersion().object);
}
-class _$BuildType extends jni.JniType<Build> {
+class _$BuildType extends jni.JType<Build> {
const _$BuildType();
@override
String get signature => r"Landroid/os/Build;";
}
-extension $BuildJniArray on jni.JniArray<Build> {
+extension $BuildArray on jni.JArray<Build> {
Build operator [](int index) {
return Build.fromRef(elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, Build value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/example/in_app_java/lib/main.dart b/pkgs/jnigen/example/in_app_java/lib/main.dart
index dbb34f9..901eb76 100644
--- a/pkgs/jnigen/example/in_app_java/lib/main.dart
+++ b/pkgs/jnigen/example/in_app_java/lib/main.dart
@@ -9,7 +9,7 @@
// structure.
import 'android_utils.dart';
-JniObject activity = JniObject.fromRef(Jni.getCurrentActivity());
+JObject activity = JObject.fromRef(Jni.getCurrentActivity());
/// Display device model number as Toast
void showToast() {
diff --git a/pkgs/jnigen/example/notification_plugin/example/lib/main.dart b/pkgs/jnigen/example/notification_plugin/example/lib/main.dart
index 18b3363..04fb2dc 100644
--- a/pkgs/jnigen/example/notification_plugin/example/lib/main.dart
+++ b/pkgs/jnigen/example/notification_plugin/example/lib/main.dart
@@ -10,14 +10,14 @@
// more customization in future.
import 'package:notification_plugin/notifications.dart';
-JniObject activity = JniObject.fromRef(Jni.getCurrentActivity());
+JObject activity = JObject.fromRef(Jni.getCurrentActivity());
int i = 0;
void showNotification(String title, String text) {
i = i + 1;
- var jTitle = JniString.fromString(title);
- var jText = JniString.fromString(text);
+ var jTitle = JString.fromString(title);
+ var jText = JString.fromString(text);
Notifications.showNotification(activity, i, jTitle, jText);
jTitle.delete();
jText.delete();
diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart
index 4ddcbc6..0bb75e9 100644
--- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart
+++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart
@@ -25,11 +25,11 @@
ProtectedJniExtensions.initGeneratedLibrary("notification_plugin");
/// from: com.example.notification_plugin.Notifications
-class Notifications extends jni.JniObject {
+class Notifications extends jni.JObject {
Notifications.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<Notifications> type = _$NotificationsType();
+ static const jni.JType<Notifications> type = _$NotificationsType();
static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
"Notifications__ctor")
.asFunction<jni.JniResult Function()>();
@@ -49,27 +49,27 @@
ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>();
/// from: static public void showNotification(android.content.Context context, int notificationID, java.lang.String title, java.lang.String text)
- static void showNotification(jni.JniObject context, int notificationID,
- jni.JniString title, jni.JniString text) =>
+ static void showNotification(jni.JObject context, int notificationID,
+ jni.JString title, jni.JString text) =>
_showNotification(context.reference, notificationID, title.reference,
text.reference)
.check();
}
-class _$NotificationsType extends jni.JniType<Notifications> {
+class _$NotificationsType extends jni.JType<Notifications> {
const _$NotificationsType();
@override
String get signature => r"Lcom/example/notification_plugin/Notifications;";
}
-extension $NotificationsJniArray on jni.JniArray<Notifications> {
+extension $NotificationsArray on jni.JArray<Notifications> {
Notifications operator [](int index) {
return Notifications.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, Notifications value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart
index adca8a0..0e74306 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart
@@ -155,9 +155,9 @@
late String author, subject, title;
late int numPages;
- /// Converts JniString to dart string and deletes the original.
+ /// Converts JString to dart string and deletes the original.
/// Also handles the case where the underlying string is Null.
- String _fromJavaStr(JniString jstr) {
+ String _fromJavaStr(JString jstr) {
if (jstr.reference == nullptr) {
return '(null)';
}
diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart
index 20fdd06..1e827e3 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart
@@ -41,11 +41,11 @@
/// This is the in-memory representation of the PDF document.
/// The \#close() method must be called once the document is no longer needed.
///@author Ben Litchfield
-class PDDocument extends jni.JniObject {
+class PDDocument extends jni.JObject {
PDDocument.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<PDDocument> type = _$PDDocumentType();
+ static const jni.JType<PDDocument> type = _$PDDocumentType();
static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
"PDDocument__ctor")
.asFunction<jni.JniResult Function()>();
@@ -67,7 +67,7 @@
/// Creates an empty PDF document.
/// You need to add at least one page for the document to be valid.
///@param memUsageSetting defines how memory is used for buffering PDF streams
- PDDocument.ctor1(jni.JniObject memUsageSetting)
+ PDDocument.ctor1(jni.JObject memUsageSetting)
: super.fromRef(_ctor1(memUsageSetting.reference).object);
static final _ctor2 = jniLookup<
@@ -80,7 +80,7 @@
///
/// Constructor that uses an existing document. The COSDocument that is passed in must be valid.
///@param doc The COSDocument that this document wraps.
- PDDocument.ctor2(jni.JniObject doc)
+ PDDocument.ctor2(jni.JObject doc)
: super.fromRef(_ctor2(doc.reference).object);
static final _ctor3 = jniLookup<
@@ -96,7 +96,7 @@
/// Constructor that uses an existing document. The COSDocument that is passed in must be valid.
///@param doc The COSDocument that this document wraps.
///@param source the parser which is used to read the pdf
- PDDocument.ctor3(jni.JniObject doc, jni.JniObject source)
+ PDDocument.ctor3(jni.JObject doc, jni.JObject source)
: super.fromRef(_ctor3(doc.reference, source.reference).object);
static final _ctor4 = jniLookup<
@@ -115,8 +115,7 @@
///@param doc The COSDocument that this document wraps.
///@param source the parser which is used to read the pdf
///@param permission he access permissions of the pdf
- PDDocument.ctor4(
- jni.JniObject doc, jni.JniObject source, jni.JniObject permission)
+ PDDocument.ctor4(jni.JObject doc, jni.JObject source, jni.JObject permission)
: super.fromRef(
_ctor4(doc.reference, source.reference, permission.reference)
.object);
@@ -134,8 +133,7 @@
/// This will add a page to the document. This is a convenience method, that will add the page to the root of the
/// hierarchy and set the parent of the page to the root.
///@param page The page to add to the document.
- void addPage(jni.JniObject page) =>
- _addPage(reference, page.reference).check();
+ void addPage(jni.JObject page) => _addPage(reference, page.reference).check();
static final _addSignature = jniLookup<
ffi.NativeFunction<
@@ -157,7 +155,7 @@
///@throws IOException if there is an error creating required fields
///@throws IllegalStateException if one attempts to add several signature
/// fields.
- void addSignature(jni.JniObject sigObject) =>
+ void addSignature(jni.JObject sigObject) =>
_addSignature(reference, sigObject.reference).check();
static final _addSignature1 = jniLookup<
@@ -183,7 +181,7 @@
///@throws IOException if there is an error creating required fields
///@throws IllegalStateException if one attempts to add several signature
/// fields.
- void addSignature1(jni.JniObject sigObject, jni.JniObject options) =>
+ void addSignature1(jni.JObject sigObject, jni.JObject options) =>
_addSignature1(reference, sigObject.reference, options.reference).check();
static final _addSignature2 = jniLookup<
@@ -208,8 +206,7 @@
///@throws IOException if there is an error creating required fields
///@throws IllegalStateException if one attempts to add several signature
/// fields.
- void addSignature2(
- jni.JniObject sigObject, jni.JniObject signatureInterface) =>
+ void addSignature2(jni.JObject sigObject, jni.JObject signatureInterface) =>
_addSignature2(
reference, sigObject.reference, signatureInterface.reference)
.check();
@@ -240,8 +237,8 @@
///@throws IOException if there is an error creating required fields
///@throws IllegalStateException if one attempts to add several signature
/// fields.
- void addSignature3(jni.JniObject sigObject, jni.JniObject signatureInterface,
- jni.JniObject options) =>
+ void addSignature3(jni.JObject sigObject, jni.JObject signatureInterface,
+ jni.JObject options) =>
_addSignature3(reference, sigObject.reference,
signatureInterface.reference, options.reference)
.check();
@@ -267,8 +264,8 @@
///@throws IOException if there is an error creating required fields
///@deprecated The method is misleading, because only one signature may be
/// added in a document. The method will be removed in the future.
- void addSignatureField(jni.JniObject sigFields,
- jni.JniObject signatureInterface, jni.JniObject options) =>
+ void addSignatureField(jni.JObject sigFields, jni.JObject signatureInterface,
+ jni.JObject options) =>
_addSignatureField(reference, sigFields.reference,
signatureInterface.reference, options.reference)
.check();
@@ -285,7 +282,7 @@
///
/// Remove the page from the document.
///@param page The page to remove from the document.
- void removePage(jni.JniObject page) =>
+ void removePage(jni.JObject page) =>
_removePage(reference, page.reference).check();
static final _removePage1 = jniLookup<
@@ -333,8 +330,8 @@
///@param page The page to import.
///@return The page that was imported.
///@throws IOException If there is an error copying the page.
- jni.JniObject importPage(jni.JniObject page) =>
- jni.JniObject.fromRef(_importPage(reference, page.reference).object);
+ jni.JObject importPage(jni.JObject page) =>
+ jni.JObject.fromRef(_importPage(reference, page.reference).object);
static final _getDocument = jniLookup<
ffi.NativeFunction<
@@ -347,8 +344,8 @@
///
/// This will get the low level document.
///@return The document that this layer sits on top of.
- jni.JniObject getDocument() =>
- jni.JniObject.fromRef(_getDocument(reference).object);
+ jni.JObject getDocument() =>
+ jni.JObject.fromRef(_getDocument(reference).object);
static final _getDocumentInformation = jniLookup<
ffi.NativeFunction<
@@ -401,8 +398,8 @@
///
/// This will get the document CATALOG. This is guaranteed to not return null.
///@return The documents /Root dictionary
- jni.JniObject getDocumentCatalog() =>
- jni.JniObject.fromRef(_getDocumentCatalog(reference).object);
+ jni.JObject getDocumentCatalog() =>
+ jni.JObject.fromRef(_getDocumentCatalog(reference).object);
static final _isEncrypted = jniLookup<
ffi.NativeFunction<
@@ -430,8 +427,8 @@
/// but the only supported subclass at this time is a
/// PDStandardEncryption object.
///@return The encryption dictionary(most likely a PDStandardEncryption object)
- jni.JniObject getEncryption() =>
- jni.JniObject.fromRef(_getEncryption(reference).object);
+ jni.JObject getEncryption() =>
+ jni.JObject.fromRef(_getEncryption(reference).object);
static final _setEncryptionDictionary = jniLookup<
ffi.NativeFunction<
@@ -447,7 +444,7 @@
/// This will set the encryption dictionary for this document.
///@param encryption The encryption dictionary(most likely a PDStandardEncryption object)
///@throws IOException If there is an error determining which security handler to use.
- void setEncryptionDictionary(jni.JniObject encryption) =>
+ void setEncryptionDictionary(jni.JObject encryption) =>
_setEncryptionDictionary(reference, encryption.reference).check();
static final _getLastSignatureDictionary = jniLookup<
@@ -463,8 +460,8 @@
/// last in time when empty signature fields are created first but signed after other fields.
///@return the last signature as <code>PDSignatureField</code>.
///@throws IOException if no document catalog can be found.
- jni.JniObject getLastSignatureDictionary() =>
- jni.JniObject.fromRef(_getLastSignatureDictionary(reference).object);
+ jni.JObject getLastSignatureDictionary() =>
+ jni.JObject.fromRef(_getLastSignatureDictionary(reference).object);
static final _getSignatureFields = jniLookup<
ffi.NativeFunction<
@@ -478,8 +475,8 @@
/// Retrieve all signature fields from the document.
///@return a <code>List</code> of <code>PDSignatureField</code>s
///@throws IOException if no document catalog can be found.
- jni.JniObject getSignatureFields() =>
- jni.JniObject.fromRef(_getSignatureFields(reference).object);
+ jni.JObject getSignatureFields() =>
+ jni.JObject.fromRef(_getSignatureFields(reference).object);
static final _getSignatureDictionaries = jniLookup<
ffi.NativeFunction<
@@ -493,8 +490,8 @@
/// Retrieve all signature dictionaries from the document.
///@return a <code>List</code> of <code>PDSignatureField</code>s
///@throws IOException if no document catalog can be found.
- jni.JniObject getSignatureDictionaries() =>
- jni.JniObject.fromRef(_getSignatureDictionaries(reference).object);
+ jni.JObject getSignatureDictionaries() =>
+ jni.JObject.fromRef(_getSignatureDictionaries(reference).object);
static final _registerTrueTypeFontForClosing = jniLookup<
ffi.NativeFunction<
@@ -511,7 +508,7 @@
/// is closed when the PDDocument is closed to avoid memory leaks. Users don't have to call this
/// method, it is done by the appropriate PDFont classes.
///@param ttf
- void registerTrueTypeFontForClosing(jni.JniObject ttf) =>
+ void registerTrueTypeFontForClosing(jni.JObject ttf) =>
_registerTrueTypeFontForClosing(reference, ttf.reference).check();
static final _load = jniLookup<
@@ -528,7 +525,7 @@
///@return loaded document
///@throws InvalidPasswordException If the file required a non-empty password.
///@throws IOException in case of a file reading or parsing error
- static PDDocument load(jni.JniObject file) =>
+ static PDDocument load(jni.JObject file) =>
PDDocument.fromRef(_load(file.reference).object);
static final _load1 = jniLookup<
@@ -548,7 +545,7 @@
///@return loaded document
///@throws InvalidPasswordException If the file required a non-empty password.
///@throws IOException in case of a file reading or parsing error
- static PDDocument load1(jni.JniObject file, jni.JniObject memUsageSetting) =>
+ static PDDocument load1(jni.JObject file, jni.JObject memUsageSetting) =>
PDDocument.fromRef(
_load1(file.reference, memUsageSetting.reference).object);
@@ -569,7 +566,7 @@
///@return loaded document
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException in case of a file reading or parsing error
- static PDDocument load2(jni.JniObject file, jni.JniString password) =>
+ static PDDocument load2(jni.JObject file, jni.JString password) =>
PDDocument.fromRef(_load2(file.reference, password.reference).object);
static final _load3 = jniLookup<
@@ -592,8 +589,8 @@
///@return loaded document
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException in case of a file reading or parsing error
- static PDDocument load3(jni.JniObject file, jni.JniString password,
- jni.JniObject memUsageSetting) =>
+ static PDDocument load3(jni.JObject file, jni.JString password,
+ jni.JObject memUsageSetting) =>
PDDocument.fromRef(
_load3(file.reference, password.reference, memUsageSetting.reference)
.object);
@@ -619,8 +616,8 @@
///@param alias alias to be used for decryption when using public key security
///@return loaded document
///@throws IOException in case of a file reading or parsing error
- static PDDocument load4(jni.JniObject file, jni.JniString password,
- jni.JniObject keyStore, jni.JniString alias) =>
+ static PDDocument load4(jni.JObject file, jni.JString password,
+ jni.JObject keyStore, jni.JString alias) =>
PDDocument.fromRef(_load4(file.reference, password.reference,
keyStore.reference, alias.reference)
.object);
@@ -653,11 +650,11 @@
///@return loaded document
///@throws IOException in case of a file reading or parsing error
static PDDocument load5(
- jni.JniObject file,
- jni.JniString password,
- jni.JniObject keyStore,
- jni.JniString alias,
- jni.JniObject memUsageSetting) =>
+ jni.JObject file,
+ jni.JString password,
+ jni.JObject keyStore,
+ jni.JString alias,
+ jni.JObject memUsageSetting) =>
PDDocument.fromRef(_load5(file.reference, password.reference,
keyStore.reference, alias.reference, memUsageSetting.reference)
.object);
@@ -677,7 +674,7 @@
///@return loaded document
///@throws InvalidPasswordException If the PDF required a non-empty password.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load6(jni.JniObject input) =>
+ static PDDocument load6(jni.JObject input) =>
PDDocument.fromRef(_load6(input.reference).object);
static final _load7 = jniLookup<
@@ -698,7 +695,7 @@
///@return loaded document
///@throws InvalidPasswordException If the PDF required a non-empty password.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load7(jni.JniObject input, jni.JniObject memUsageSetting) =>
+ static PDDocument load7(jni.JObject input, jni.JObject memUsageSetting) =>
PDDocument.fromRef(
_load7(input.reference, memUsageSetting.reference).object);
@@ -720,7 +717,7 @@
///@return loaded document
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load8(jni.JniObject input, jni.JniString password) =>
+ static PDDocument load8(jni.JObject input, jni.JString password) =>
PDDocument.fromRef(_load8(input.reference, password.reference).object);
static final _load9 = jniLookup<
@@ -745,8 +742,8 @@
///@param alias alias to be used for decryption when using public key security
///@return loaded document
///@throws IOException In case of a reading or parsing error.
- static PDDocument load9(jni.JniObject input, jni.JniString password,
- jni.JniObject keyStore, jni.JniString alias) =>
+ static PDDocument load9(jni.JObject input, jni.JString password,
+ jni.JObject keyStore, jni.JString alias) =>
PDDocument.fromRef(_load9(input.reference, password.reference,
keyStore.reference, alias.reference)
.object);
@@ -772,8 +769,8 @@
///@return loaded document
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load10(jni.JniObject input, jni.JniString password,
- jni.JniObject memUsageSetting) =>
+ static PDDocument load10(jni.JObject input, jni.JString password,
+ jni.JObject memUsageSetting) =>
PDDocument.fromRef(_load10(
input.reference, password.reference, memUsageSetting.reference)
.object);
@@ -808,11 +805,11 @@
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException In case of a reading or parsing error.
static PDDocument load11(
- jni.JniObject input,
- jni.JniString password,
- jni.JniObject keyStore,
- jni.JniString alias,
- jni.JniObject memUsageSetting) =>
+ jni.JObject input,
+ jni.JString password,
+ jni.JObject keyStore,
+ jni.JString alias,
+ jni.JObject memUsageSetting) =>
PDDocument.fromRef(_load11(input.reference, password.reference,
keyStore.reference, alias.reference, memUsageSetting.reference)
.object);
@@ -831,7 +828,7 @@
///@return loaded document
///@throws InvalidPasswordException If the PDF required a non-empty password.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load12(jni.JniArray<jni.JByte> input) =>
+ static PDDocument load12(jni.JArray<jni.JByte> input) =>
PDDocument.fromRef(_load12(input.reference).object);
static final _load13 = jniLookup<
@@ -851,8 +848,7 @@
///@return loaded document
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load13(
- jni.JniArray<jni.JByte> input, jni.JniString password) =>
+ static PDDocument load13(jni.JArray<jni.JByte> input, jni.JString password) =>
PDDocument.fromRef(_load13(input.reference, password.reference).object);
static final _load14 = jniLookup<
@@ -877,11 +873,8 @@
///@return loaded document
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException In case of a reading or parsing error.
- static PDDocument load14(
- jni.JniArray<jni.JByte> input,
- jni.JniString password,
- jni.JniObject keyStore,
- jni.JniString alias) =>
+ static PDDocument load14(jni.JArray<jni.JByte> input, jni.JString password,
+ jni.JObject keyStore, jni.JString alias) =>
PDDocument.fromRef(_load14(input.reference, password.reference,
keyStore.reference, alias.reference)
.object);
@@ -915,11 +908,11 @@
///@throws InvalidPasswordException If the password is incorrect.
///@throws IOException In case of a reading or parsing error.
static PDDocument load15(
- jni.JniArray<jni.JByte> input,
- jni.JniString password,
- jni.JniObject keyStore,
- jni.JniString alias,
- jni.JniObject memUsageSetting) =>
+ jni.JArray<jni.JByte> input,
+ jni.JString password,
+ jni.JObject keyStore,
+ jni.JString alias,
+ jni.JObject memUsageSetting) =>
PDDocument.fromRef(_load15(input.reference, password.reference,
keyStore.reference, alias.reference, memUsageSetting.reference)
.object);
@@ -941,7 +934,7 @@
/// do not use the document after saving because the contents are now encrypted.
///@param fileName The file to save as.
///@throws IOException if the output could not be written
- void save(jni.JniString fileName) =>
+ void save(jni.JString fileName) =>
_save(reference, fileName.reference).check();
static final _save1 = jniLookup<
@@ -961,7 +954,7 @@
/// do not use the document after saving because the contents are now encrypted.
///@param file The file to save as.
///@throws IOException if the output could not be written
- void save1(jni.JniObject file) => _save1(reference, file.reference).check();
+ void save1(jni.JObject file) => _save1(reference, file.reference).check();
static final _save2 = jniLookup<
ffi.NativeFunction<
@@ -981,8 +974,7 @@
///@param output The stream to write to. It will be closed when done. It is recommended to wrap
/// it in a java.io.BufferedOutputStream, unless it is already buffered.
///@throws IOException if the output could not be written
- void save2(jni.JniObject output) =>
- _save2(reference, output.reference).check();
+ void save2(jni.JObject output) => _save2(reference, output.reference).check();
static final _saveIncremental = jniLookup<
ffi.NativeFunction<
@@ -1007,7 +999,7 @@
/// harmed!
///@throws IOException if the output could not be written
///@throws IllegalStateException if the document was not loaded from a file or a stream.
- void saveIncremental(jni.JniObject output) =>
+ void saveIncremental(jni.JObject output) =>
_saveIncremental(reference, output.reference).check();
static final _saveIncremental1 = jniLookup<
@@ -1040,7 +1032,7 @@
///@param objectsToWrite objects that __must__ be part of the incremental saving.
///@throws IOException if the output could not be written
///@throws IllegalStateException if the document was not loaded from a file or a stream.
- void saveIncremental1(jni.JniObject output, jni.JniObject objectsToWrite) =>
+ void saveIncremental1(jni.JObject output, jni.JObject objectsToWrite) =>
_saveIncremental1(reference, output.reference, objectsToWrite.reference)
.check();
@@ -1093,8 +1085,8 @@
///@throws IOException if the output could not be written
///@throws IllegalStateException if the document was not loaded from a file or a stream or
/// signature options were not set.
- jni.JniObject saveIncrementalForExternalSigning(jni.JniObject output) =>
- jni.JniObject.fromRef(
+ jni.JObject saveIncrementalForExternalSigning(jni.JObject output) =>
+ jni.JObject.fromRef(
_saveIncrementalForExternalSigning(reference, output.reference)
.object);
@@ -1114,8 +1106,8 @@
/// PDDocument\#getPages() instead.
///@param pageIndex the 0-based page index
///@return the page at the given index.
- jni.JniObject getPage(int pageIndex) =>
- jni.JniObject.fromRef(_getPage(reference, pageIndex).object);
+ jni.JObject getPage(int pageIndex) =>
+ jni.JObject.fromRef(_getPage(reference, pageIndex).object);
static final _getPages = jniLookup<
ffi.NativeFunction<
@@ -1128,8 +1120,7 @@
///
/// Returns the page tree.
///@return the page tree
- jni.JniObject getPages() =>
- jni.JniObject.fromRef(_getPages(reference).object);
+ jni.JObject getPages() => jni.JObject.fromRef(_getPages(reference).object);
static final _getNumberOfPages = jniLookup<
ffi.NativeFunction<
@@ -1175,7 +1166,7 @@
///@see org.apache.pdfbox.pdmodel.encryption.PublicKeyProtectionPolicy
///@param policy The protection policy.
///@throws IOException if there isn't any suitable security handler.
- void protect(jni.JniObject policy) =>
+ void protect(jni.JObject policy) =>
_protect(reference, policy.reference).check();
static final _getCurrentAccessPermission = jniLookup<
@@ -1192,8 +1183,8 @@
/// only mode so that permissions cannot be changed. Methods providing access to content should rely on this object
/// to verify if the current user is allowed to proceed.
///@return the access permissions for the current user on the document.
- jni.JniObject getCurrentAccessPermission() =>
- jni.JniObject.fromRef(_getCurrentAccessPermission(reference).object);
+ jni.JObject getCurrentAccessPermission() =>
+ jni.JObject.fromRef(_getCurrentAccessPermission(reference).object);
static final _isAllSecurityToBeRemoved = jniLookup<
ffi.NativeFunction<
@@ -1232,8 +1223,8 @@
///
/// Provides the document ID.
///@return the document ID
- jni.JniObject getDocumentId() =>
- jni.JniObject.fromRef(_getDocumentId(reference).object);
+ jni.JObject getDocumentId() =>
+ jni.JObject.fromRef(_getDocumentId(reference).object);
static final _setDocumentId = jniLookup<
ffi.NativeFunction<
@@ -1247,7 +1238,7 @@
///
/// Sets the document ID to the given value.
///@param docId the new document ID
- void setDocumentId(jni.JniObject docId) =>
+ void setDocumentId(jni.JObject docId) =>
_setDocumentId(reference, docId.reference).check();
static final _getVersion = jniLookup<
@@ -1286,8 +1277,8 @@
///
/// Returns the resource cache associated with this document, or null if there is none.
///@return the resource cache or null.
- jni.JniObject getResourceCache() =>
- jni.JniObject.fromRef(_getResourceCache(reference).object);
+ jni.JObject getResourceCache() =>
+ jni.JObject.fromRef(_getResourceCache(reference).object);
static final _setResourceCache = jniLookup<
ffi.NativeFunction<
@@ -1301,24 +1292,24 @@
///
/// Sets the resource cache associated with this document.
///@param resourceCache A resource cache, or null.
- void setResourceCache(jni.JniObject resourceCache) =>
+ void setResourceCache(jni.JObject resourceCache) =>
_setResourceCache(reference, resourceCache.reference).check();
}
-class _$PDDocumentType extends jni.JniType<PDDocument> {
+class _$PDDocumentType extends jni.JType<PDDocument> {
const _$PDDocumentType();
@override
String get signature => r"Lorg/apache/pdfbox/pdmodel/PDDocument;";
}
-extension $PDDocumentJniArray on jni.JniArray<PDDocument> {
+extension $PDDocumentArray on jni.JArray<PDDocument> {
PDDocument operator [](int index) {
return PDDocument.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, PDDocument value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart
index 771a9e9..cc07461 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart
@@ -42,11 +42,11 @@
/// method then it will clear the value.
///@author Ben Litchfield
///@author Gerardo Ortiz
-class PDDocumentInformation extends jni.JniObject {
+class PDDocumentInformation extends jni.JObject {
PDDocumentInformation.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<PDDocumentInformation> type =
+ static const jni.JType<PDDocumentInformation> type =
_$PDDocumentInformationType();
static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
"PDDocumentInformation__ctor")
@@ -67,7 +67,7 @@
///
/// Constructor that is used for a preexisting dictionary.
///@param dic The underlying dictionary.
- PDDocumentInformation.ctor1(jni.JniObject dic)
+ PDDocumentInformation.ctor1(jni.JObject dic)
: super.fromRef(_ctor1(dic.reference).object);
static final _getCOSObject = jniLookup<
@@ -81,8 +81,8 @@
///
/// This will get the underlying dictionary that this object wraps.
///@return The underlying info dictionary.
- jni.JniObject getCOSObject() =>
- jni.JniObject.fromRef(_getCOSObject(reference).object);
+ jni.JObject getCOSObject() =>
+ jni.JObject.fromRef(_getCOSObject(reference).object);
static final _getPropertyStringValue = jniLookup<
ffi.NativeFunction<
@@ -104,8 +104,8 @@
///
///@param propertyKey the dictionaries key
///@return the properties value
- jni.JniObject getPropertyStringValue(jni.JniString propertyKey) =>
- jni.JniObject.fromRef(
+ jni.JObject getPropertyStringValue(jni.JString propertyKey) =>
+ jni.JObject.fromRef(
_getPropertyStringValue(reference, propertyKey.reference).object);
static final _getTitle = jniLookup<
@@ -119,8 +119,7 @@
///
/// This will get the title of the document. This will return null if no title exists.
///@return The title of the document.
- jni.JniString getTitle() =>
- jni.JniString.fromRef(_getTitle(reference).object);
+ jni.JString getTitle() => jni.JString.fromRef(_getTitle(reference).object);
static final _setTitle = jniLookup<
ffi.NativeFunction<
@@ -134,7 +133,7 @@
///
/// This will set the title of the document.
///@param title The new title for the document.
- void setTitle(jni.JniString title) =>
+ void setTitle(jni.JString title) =>
_setTitle(reference, title.reference).check();
static final _getAuthor = jniLookup<
@@ -148,8 +147,7 @@
///
/// This will get the author of the document. This will return null if no author exists.
///@return The author of the document.
- jni.JniString getAuthor() =>
- jni.JniString.fromRef(_getAuthor(reference).object);
+ jni.JString getAuthor() => jni.JString.fromRef(_getAuthor(reference).object);
static final _setAuthor = jniLookup<
ffi.NativeFunction<
@@ -163,7 +161,7 @@
///
/// This will set the author of the document.
///@param author The new author for the document.
- void setAuthor(jni.JniString author) =>
+ void setAuthor(jni.JString author) =>
_setAuthor(reference, author.reference).check();
static final _getSubject = jniLookup<
@@ -177,8 +175,8 @@
///
/// This will get the subject of the document. This will return null if no subject exists.
///@return The subject of the document.
- jni.JniString getSubject() =>
- jni.JniString.fromRef(_getSubject(reference).object);
+ jni.JString getSubject() =>
+ jni.JString.fromRef(_getSubject(reference).object);
static final _setSubject = jniLookup<
ffi.NativeFunction<
@@ -192,7 +190,7 @@
///
/// This will set the subject of the document.
///@param subject The new subject for the document.
- void setSubject(jni.JniString subject) =>
+ void setSubject(jni.JString subject) =>
_setSubject(reference, subject.reference).check();
static final _getKeywords = jniLookup<
@@ -206,8 +204,8 @@
///
/// This will get the keywords of the document. This will return null if no keywords exists.
///@return The keywords of the document.
- jni.JniString getKeywords() =>
- jni.JniString.fromRef(_getKeywords(reference).object);
+ jni.JString getKeywords() =>
+ jni.JString.fromRef(_getKeywords(reference).object);
static final _setKeywords = jniLookup<
ffi.NativeFunction<
@@ -221,7 +219,7 @@
///
/// This will set the keywords of the document.
///@param keywords The new keywords for the document.
- void setKeywords(jni.JniString keywords) =>
+ void setKeywords(jni.JString keywords) =>
_setKeywords(reference, keywords.reference).check();
static final _getCreator = jniLookup<
@@ -235,8 +233,8 @@
///
/// This will get the creator of the document. This will return null if no creator exists.
///@return The creator of the document.
- jni.JniString getCreator() =>
- jni.JniString.fromRef(_getCreator(reference).object);
+ jni.JString getCreator() =>
+ jni.JString.fromRef(_getCreator(reference).object);
static final _setCreator = jniLookup<
ffi.NativeFunction<
@@ -250,7 +248,7 @@
///
/// This will set the creator of the document.
///@param creator The new creator for the document.
- void setCreator(jni.JniString creator) =>
+ void setCreator(jni.JString creator) =>
_setCreator(reference, creator.reference).check();
static final _getProducer = jniLookup<
@@ -264,8 +262,8 @@
///
/// This will get the producer of the document. This will return null if no producer exists.
///@return The producer of the document.
- jni.JniString getProducer() =>
- jni.JniString.fromRef(_getProducer(reference).object);
+ jni.JString getProducer() =>
+ jni.JString.fromRef(_getProducer(reference).object);
static final _setProducer = jniLookup<
ffi.NativeFunction<
@@ -279,7 +277,7 @@
///
/// This will set the producer of the document.
///@param producer The new producer for the document.
- void setProducer(jni.JniString producer) =>
+ void setProducer(jni.JString producer) =>
_setProducer(reference, producer.reference).check();
static final _getCreationDate = jniLookup<
@@ -293,8 +291,8 @@
///
/// This will get the creation date of the document. This will return null if no creation date exists.
///@return The creation date of the document.
- jni.JniObject getCreationDate() =>
- jni.JniObject.fromRef(_getCreationDate(reference).object);
+ jni.JObject getCreationDate() =>
+ jni.JObject.fromRef(_getCreationDate(reference).object);
static final _setCreationDate = jniLookup<
ffi.NativeFunction<
@@ -309,7 +307,7 @@
///
/// This will set the creation date of the document.
///@param date The new creation date for the document.
- void setCreationDate(jni.JniObject date) =>
+ void setCreationDate(jni.JObject date) =>
_setCreationDate(reference, date.reference).check();
static final _getModificationDate = jniLookup<
@@ -323,8 +321,8 @@
///
/// This will get the modification date of the document. This will return null if no modification date exists.
///@return The modification date of the document.
- jni.JniObject getModificationDate() =>
- jni.JniObject.fromRef(_getModificationDate(reference).object);
+ jni.JObject getModificationDate() =>
+ jni.JObject.fromRef(_getModificationDate(reference).object);
static final _setModificationDate = jniLookup<
ffi.NativeFunction<
@@ -339,7 +337,7 @@
///
/// This will set the modification date of the document.
///@param date The new modification date for the document.
- void setModificationDate(jni.JniObject date) =>
+ void setModificationDate(jni.JObject date) =>
_setModificationDate(reference, date.reference).check();
static final _getTrapped = jniLookup<
@@ -354,8 +352,8 @@
/// This will get the trapped value for the document.
/// This will return null if one is not found.
///@return The trapped value for the document.
- jni.JniString getTrapped() =>
- jni.JniString.fromRef(_getTrapped(reference).object);
+ jni.JString getTrapped() =>
+ jni.JString.fromRef(_getTrapped(reference).object);
static final _getMetadataKeys = jniLookup<
ffi.NativeFunction<
@@ -369,8 +367,8 @@
/// This will get the keys of all metadata information fields for the document.
///@return all metadata key strings.
///@since Apache PDFBox 1.3.0
- jni.JniObject getMetadataKeys() =>
- jni.JniObject.fromRef(_getMetadataKeys(reference).object);
+ jni.JObject getMetadataKeys() =>
+ jni.JObject.fromRef(_getMetadataKeys(reference).object);
static final _getCustomMetadataValue = jniLookup<
ffi.NativeFunction<
@@ -388,8 +386,8 @@
/// This will return null if one is not found.
///@param fieldName Name of custom metadata field from pdf document.
///@return String Value of metadata field
- jni.JniString getCustomMetadataValue(jni.JniString fieldName) =>
- jni.JniString.fromRef(
+ jni.JString getCustomMetadataValue(jni.JString fieldName) =>
+ jni.JString.fromRef(
_getCustomMetadataValue(reference, fieldName.reference).object);
static final _setCustomMetadataValue = jniLookup<
@@ -406,8 +404,7 @@
/// Set the custom metadata value.
///@param fieldName The name of the custom metadata field.
///@param fieldValue The value to the custom metadata field.
- void setCustomMetadataValue(
- jni.JniString fieldName, jni.JniString fieldValue) =>
+ void setCustomMetadataValue(jni.JString fieldName, jni.JString fieldValue) =>
_setCustomMetadataValue(
reference, fieldName.reference, fieldValue.reference)
.check();
@@ -426,25 +423,24 @@
/// 'True', 'False', or 'Unknown'.
///@param value The new trapped value for the document.
///@throws IllegalArgumentException if the parameter is invalid.
- void setTrapped(jni.JniString value) =>
+ void setTrapped(jni.JString value) =>
_setTrapped(reference, value.reference).check();
}
-class _$PDDocumentInformationType extends jni.JniType<PDDocumentInformation> {
+class _$PDDocumentInformationType extends jni.JType<PDDocumentInformation> {
const _$PDDocumentInformationType();
@override
String get signature => r"Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;";
}
-extension $PDDocumentInformationJniArray
- on jni.JniArray<PDDocumentInformation> {
+extension $PDDocumentInformationArray on jni.JArray<PDDocumentInformation> {
PDDocumentInformation operator [](int index) {
return PDDocumentInformation.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, PDDocumentInformation value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart
index 7ad5ef6..e35b19c 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart
@@ -45,36 +45,36 @@
/// The basic flow of this process is that we get a document and use a series of processXXX() functions that work on
/// smaller and smaller chunks of the page. Eventually, we fully process each page and then print it.
///@author Ben Litchfield
-class PDFTextStripper extends jni.JniObject {
+class PDFTextStripper extends jni.JObject {
PDFTextStripper.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<PDFTextStripper> type = _$PDFTextStripperType();
+ static const jni.JType<PDFTextStripper> type = _$PDFTextStripperType();
static final _get_LINE_SEPARATOR = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>>("get_PDFTextStripper__LINE_SEPARATOR")
.asFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>();
/// from: protected final java.lang.String LINE_SEPARATOR
/// The returned object must be deleted after use, by calling the `delete` method.
///
/// The platform's line separator.
- jni.JniString get LINE_SEPARATOR =>
- jni.JniString.fromRef(_get_LINE_SEPARATOR(reference).object);
+ jni.JString get LINE_SEPARATOR =>
+ jni.JString.fromRef(_get_LINE_SEPARATOR(reference).object);
static final _get_charactersByArticle = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>>("get_PDFTextStripper__charactersByArticle")
.asFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>();
/// from: protected java.util.ArrayList<java.util.List<org.apache.pdfbox.text.TextPosition>> charactersByArticle
@@ -92,14 +92,15 @@
/// text after second article
///
/// Most PDFs won't have any beads, so charactersByArticle will contain a single entry.
- jni.JniObject get charactersByArticle =>
- jni.JniObject.fromRef(_get_charactersByArticle(reference).object);
+ jni.JObject get charactersByArticle =>
+ jni.JObject.fromRef(_get_charactersByArticle(reference).object);
static final _set_charactersByArticle = jniLookup<
ffi.NativeFunction<
- jni.JThrowable Function(jni.JObject, ffi.Pointer<ffi.Void>)>>(
+ jni.JThrowablePtr Function(
+ jni.JObjectPtr, ffi.Pointer<ffi.Void>)>>(
"set_PDFTextStripper__charactersByArticle")
.asFunction<
- jni.JThrowable Function(jni.JObject, ffi.Pointer<ffi.Void>)>();
+ jni.JThrowablePtr Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>();
/// from: protected java.util.ArrayList<java.util.List<org.apache.pdfbox.text.TextPosition>> charactersByArticle
/// The returned object must be deleted after use, by calling the `delete` method.
@@ -116,17 +117,17 @@
/// text after second article
///
/// Most PDFs won't have any beads, so charactersByArticle will contain a single entry.
- set charactersByArticle(jni.JniObject value) =>
+ set charactersByArticle(jni.JObject value) =>
_set_charactersByArticle(reference, value.reference);
static final _get_document = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>>("get_PDFTextStripper__document")
.asFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>();
/// from: protected org.apache.pdfbox.pdmodel.PDDocument document
@@ -135,10 +136,10 @@
pddocument_.PDDocument.fromRef(_get_document(reference).object);
static final _set_document = jniLookup<
ffi.NativeFunction<
- jni.JThrowable Function(jni.JObject,
+ jni.JThrowablePtr Function(jni.JObjectPtr,
ffi.Pointer<ffi.Void>)>>("set_PDFTextStripper__document")
.asFunction<
- jni.JThrowable Function(jni.JObject, ffi.Pointer<ffi.Void>)>();
+ jni.JThrowablePtr Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>();
/// from: protected org.apache.pdfbox.pdmodel.PDDocument document
/// The returned object must be deleted after use, by calling the `delete` method.
@@ -148,27 +149,26 @@
static final _get_output = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>>("get_PDFTextStripper__output")
.asFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>();
/// from: protected java.io.Writer output
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject get output =>
- jni.JniObject.fromRef(_get_output(reference).object);
+ jni.JObject get output => jni.JObject.fromRef(_get_output(reference).object);
static final _set_output = jniLookup<
ffi.NativeFunction<
- jni.JThrowable Function(jni.JObject,
+ jni.JThrowablePtr Function(jni.JObjectPtr,
ffi.Pointer<ffi.Void>)>>("set_PDFTextStripper__output")
.asFunction<
- jni.JThrowable Function(jni.JObject, ffi.Pointer<ffi.Void>)>();
+ jni.JThrowablePtr Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>();
/// from: protected java.io.Writer output
/// The returned object must be deleted after use, by calling the `delete` method.
- set output(jni.JniObject value) => _set_output(reference, value.reference);
+ set output(jni.JObject value) => _set_output(reference, value.reference);
static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
"PDFTextStripper__ctor")
@@ -201,8 +201,8 @@
///@param doc The document to get the text from.
///@return The text of the PDF document.
///@throws IOException if the doc state is invalid or it is encrypted.
- jni.JniString getText(pddocument_.PDDocument doc) =>
- jni.JniString.fromRef(_getText(reference, doc.reference).object);
+ jni.JString getText(pddocument_.PDDocument doc) =>
+ jni.JString.fromRef(_getText(reference, doc.reference).object);
static final _writeText = jniLookup<
ffi.NativeFunction<
@@ -220,7 +220,7 @@
///@param doc The document to get the data from.
///@param outputStream The location to put the text.
///@throws IOException If the doc is in an invalid state.
- void writeText(pddocument_.PDDocument doc, jni.JniObject outputStream) =>
+ void writeText(pddocument_.PDDocument doc, jni.JObject outputStream) =>
_writeText(reference, doc.reference, outputStream.reference).check();
static final _processPages = jniLookup<
@@ -236,7 +236,7 @@
/// This will process all of the pages and the text that is in them.
///@param pages The pages object in the document.
///@throws IOException If there is an error parsing the text.
- void processPages(jni.JniObject pages) =>
+ void processPages(jni.JObject pages) =>
_processPages(reference, pages.reference).check();
static final _startDocument = jniLookup<
@@ -285,7 +285,7 @@
/// This will process the contents of a page.
///@param page The page to process.
///@throws IOException If there is an error processing the page.
- void processPage(jni.JniObject page) =>
+ void processPage(jni.JObject page) =>
_processPage(reference, page.reference).check();
static final _startArticle = jniLookup<
@@ -342,7 +342,7 @@
/// Start a new page. Default implementation is to do nothing. Subclasses may provide additional information.
///@param page The page we are about to process.
///@throws IOException If there is any error writing to the stream.
- void startPage(jni.JniObject page) =>
+ void startPage(jni.JObject page) =>
_startPage(reference, page.reference).check();
static final _endPage = jniLookup<
@@ -358,8 +358,7 @@
/// End a page. Default implementation is to do nothing. Subclasses may provide additional information.
///@param page The page we are about to process.
///@throws IOException If there is any error writing to the stream.
- void endPage(jni.JniObject page) =>
- _endPage(reference, page.reference).check();
+ void endPage(jni.JObject page) => _endPage(reference, page.reference).check();
static final _writePage = jniLookup<
ffi.NativeFunction<
@@ -412,7 +411,7 @@
/// Write the string in TextPosition to the output stream.
///@param text The text to write to the stream.
///@throws IOException If there is an error when writing the text.
- void writeCharacters(jni.JniObject text) =>
+ void writeCharacters(jni.JObject text) =>
_writeCharacters(reference, text.reference).check();
static final _writeString = jniLookup<
@@ -432,7 +431,7 @@
///@param text The text to write to the stream.
///@param textPositions The TextPositions belonging to the text.
///@throws IOException If there is an error when writing the text.
- void writeString(jni.JniString text, jni.JniObject textPositions) =>
+ void writeString(jni.JString text, jni.JObject textPositions) =>
_writeString(reference, text.reference, textPositions.reference).check();
static final _writeString1 = jniLookup<
@@ -448,7 +447,7 @@
/// Write a Java string to the output stream.
///@param text The text to write to the stream.
///@throws IOException If there is an error when writing the text.
- void writeString1(jni.JniString text) =>
+ void writeString1(jni.JString text) =>
_writeString1(reference, text.reference).check();
static final _processTextPosition = jniLookup<
@@ -465,7 +464,7 @@
/// This will process a TextPosition object and add the text to the list of characters on a page. It takes care of
/// overlapping text.
///@param text The text to process.
- void processTextPosition(jni.JniObject text) =>
+ void processTextPosition(jni.JObject text) =>
_processTextPosition(reference, text.reference).check();
static final _getStartPage = jniLookup<
@@ -535,7 +534,7 @@
/// Set the desired line separator for output text. The line.separator system property is used if the line separator
/// preference is not set explicitly using this method.
///@param separator The desired line separator string.
- void setLineSeparator(jni.JniString separator) =>
+ void setLineSeparator(jni.JString separator) =>
_setLineSeparator(reference, separator.reference).check();
static final _getLineSeparator = jniLookup<
@@ -549,8 +548,8 @@
///
/// This will get the line separator.
///@return The desired line separator string.
- jni.JniString getLineSeparator() =>
- jni.JniString.fromRef(_getLineSeparator(reference).object);
+ jni.JString getLineSeparator() =>
+ jni.JString.fromRef(_getLineSeparator(reference).object);
static final _getWordSeparator = jniLookup<
ffi.NativeFunction<
@@ -563,8 +562,8 @@
///
/// This will get the word separator.
///@return The desired word separator string.
- jni.JniString getWordSeparator() =>
- jni.JniString.fromRef(_getWordSeparator(reference).object);
+ jni.JString getWordSeparator() =>
+ jni.JString.fromRef(_getWordSeparator(reference).object);
static final _setWordSeparator = jniLookup<
ffi.NativeFunction<
@@ -581,7 +580,7 @@
/// accurate count of characters that are found in a PDF document then you might want to set the word separator to
/// the empty string.
///@param separator The desired page separator string.
- void setWordSeparator(jni.JniString separator) =>
+ void setWordSeparator(jni.JString separator) =>
_setWordSeparator(reference, separator.reference).check();
static final _getSuppressDuplicateOverlappingText = jniLookup<
@@ -619,8 +618,7 @@
///
/// The output stream that is being written to.
///@return The stream that output is being written to.
- jni.JniObject getOutput() =>
- jni.JniObject.fromRef(_getOutput(reference).object);
+ jni.JObject getOutput() => jni.JObject.fromRef(_getOutput(reference).object);
static final _getCharactersByArticle = jniLookup<
ffi.NativeFunction<
@@ -634,8 +632,8 @@
/// Character strings are grouped by articles. It is quite common that there will only be a single article. This
/// returns a List that contains List objects, the inner lists will contain TextPosition objects.
///@return A double List of TextPositions for all text strings on the page.
- jni.JniObject getCharactersByArticle() =>
- jni.JniObject.fromRef(_getCharactersByArticle(reference).object);
+ jni.JObject getCharactersByArticle() =>
+ jni.JObject.fromRef(_getCharactersByArticle(reference).object);
static final _setSuppressDuplicateOverlappingText = jniLookup<
ffi.NativeFunction<
@@ -692,8 +690,8 @@
///
/// Get the bookmark where text extraction should end, inclusive. Default is null.
///@return The ending bookmark.
- jni.JniObject getEndBookmark() =>
- jni.JniObject.fromRef(_getEndBookmark(reference).object);
+ jni.JObject getEndBookmark() =>
+ jni.JObject.fromRef(_getEndBookmark(reference).object);
static final _setEndBookmark = jniLookup<
ffi.NativeFunction<
@@ -707,7 +705,7 @@
///
/// Set the bookmark where the text extraction should stop.
///@param aEndBookmark The ending bookmark.
- void setEndBookmark(jni.JniObject aEndBookmark) =>
+ void setEndBookmark(jni.JObject aEndBookmark) =>
_setEndBookmark(reference, aEndBookmark.reference).check();
static final _getStartBookmark = jniLookup<
@@ -721,8 +719,8 @@
///
/// Get the bookmark where text extraction should start, inclusive. Default is null.
///@return The starting bookmark.
- jni.JniObject getStartBookmark() =>
- jni.JniObject.fromRef(_getStartBookmark(reference).object);
+ jni.JObject getStartBookmark() =>
+ jni.JObject.fromRef(_getStartBookmark(reference).object);
static final _setStartBookmark = jniLookup<
ffi.NativeFunction<
@@ -736,7 +734,7 @@
///
/// Set the bookmark where text extraction should start, inclusive.
///@param aStartBookmark The starting bookmark.
- void setStartBookmark(jni.JniObject aStartBookmark) =>
+ void setStartBookmark(jni.JObject aStartBookmark) =>
_setStartBookmark(reference, aStartBookmark.reference).check();
static final _getAddMoreFormatting = jniLookup<
@@ -918,8 +916,8 @@
///
/// Returns the string which will be used at the beginning of a paragraph.
///@return the paragraph start string
- jni.JniString getParagraphStart() =>
- jni.JniString.fromRef(_getParagraphStart(reference).object);
+ jni.JString getParagraphStart() =>
+ jni.JString.fromRef(_getParagraphStart(reference).object);
static final _setParagraphStart = jniLookup<
ffi.NativeFunction<
@@ -933,7 +931,7 @@
///
/// Sets the string which will be used at the beginning of a paragraph.
///@param s the paragraph start string
- void setParagraphStart(jni.JniString s) =>
+ void setParagraphStart(jni.JString s) =>
_setParagraphStart(reference, s.reference).check();
static final _getParagraphEnd = jniLookup<
@@ -947,8 +945,8 @@
///
/// Returns the string which will be used at the end of a paragraph.
///@return the paragraph end string
- jni.JniString getParagraphEnd() =>
- jni.JniString.fromRef(_getParagraphEnd(reference).object);
+ jni.JString getParagraphEnd() =>
+ jni.JString.fromRef(_getParagraphEnd(reference).object);
static final _setParagraphEnd = jniLookup<
ffi.NativeFunction<
@@ -962,7 +960,7 @@
///
/// Sets the string which will be used at the end of a paragraph.
///@param s the paragraph end string
- void setParagraphEnd(jni.JniString s) =>
+ void setParagraphEnd(jni.JString s) =>
_setParagraphEnd(reference, s.reference).check();
static final _getPageStart = jniLookup<
@@ -976,8 +974,8 @@
///
/// Returns the string which will be used at the beginning of a page.
///@return the page start string
- jni.JniString getPageStart() =>
- jni.JniString.fromRef(_getPageStart(reference).object);
+ jni.JString getPageStart() =>
+ jni.JString.fromRef(_getPageStart(reference).object);
static final _setPageStart = jniLookup<
ffi.NativeFunction<
@@ -991,7 +989,7 @@
///
/// Sets the string which will be used at the beginning of a page.
///@param pageStartValue the page start string
- void setPageStart(jni.JniString pageStartValue) =>
+ void setPageStart(jni.JString pageStartValue) =>
_setPageStart(reference, pageStartValue.reference).check();
static final _getPageEnd = jniLookup<
@@ -1005,8 +1003,8 @@
///
/// Returns the string which will be used at the end of a page.
///@return the page end string
- jni.JniString getPageEnd() =>
- jni.JniString.fromRef(_getPageEnd(reference).object);
+ jni.JString getPageEnd() =>
+ jni.JString.fromRef(_getPageEnd(reference).object);
static final _setPageEnd = jniLookup<
ffi.NativeFunction<
@@ -1020,7 +1018,7 @@
///
/// Sets the string which will be used at the end of a page.
///@param pageEndValue the page end string
- void setPageEnd(jni.JniString pageEndValue) =>
+ void setPageEnd(jni.JString pageEndValue) =>
_setPageEnd(reference, pageEndValue.reference).check();
static final _getArticleStart = jniLookup<
@@ -1034,8 +1032,8 @@
///
/// Returns the string which will be used at the beginning of an article.
///@return the article start string
- jni.JniString getArticleStart() =>
- jni.JniString.fromRef(_getArticleStart(reference).object);
+ jni.JString getArticleStart() =>
+ jni.JString.fromRef(_getArticleStart(reference).object);
static final _setArticleStart = jniLookup<
ffi.NativeFunction<
@@ -1049,7 +1047,7 @@
///
/// Sets the string which will be used at the beginning of an article.
///@param articleStartValue the article start string
- void setArticleStart(jni.JniString articleStartValue) =>
+ void setArticleStart(jni.JString articleStartValue) =>
_setArticleStart(reference, articleStartValue.reference).check();
static final _getArticleEnd = jniLookup<
@@ -1063,8 +1061,8 @@
///
/// Returns the string which will be used at the end of an article.
///@return the article end string
- jni.JniString getArticleEnd() =>
- jni.JniString.fromRef(_getArticleEnd(reference).object);
+ jni.JString getArticleEnd() =>
+ jni.JString.fromRef(_getArticleEnd(reference).object);
static final _setArticleEnd = jniLookup<
ffi.NativeFunction<
@@ -1078,7 +1076,7 @@
///
/// Sets the string which will be used at the end of an article.
///@param articleEndValue the article end string
- void setArticleEnd(jni.JniString articleEndValue) =>
+ void setArticleEnd(jni.JString articleEndValue) =>
_setArticleEnd(reference, articleEndValue.reference).check();
static final _writeParagraphSeparator = jniLookup<
@@ -1154,7 +1152,7 @@
///
/// use to supply a different set of regular expression patterns for matching list item starts.
///@param patterns list of patterns
- void setListItemPatterns(jni.JniObject patterns) =>
+ void setListItemPatterns(jni.JObject patterns) =>
_setListItemPatterns(reference, patterns.reference).check();
static final _getListItemPatterns = jniLookup<
@@ -1182,8 +1180,8 @@
///
/// This method returns a list of such regular expression Patterns.
///@return a list of Pattern objects.
- jni.JniObject getListItemPatterns() =>
- jni.JniObject.fromRef(_getListItemPatterns(reference).object);
+ jni.JObject getListItemPatterns() =>
+ jni.JObject.fromRef(_getListItemPatterns(reference).object);
static final _matchPattern = jniLookup<
ffi.NativeFunction<
@@ -1206,26 +1204,25 @@
///@param string the string to be searched
///@param patterns list of patterns
///@return matching pattern
- static jni.JniObject matchPattern(
- jni.JniString string, jni.JniObject patterns) =>
- jni.JniObject.fromRef(
+ static jni.JObject matchPattern(jni.JString string, jni.JObject patterns) =>
+ jni.JObject.fromRef(
_matchPattern(string.reference, patterns.reference).object);
}
-class _$PDFTextStripperType extends jni.JniType<PDFTextStripper> {
+class _$PDFTextStripperType extends jni.JType<PDFTextStripper> {
const _$PDFTextStripperType();
@override
String get signature => r"Lorg/apache/pdfbox/text/PDFTextStripper;";
}
-extension $PDFTextStripperJniArray on jni.JniArray<PDFTextStripper> {
+extension $PDFTextStripperArray on jni.JArray<PDFTextStripper> {
PDFTextStripper operator [](int index) {
return PDFTextStripper.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, PDFTextStripper value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/lib/src/bindings/common.dart b/pkgs/jnigen/lib/src/bindings/common.dart
index 41b08f5..ab1bc7f 100644
--- a/pkgs/jnigen/lib/src/bindings/common.dart
+++ b/pkgs/jnigen/lib/src/bindings/common.dart
@@ -26,17 +26,17 @@
static const String ffiVoidType = '${ffi}Void';
- static const String jobjectType = '${jni}JObject';
+ static const String jobjectType = '${jni}JObjectPtr';
- static const String jthrowableType = '${jni}JThrowable';
+ static const String jthrowableType = '${jni}JThrowablePtr';
- static const String jniObjectType = '${jni}JniObject';
+ static const String jniObjectType = '${jni}JObject';
- static const String jniArrayType = '${jni}JniArray';
+ static const String jniArrayType = '${jni}JArray';
static const String jniCallType = '${jni}JniCallType';
- static const String jniTypeType = '${jni}JniType';
+ static const String jniTypeType = '${jni}JType';
static const String typeClassSuffix = 'Type';
static const String typeClassPrefix = '_\$';
@@ -102,7 +102,7 @@
String dartArrayExtension(ClassDecl decl) {
final name = decl.finalName;
- return '\nextension \$${name}JniArray on $jniArrayType<$name> {\n'
+ return '\nextension \$${name}Array on $jniArrayType<$name> {\n'
'$indent$name operator [](int index) {\n'
'${indent * 2}return $name.fromRef(elementAt(index, ${jni}JniCallType.objectType).object);\n'
'$indent}\n\n'
diff --git a/pkgs/jnigen/lib/src/bindings/pure_dart_bindings.dart b/pkgs/jnigen/lib/src/bindings/pure_dart_bindings.dart
index ee0d4c8..ec3699f 100644
--- a/pkgs/jnigen/lib/src/bindings/pure_dart_bindings.dart
+++ b/pkgs/jnigen/lib/src/bindings/pure_dart_bindings.dart
@@ -26,6 +26,7 @@
static const voidPointer = BindingsGenerator.voidPointer;
static const ffiVoidType = BindingsGenerator.ffiVoidType;
static const jniObjectType = BindingsGenerator.jniObjectType;
+ static const jobjectType = BindingsGenerator.jobjectType;
static final _deleteInstruction = BindingsGenerator.deleteInstruction;
@@ -65,7 +66,7 @@
final internalName = escapeDollarSign(getInternalName(decl.binaryName));
s.write('class $name extends $superName {\n'
' static final $classRef = $accessors.getClassOf("$internalName");\n'
- ' $indent$name.fromRef(${jni}JObject ref) : super.fromRef(ref);\n'
+ ' $indent$name.fromRef($jobjectType ref) : super.fromRef(ref);\n'
'\n');
s.write(dartStaticTypeGetter(decl));
for (var field in decl.fields) {
diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart
index 664d66b..1d0581e 100644
--- a/pkgs/jnigen/lib/src/elements/elements.dart
+++ b/pkgs/jnigen/lib/src/elements/elements.dart
@@ -26,7 +26,7 @@
@JsonSerializable(explicitToJson: true)
class ClassDecl {
- /// Methods & properties already defined by dart JniObject base class.
+ /// Methods & properties already defined by dart JObject base class.
static const Map<String, int> _definedSyms = {
'equals': 1,
'toString': 1,
diff --git a/pkgs/jnigen/lib/src/writers/files_writer.dart b/pkgs/jnigen/lib/src/writers/files_writer.dart
index 81af44f..4c552ae 100644
--- a/pkgs/jnigen/lib/src/writers/files_writer.dart
+++ b/pkgs/jnigen/lib/src/writers/files_writer.dart
@@ -30,7 +30,7 @@
);
static const Map<String, String> predefined = {
- 'java.lang.String': 'jni.JniString',
+ 'java.lang.String': 'jni.JString',
};
/// Class corresponding to currently writing file.
diff --git a/pkgs/jnigen/lib/src/writers/single_file_writer.dart b/pkgs/jnigen/lib/src/writers/single_file_writer.dart
index d87b373..81cc036 100644
--- a/pkgs/jnigen/lib/src/writers/single_file_writer.dart
+++ b/pkgs/jnigen/lib/src/writers/single_file_writer.dart
@@ -12,7 +12,7 @@
/// Resolver for single-file mapping of input classes.
class SingleFileResolver implements SymbolResolver {
static const predefined = {
- 'java.lang.String': 'jni.JniString',
+ 'java.lang.String': 'jni.JString',
};
Map<String, ClassDecl> inputClasses;
SingleFileResolver(this.inputClasses);
diff --git a/pkgs/jnigen/test/bindings_test.dart b/pkgs/jnigen/test/bindings_test.dart
index eb1ec8f..bb6ce11 100644
--- a/pkgs/jnigen/test/bindings_test.dart
+++ b/pkgs/jnigen/test/bindings_test.dart
@@ -106,7 +106,7 @@
final ex2 = Example();
ex1.setInternal(1);
ex2.setInternal(2);
- final array = JniArray(Example.type, 2);
+ final array = JArray(Example.type, 2);
array[0] = ex1;
array[1] = ex2;
print(array[0].getInternal());
@@ -123,7 +123,7 @@
});
test('simple json parsing test', () {
- final json = JniString.fromString('[1, true, false, 2, 4]');
+ final json = JString.fromString('[1, true, false, 2, 4]');
JsonFactory factory;
factory = JsonFactory();
final parser = factory.createParser6(json);
@@ -141,7 +141,7 @@
using((arena) {
final factory = JsonFactory()..deletedIn(arena);
final erroneous = factory
- .createParser6("<html>".jniString()..deletedIn(arena))
+ .createParser6("<html>".toJString()..deletedIn(arena))
..deletedIn(arena);
expect(() => erroneous.nextToken(), throwsA(isA<JniException>()));
});
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart
index dff4205..eac4b95 100644
--- a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart
+++ b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart
@@ -56,13 +56,13 @@
/// the default constructor is used for constructing factory
/// instances.
///@author Tatu Saloranta
-class JsonFactory extends jni.JniObject {
+class JsonFactory extends jni.JObject {
static final _classRef =
jniAccessors.getClassOf("com/fasterxml/jackson/core/JsonFactory");
- JsonFactory.fromRef(jni.JObject ref) : super.fromRef(ref);
+ JsonFactory.fromRef(jni.JObjectPtr ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<JsonFactory> type = _$JsonFactoryType();
+ static const jni.JType<JsonFactory> type = _$JsonFactoryType();
/// from: static public final java.lang.String FORMAT_NAME_JSON
///
@@ -111,8 +111,8 @@
/// from: static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniObject get DEFAULT_ROOT_VALUE_SEPARATOR =>
- jni.JniObject.fromRef(jniAccessors
+ static jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR =>
+ jni.JObject.fromRef(jniAccessors
.getStaticField(_classRef, _id_DEFAULT_ROOT_VALUE_SEPARATOR,
jni.JniCallType.objectType)
.object);
@@ -140,7 +140,7 @@
/// from: public void <init>(com.fasterxml.jackson.core.ObjectCodec oc)
/// The returned object must be deleted after use, by calling the `delete` method.
- JsonFactory.ctor1(jni.JniObject oc)
+ JsonFactory.ctor1(jni.JObject oc)
: super.fromRef(jniAccessors
.newObjectWithArgs(_classRef, _id_ctor1, [oc.reference]).object);
@@ -154,7 +154,7 @@
///@param src Original factory to copy settings from
///@param codec Databinding-level codec to use, if any
///@since 2.2.1
- JsonFactory.ctor2(JsonFactory src, jni.JniObject codec)
+ JsonFactory.ctor2(JsonFactory src, jni.JObject codec)
: super.fromRef(jniAccessors.newObjectWithArgs(
_classRef, _id_ctor2, [src.reference, codec.reference]).object);
@@ -167,7 +167,7 @@
/// Constructor used by JsonFactoryBuilder for instantiation.
///@param b Builder that contains settings to use
///@since 2.10
- JsonFactory.ctor3(jni.JniObject b)
+ JsonFactory.ctor3(jni.JObject b)
: super.fromRef(jniAccessors
.newObjectWithArgs(_classRef, _id_ctor3, [b.reference]).object);
@@ -182,7 +182,7 @@
/// implementation for json.
///@param b Builder that contains settings to use
///@param bogus Argument only needed to separate constructor signature; ignored
- JsonFactory.ctor4(jni.JniObject b, bool bogus)
+ JsonFactory.ctor4(jni.JObject b, bool bogus)
: super.fromRef(jniAccessors.newObjectWithArgs(
_classRef, _id_ctor4, [b.reference, bogus]).object);
@@ -196,9 +196,8 @@
/// with settings of this factory.
///@return Builder instance to use
///@since 2.10
- jni.JniObject rebuild() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_rebuild, jni.JniCallType.objectType, []).object);
+ jni.JObject rebuild() => jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_rebuild, jni.JniCallType.objectType, []).object);
static final _id_builder = jniAccessors.getStaticMethodIDOf(
_classRef, "builder", "()Lcom/fasterxml/jackson/core/TSFBuilder;");
@@ -214,8 +213,8 @@
/// NOTE: signature unfortunately does not expose true implementation type; this
/// will be fixed in 3.0.
///@return Builder instance to use
- static jni.JniObject builder() =>
- jni.JniObject.fromRef(jniAccessors.callStaticMethodWithArgs(
+ static jni.JObject builder() =>
+ jni.JObject.fromRef(jniAccessors.callStaticMethodWithArgs(
_classRef, _id_builder, jni.JniCallType.objectType, []).object);
static final _id_copy = jniAccessors.getMethodIDOf(
@@ -251,8 +250,8 @@
///
/// Note: must be overridden by sub-classes as well.
///@return Newly constructed instance
- jni.JniObject readResolve() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject readResolve() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_readResolve, jni.JniCallType.objectType, []).object);
static final _id_requiresPropertyOrdering =
@@ -335,8 +334,8 @@
/// from: public java.lang.Class<? extends com.fasterxml.jackson.core.FormatFeature> getFormatReadFeatureType()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject getFormatReadFeatureType() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getFormatReadFeatureType() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getFormatReadFeatureType, jni.JniCallType.objectType, []).object);
static final _id_getFormatWriteFeatureType = jniAccessors.getMethodIDOf(
@@ -344,8 +343,8 @@
/// from: public java.lang.Class<? extends com.fasterxml.jackson.core.FormatFeature> getFormatWriteFeatureType()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject getFormatWriteFeatureType() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject getFormatWriteFeatureType() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_getFormatWriteFeatureType,
jni.JniCallType.objectType, []).object);
@@ -364,7 +363,7 @@
///@param schema Schema instance to check
///@return Whether parsers and generators constructed by this factory
/// can use specified format schema instance
- bool canUseSchema(jni.JniObject schema) => jniAccessors.callMethodWithArgs(
+ bool canUseSchema(jni.JObject schema) => jniAccessors.callMethodWithArgs(
reference,
_id_canUseSchema,
jni.JniCallType.booleanType,
@@ -382,8 +381,8 @@
/// Note: sub-classes should override this method; default
/// implementation will return null for all sub-classes
///@return Name of the format handled by parsers, generators this factory creates
- jni.JniString getFormatName() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JString getFormatName() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_getFormatName, jni.JniCallType.objectType, []).object);
static final _id_hasFormat = jniAccessors.getMethodIDOf(
@@ -393,8 +392,8 @@
/// from: public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject hasFormat(jni.JniObject acc) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject hasFormat(jni.JObject acc) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_hasFormat, jni.JniCallType.objectType, [acc.reference]).object);
static final _id_requiresCustomCodec =
@@ -421,8 +420,8 @@
/// from: protected com.fasterxml.jackson.core.format.MatchStrength hasJSONFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject hasJSONFormat(jni.JniObject acc) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject hasJSONFormat(jni.JObject acc) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_hasJSONFormat,
jni.JniCallType.objectType,
@@ -433,9 +432,8 @@
/// from: public com.fasterxml.jackson.core.Version version()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject version() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_version, jni.JniCallType.objectType, []).object);
+ jni.JObject version() => jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_version, jni.JniCallType.objectType, []).object);
static final _id_configure = jniAccessors.getMethodIDOf(
_classRef,
@@ -599,7 +597,7 @@
///@param f Feature to check
///@return True if specified feature is enabled
///@since 2.10
- bool isEnabled2(jni.JniObject f) => jniAccessors.callMethodWithArgs(reference,
+ bool isEnabled2(jni.JObject f) => jniAccessors.callMethodWithArgs(reference,
_id_isEnabled2, jni.JniCallType.booleanType, [f.reference]).boolean;
static final _id_getInputDecorator = jniAccessors.getMethodIDOf(_classRef,
@@ -611,8 +609,8 @@
/// Method for getting currently configured input decorator (if any;
/// there is no default decorator).
///@return InputDecorator configured, if any
- jni.JniObject getInputDecorator() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getInputDecorator() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getInputDecorator, jni.JniCallType.objectType, []).object);
static final _id_setInputDecorator = jniAccessors.getMethodIDOf(
@@ -627,7 +625,7 @@
///@param d Decorator to configure for this factory, if any ({@code null} if none)
///@return This factory instance (to allow call chaining)
///@deprecated Since 2.10 use JsonFactoryBuilder\#inputDecorator(InputDecorator) instead
- JsonFactory setInputDecorator(jni.JniObject d) =>
+ JsonFactory setInputDecorator(jni.JObject d) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_setInputDecorator,
@@ -647,7 +645,7 @@
///@param f Feature to enable/disable
///@param state Whether to enable or disable the feature
///@return This factory instance (to allow call chaining)
- JsonFactory configure2(jni.JniObject f, bool state) =>
+ JsonFactory configure2(jni.JObject f, bool state) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_configure2,
@@ -664,7 +662,7 @@
/// (check JsonGenerator.Feature for list of features)
///@param f Feature to enable
///@return This factory instance (to allow call chaining)
- JsonFactory enable2(jni.JniObject f) =>
+ JsonFactory enable2(jni.JObject f) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_enable2, jni.JniCallType.objectType, [f.reference]).object);
@@ -678,7 +676,7 @@
/// (check JsonGenerator.Feature for list of features)
///@param f Feature to disable
///@return This factory instance (to allow call chaining)
- JsonFactory disable2(jni.JniObject f) =>
+ JsonFactory disable2(jni.JObject f) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_disable2, jni.JniCallType.objectType, [f.reference]).object);
@@ -690,7 +688,7 @@
/// Check whether specified generator feature is enabled.
///@param f Feature to check
///@return Whether specified feature is enabled
- bool isEnabled3(jni.JniObject f) => jniAccessors.callMethodWithArgs(reference,
+ bool isEnabled3(jni.JObject f) => jniAccessors.callMethodWithArgs(reference,
_id_isEnabled3, jni.JniCallType.booleanType, [f.reference]).boolean;
static final _id_isEnabled4 = jniAccessors.getMethodIDOf(_classRef,
@@ -702,7 +700,7 @@
///@param f Feature to check
///@return Whether specified feature is enabled
///@since 2.10
- bool isEnabled4(jni.JniObject f) => jniAccessors.callMethodWithArgs(reference,
+ bool isEnabled4(jni.JObject f) => jniAccessors.callMethodWithArgs(reference,
_id_isEnabled4, jni.JniCallType.booleanType, [f.reference]).boolean;
static final _id_getCharacterEscapes = jniAccessors.getMethodIDOf(
@@ -716,8 +714,8 @@
/// Method for accessing custom escapes factory uses for JsonGenerators
/// it creates.
///@return Configured {@code CharacterEscapes}, if any; {@code null} if none
- jni.JniObject getCharacterEscapes() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getCharacterEscapes() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getCharacterEscapes, jni.JniCallType.objectType, []).object);
static final _id_setCharacterEscapes = jniAccessors.getMethodIDOf(
@@ -732,7 +730,7 @@
/// it creates.
///@param esc CharaterEscapes to set (or {@code null} for "none")
///@return This factory instance (to allow call chaining)
- JsonFactory setCharacterEscapes(jni.JniObject esc) =>
+ JsonFactory setCharacterEscapes(jni.JObject esc) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_setCharacterEscapes,
@@ -751,8 +749,8 @@
/// there is no default decorator).
///@return OutputDecorator configured for generators factory creates, if any;
/// {@code null} if none.
- jni.JniObject getOutputDecorator() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getOutputDecorator() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getOutputDecorator, jni.JniCallType.objectType, []).object);
static final _id_setOutputDecorator = jniAccessors.getMethodIDOf(
@@ -767,7 +765,7 @@
///@return This factory instance (to allow call chaining)
///@param d Output decorator to use, if any
///@deprecated Since 2.10 use JsonFactoryBuilder\#outputDecorator(OutputDecorator) instead
- JsonFactory setOutputDecorator(jni.JniObject d) =>
+ JsonFactory setOutputDecorator(jni.JObject d) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_setOutputDecorator,
@@ -787,7 +785,7 @@
///@param sep Separator to use, if any; null means that no separator is
/// automatically added
///@return This factory instance (to allow call chaining)
- JsonFactory setRootValueSeparator(jni.JniString sep) =>
+ JsonFactory setRootValueSeparator(jni.JString sep) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_setRootValueSeparator,
@@ -801,8 +799,8 @@
/// The returned object must be deleted after use, by calling the `delete` method.
///
/// @return Root value separator configured, if any
- jni.JniString getRootValueSeparator() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JString getRootValueSeparator() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getRootValueSeparator, jni.JniCallType.objectType, []).object);
static final _id_setCodec = jniAccessors.getMethodIDOf(_classRef, "setCodec",
@@ -818,7 +816,7 @@
/// of JsonParser and JsonGenerator instances.
///@param oc Codec to use
///@return This factory instance (to allow call chaining)
- JsonFactory setCodec(jni.JniObject oc) =>
+ JsonFactory setCodec(jni.JObject oc) =>
JsonFactory.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_setCodec, jni.JniCallType.objectType, [oc.reference]).object);
@@ -827,9 +825,8 @@
/// from: public com.fasterxml.jackson.core.ObjectCodec getCodec()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniObject getCodec() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_getCodec, jni.JniCallType.objectType, []).object);
+ jni.JObject getCodec() => jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_getCodec, jni.JniCallType.objectType, []).object);
static final _id_createParser = jniAccessors.getMethodIDOf(
_classRef,
@@ -855,7 +852,7 @@
/// the parser, since caller has no access to it.
///@param f File that contains JSON content to parse
///@since 2.1
- jsonparser_.JsonParser createParser(jni.JniObject f) =>
+ jsonparser_.JsonParser createParser(jni.JObject f) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_createParser, jni.JniCallType.objectType, [f.reference]).object);
@@ -881,7 +878,7 @@
/// the parser, since caller has no access to it.
///@param url URL pointing to resource that contains JSON content to parse
///@since 2.1
- jsonparser_.JsonParser createParser1(jni.JniObject url) =>
+ jsonparser_.JsonParser createParser1(jni.JObject url) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser1,
@@ -913,7 +910,7 @@
/// For other charsets use \#createParser(java.io.Reader).
///@param in InputStream to use for reading JSON content to parse
///@since 2.1
- jsonparser_.JsonParser createParser2(jni.JniObject in0) =>
+ jsonparser_.JsonParser createParser2(jni.JObject in0) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser2,
@@ -938,7 +935,7 @@
/// is enabled.
///@param r Reader to use for reading JSON content to parse
///@since 2.1
- jsonparser_.JsonParser createParser3(jni.JniObject r) =>
+ jsonparser_.JsonParser createParser3(jni.JObject r) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_createParser3, jni.JniCallType.objectType, [r.reference]).object);
@@ -951,7 +948,7 @@
/// Method for constructing parser for parsing
/// the contents of given byte array.
///@since 2.1
- jsonparser_.JsonParser createParser4(jni.JniArray<jni.JByte> data) =>
+ jsonparser_.JsonParser createParser4(jni.JArray<jni.JByte> data) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser4,
@@ -971,7 +968,7 @@
///@param len Length of contents to parse within buffer
///@since 2.1
jsonparser_.JsonParser createParser5(
- jni.JniArray<jni.JByte> data, int offset, int len) =>
+ jni.JArray<jni.JByte> data, int offset, int len) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser5,
@@ -989,7 +986,7 @@
/// Method for constructing parser for parsing
/// contents of given String.
///@since 2.1
- jsonparser_.JsonParser createParser6(jni.JniString content) =>
+ jsonparser_.JsonParser createParser6(jni.JString content) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser6,
@@ -1005,7 +1002,7 @@
/// Method for constructing parser for parsing
/// contents of given char array.
///@since 2.4
- jsonparser_.JsonParser createParser7(jni.JniArray<jni.JChar> content) =>
+ jsonparser_.JsonParser createParser7(jni.JArray<jni.JChar> content) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser7,
@@ -1021,7 +1018,7 @@
/// Method for constructing parser for parsing contents of given char array.
///@since 2.4
jsonparser_.JsonParser createParser8(
- jni.JniArray<jni.JChar> content, int offset, int len) =>
+ jni.JArray<jni.JChar> content, int offset, int len) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser8,
@@ -1042,7 +1039,7 @@
/// If this factory does not support DataInput as source,
/// will throw UnsupportedOperationException
///@since 2.8
- jsonparser_.JsonParser createParser9(jni.JniObject in0) =>
+ jsonparser_.JsonParser createParser9(jni.JObject in0) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createParser9,
@@ -1101,8 +1098,8 @@
///@param out OutputStream to use for writing JSON content
///@param enc Character encoding to use
///@since 2.1
- jni.JniObject createGenerator(jni.JniObject out, jni.JniObject enc) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createGenerator(jni.JObject out, jni.JObject enc) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createGenerator,
jni.JniCallType.objectType,
@@ -1121,8 +1118,8 @@
///
/// Note: there are formats that use fixed encoding (like most binary data formats).
///@since 2.1
- jni.JniObject createGenerator1(jni.JniObject out) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createGenerator1(jni.JObject out) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createGenerator1,
jni.JniCallType.objectType,
@@ -1147,8 +1144,8 @@
/// Using application needs to close it explicitly.
///@since 2.1
///@param w Writer to use for writing JSON content
- jni.JniObject createGenerator2(jni.JniObject w) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createGenerator2(jni.JObject w) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createGenerator2,
jni.JniCallType.objectType,
@@ -1174,8 +1171,8 @@
///@param f File to write contents to
///@param enc Character encoding to use
///@since 2.1
- jni.JniObject createGenerator3(jni.JniObject f, jni.JniObject enc) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createGenerator3(jni.JObject f, jni.JObject enc) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createGenerator3,
jni.JniCallType.objectType,
@@ -1192,8 +1189,8 @@
/// Method for constructing generator for writing content using specified
/// DataOutput instance.
///@since 2.8
- jni.JniObject createGenerator4(jni.JniObject out, jni.JniObject enc) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createGenerator4(jni.JObject out, jni.JObject enc) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createGenerator4,
jni.JniCallType.objectType,
@@ -1212,8 +1209,8 @@
///
/// Note: there are formats that use fixed encoding (like most binary data formats).
///@since 2.8
- jni.JniObject createGenerator5(jni.JniObject out) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createGenerator5(jni.JObject out) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createGenerator5,
jni.JniCallType.objectType,
@@ -1245,7 +1242,7 @@
///@throws IOException if parser initialization fails due to I/O (read) problem
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(File) instead.
- jsonparser_.JsonParser createJsonParser(jni.JniObject f) =>
+ jsonparser_.JsonParser createJsonParser(jni.JObject f) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser,
@@ -1277,7 +1274,7 @@
///@throws IOException if parser initialization fails due to I/O (read) problem
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(URL) instead.
- jsonparser_.JsonParser createJsonParser1(jni.JniObject url) =>
+ jsonparser_.JsonParser createJsonParser1(jni.JObject url) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser1,
@@ -1312,7 +1309,7 @@
///@throws IOException if parser initialization fails due to I/O (read) problem
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(InputStream) instead.
- jsonparser_.JsonParser createJsonParser2(jni.JniObject in0) =>
+ jsonparser_.JsonParser createJsonParser2(jni.JObject in0) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser2,
@@ -1340,7 +1337,7 @@
///@throws IOException if parser initialization fails due to I/O (read) problem
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(Reader) instead.
- jsonparser_.JsonParser createJsonParser3(jni.JniObject r) =>
+ jsonparser_.JsonParser createJsonParser3(jni.JObject r) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser3,
@@ -1359,7 +1356,7 @@
///@throws IOException if parser initialization fails due to I/O (read) problem
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(byte[]) instead.
- jsonparser_.JsonParser createJsonParser4(jni.JniArray<jni.JByte> data) =>
+ jsonparser_.JsonParser createJsonParser4(jni.JArray<jni.JByte> data) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser4,
@@ -1382,7 +1379,7 @@
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(byte[],int,int) instead.
jsonparser_.JsonParser createJsonParser5(
- jni.JniArray<jni.JByte> data, int offset, int len) =>
+ jni.JArray<jni.JByte> data, int offset, int len) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser5,
@@ -1404,7 +1401,7 @@
///@throws IOException if parser initialization fails due to I/O (read) problem
///@throws JsonParseException if parser initialization fails due to content decoding problem
///@deprecated Since 2.2, use \#createParser(String) instead.
- jsonparser_.JsonParser createJsonParser6(jni.JniString content) =>
+ jsonparser_.JsonParser createJsonParser6(jni.JString content) =>
jsonparser_.JsonParser.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonParser6,
@@ -1439,8 +1436,8 @@
///@return Generator constructed
///@throws IOException if parser initialization fails due to I/O (write) problem
///@deprecated Since 2.2, use \#createGenerator(OutputStream, JsonEncoding) instead.
- jni.JniObject createJsonGenerator(jni.JniObject out, jni.JniObject enc) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createJsonGenerator(jni.JObject out, jni.JObject enc) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonGenerator,
jni.JniCallType.objectType,
@@ -1467,8 +1464,8 @@
///@return Generator constructed
///@throws IOException if parser initialization fails due to I/O (write) problem
///@deprecated Since 2.2, use \#createGenerator(Writer) instead.
- jni.JniObject createJsonGenerator1(jni.JniObject out) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createJsonGenerator1(jni.JObject out) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonGenerator1,
jni.JniCallType.objectType,
@@ -1490,29 +1487,29 @@
///@return Generator constructed
///@throws IOException if parser initialization fails due to I/O (write) problem
///@deprecated Since 2.2, use \#createGenerator(OutputStream) instead.
- jni.JniObject createJsonGenerator2(jni.JniObject out) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject createJsonGenerator2(jni.JObject out) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_createJsonGenerator2,
jni.JniCallType.objectType,
[out.reference]).object);
}
-class _$JsonFactoryType extends jni.JniType<JsonFactory> {
+class _$JsonFactoryType extends jni.JType<JsonFactory> {
const _$JsonFactoryType();
@override
String get signature => r"Lcom/fasterxml/jackson/core/JsonFactory;";
}
-extension $JsonFactoryJniArray on jni.JniArray<JsonFactory> {
+extension $JsonFactoryArray on jni.JArray<JsonFactory> {
JsonFactory operator [](int index) {
return JsonFactory.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, JsonFactory value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
@@ -1520,21 +1517,21 @@
///
/// Enumeration that defines all on/off features that can only be
/// changed for JsonFactory.
-class JsonFactory_Feature extends jni.JniObject {
+class JsonFactory_Feature extends jni.JObject {
static final _classRef = jniAccessors
.getClassOf("com/fasterxml/jackson/core/JsonFactory\$Feature");
- JsonFactory_Feature.fromRef(jni.JObject ref) : super.fromRef(ref);
+ JsonFactory_Feature.fromRef(jni.JObjectPtr ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<JsonFactory_Feature> type =
+ static const jni.JType<JsonFactory_Feature> type =
_$JsonFactory_FeatureType();
static final _id_values = jniAccessors.getStaticMethodIDOf(_classRef,
"values", "()[Lcom/fasterxml/jackson/core/JsonFactory\$Feature;");
/// from: static public com.fasterxml.jackson.core.JsonFactory.Feature[] values()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<JsonFactory_Feature> values() =>
- jni.JniArray<JsonFactory_Feature>.fromRef(jniAccessors
+ static jni.JArray<JsonFactory_Feature> values() =>
+ jni.JArray<JsonFactory_Feature>.fromRef(jniAccessors
.callStaticMethodWithArgs(
_classRef, _id_values, jni.JniCallType.objectType, []).object);
@@ -1545,7 +1542,7 @@
/// from: static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name)
/// The returned object must be deleted after use, by calling the `delete` method.
- static JsonFactory_Feature valueOf(jni.JniString name) =>
+ static JsonFactory_Feature valueOf(jni.JString name) =>
JsonFactory_Feature.fromRef(jniAccessors.callStaticMethodWithArgs(
_classRef,
_id_valueOf,
@@ -1585,20 +1582,20 @@
reference, _id_getMask, jni.JniCallType.intType, []).integer;
}
-class _$JsonFactory_FeatureType extends jni.JniType<JsonFactory_Feature> {
+class _$JsonFactory_FeatureType extends jni.JType<JsonFactory_Feature> {
const _$JsonFactory_FeatureType();
@override
String get signature => r"Lcom/fasterxml/jackson/core/JsonFactory$Feature;";
}
-extension $JsonFactory_FeatureJniArray on jni.JniArray<JsonFactory_Feature> {
+extension $JsonFactory_FeatureArray on jni.JArray<JsonFactory_Feature> {
JsonFactory_Feature operator [](int index) {
return JsonFactory_Feature.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, JsonFactory_Feature value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart
index 64867c7..9495814 100644
--- a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart
+++ b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart
@@ -43,13 +43,13 @@
/// Instances are created using factory methods of
/// a JsonFactory instance.
///@author Tatu Saloranta
-class JsonParser extends jni.JniObject {
+class JsonParser extends jni.JObject {
static final _classRef =
jniAccessors.getClassOf("com/fasterxml/jackson/core/JsonParser");
- JsonParser.fromRef(jni.JObject ref) : super.fromRef(ref);
+ JsonParser.fromRef(jni.JObjectPtr ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<JsonParser> type = _$JsonParserType();
+ static const jni.JType<JsonParser> type = _$JsonParserType();
static final _id_DEFAULT_READ_CAPABILITIES = jniAccessors.getStaticFieldIDOf(
_classRef,
"DEFAULT_READ_CAPABILITIES",
@@ -62,8 +62,8 @@
/// basis for format-specific readers (or as bogus instance if non-null
/// set needs to be passed).
///@since 2.12
- static jni.JniObject get DEFAULT_READ_CAPABILITIES =>
- jni.JniObject.fromRef(jniAccessors
+ static jni.JObject get DEFAULT_READ_CAPABILITIES =>
+ jni.JObject.fromRef(jniAccessors
.getStaticField(_classRef, _id_DEFAULT_READ_CAPABILITIES,
jni.JniCallType.objectType)
.object);
@@ -96,9 +96,8 @@
/// parser, if any. Codec is used by \#readValueAs(Class)
/// method (and its variants).
///@return Codec assigned to this parser, if any; {@code null} if none
- jni.JniObject getCodec() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_getCodec, jni.JniCallType.objectType, []).object);
+ jni.JObject getCodec() => jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_getCodec, jni.JniCallType.objectType, []).object);
static final _id_setCodec = jniAccessors.getMethodIDOf(
_classRef, "setCodec", "(Lcom/fasterxml/jackson/core/ObjectCodec;)V");
@@ -109,7 +108,7 @@
/// parser, if any. Codec is used by \#readValueAs(Class)
/// method (and its variants).
///@param oc Codec to assign, if any; {@code null} if none
- void setCodec(jni.JniObject oc) => jniAccessors.callMethodWithArgs(reference,
+ void setCodec(jni.JObject oc) => jniAccessors.callMethodWithArgs(reference,
_id_setCodec, jni.JniCallType.voidType, [oc.reference]).check();
static final _id_getInputSource = jniAccessors.getMethodIDOf(
@@ -132,8 +131,8 @@
/// In general use of this accessor should be considered as
/// "last effort", i.e. only used if no other mechanism is applicable.
///@return Input source this parser was configured with
- jni.JniObject getInputSource() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getInputSource() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getInputSource, jni.JniCallType.objectType, []).object);
static final _id_setRequestPayloadOnError = jniAccessors.getMethodIDOf(
@@ -146,7 +145,7 @@
/// Sets the payload to be passed if JsonParseException is thrown.
///@param payload Payload to pass
///@since 2.8
- void setRequestPayloadOnError(jni.JniObject payload) =>
+ void setRequestPayloadOnError(jni.JObject payload) =>
jniAccessors.callMethodWithArgs(reference, _id_setRequestPayloadOnError,
jni.JniCallType.voidType, [payload.reference]).check();
@@ -160,7 +159,7 @@
///@param charset Character encoding for (lazily) decoding payload
///@since 2.8
void setRequestPayloadOnError1(
- jni.JniArray<jni.JByte> payload, jni.JniString charset) =>
+ jni.JArray<jni.JByte> payload, jni.JString charset) =>
jniAccessors.callMethodWithArgs(
reference,
_id_setRequestPayloadOnError1,
@@ -175,7 +174,7 @@
/// Sets the String request payload
///@param payload Payload to pass
///@since 2.8
- void setRequestPayloadOnError2(jni.JniString payload) =>
+ void setRequestPayloadOnError2(jni.JString payload) =>
jniAccessors.callMethodWithArgs(reference, _id_setRequestPayloadOnError2,
jni.JniCallType.voidType, [payload.reference]).check();
@@ -194,7 +193,7 @@
/// is thrown.
///@param schema Schema to use
///@throws UnsupportedOperationException if parser does not support schema
- void setSchema(jni.JniObject schema) => jniAccessors.callMethodWithArgs(
+ void setSchema(jni.JObject schema) => jniAccessors.callMethodWithArgs(
reference,
_id_setSchema,
jni.JniCallType.voidType,
@@ -210,8 +209,8 @@
/// Default implementation returns null.
///@return Schema in use by this parser, if any; {@code null} if none
///@since 2.1
- jni.JniObject getSchema() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject getSchema() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_getSchema, jni.JniCallType.objectType, []).object);
static final _id_canUseSchema = jniAccessors.getMethodIDOf(_classRef,
@@ -223,7 +222,7 @@
/// this parser (using \#setSchema).
///@param schema Schema to check
///@return True if this parser can use given schema; false if not
- bool canUseSchema(jni.JniObject schema) => jniAccessors.callMethodWithArgs(
+ bool canUseSchema(jni.JObject schema) => jniAccessors.callMethodWithArgs(
reference,
_id_canUseSchema,
jni.JniCallType.booleanType,
@@ -277,8 +276,8 @@
/// parsers that use blocking I/O.
///@return Input feeder to use with non-blocking (async) parsing
///@since 2.9
- jni.JniObject getNonBlockingInputFeeder() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject getNonBlockingInputFeeder() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_getNonBlockingInputFeeder,
jni.JniCallType.objectType, []).object);
@@ -295,8 +294,8 @@
/// underlying data format being read (directly or indirectly).
///@return Set of read capabilities for content to read via this parser
///@since 2.12
- jni.JniObject getReadCapabilities() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getReadCapabilities() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getReadCapabilities, jni.JniCallType.objectType, []).object);
static final _id_version = jniAccessors.getMethodIDOf(
@@ -309,9 +308,8 @@
/// Left for sub-classes to implement.
///@return Version of this generator (derived from version declared for
/// {@code jackson-core} jar that contains the class
- jni.JniObject version() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_version, jni.JniCallType.objectType, []).object);
+ jni.JObject version() => jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_version, jni.JniCallType.objectType, []).object);
static final _id_close =
jniAccessors.getMethodIDOf(_classRef, "close", "()V");
@@ -365,8 +363,8 @@
/// Contexts can also be used for simple xpath-like matching of
/// input, if so desired.
///@return Stream input context (JsonStreamContext) associated with this parser
- jni.JniObject getParsingContext() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getParsingContext() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getParsingContext, jni.JniCallType.objectType, []).object);
static final _id_currentLocation = jniAccessors.getMethodIDOf(_classRef,
@@ -387,8 +385,8 @@
/// to other library)
///@return Location of the last processed input unit (byte or character)
///@since 2.13
- jni.JniObject currentLocation() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject currentLocation() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_currentLocation, jni.JniCallType.objectType, []).object);
static final _id_currentTokenLocation = jniAccessors.getMethodIDOf(_classRef,
@@ -409,8 +407,8 @@
/// to other library)
///@return Starting location of the token parser currently points to
///@since 2.13 (will eventually replace \#getTokenLocation)
- jni.JniObject currentTokenLocation() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject currentTokenLocation() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_currentTokenLocation, jni.JniCallType.objectType, []).object);
static final _id_getCurrentLocation = jniAccessors.getMethodIDOf(_classRef,
@@ -422,8 +420,8 @@
/// Alias for \#currentLocation(), to be deprecated in later
/// Jackson 2.x versions (and removed from Jackson 3.0).
///@return Location of the last processed input unit (byte or character)
- jni.JniObject getCurrentLocation() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getCurrentLocation() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getCurrentLocation, jni.JniCallType.objectType, []).object);
static final _id_getTokenLocation = jniAccessors.getMethodIDOf(_classRef,
@@ -435,8 +433,8 @@
/// Alias for \#currentTokenLocation(), to be deprecated in later
/// Jackson 2.x versions (and removed from Jackson 3.0).
///@return Starting location of the token parser currently points to
- jni.JniObject getTokenLocation() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getTokenLocation() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getTokenLocation, jni.JniCallType.objectType, []).object);
static final _id_currentValue = jniAccessors.getMethodIDOf(
@@ -456,8 +454,8 @@
/// and gets passed through data-binding.
///@return "Current value" associated with the current input context (state) of this parser
///@since 2.13 (added as replacement for older \#getCurrentValue()
- jni.JniObject currentValue() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject currentValue() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_currentValue, jni.JniCallType.objectType, []).object);
static final _id_assignCurrentValue = jniAccessors.getMethodIDOf(
@@ -471,7 +469,7 @@
///</code>
///@param v Current value to assign for the current input context of this parser
///@since 2.13 (added as replacement for older \#setCurrentValue
- void assignCurrentValue(jni.JniObject v) => jniAccessors.callMethodWithArgs(
+ void assignCurrentValue(jni.JObject v) => jniAccessors.callMethodWithArgs(
reference,
_id_assignCurrentValue,
jni.JniCallType.voidType,
@@ -486,8 +484,8 @@
/// Alias for \#currentValue(), to be deprecated in later
/// Jackson 2.x versions (and removed from Jackson 3.0).
///@return Location of the last processed input unit (byte or character)
- jni.JniObject getCurrentValue() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getCurrentValue() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getCurrentValue, jni.JniCallType.objectType, []).object);
static final _id_setCurrentValue = jniAccessors.getMethodIDOf(
@@ -498,7 +496,7 @@
/// Alias for \#assignCurrentValue, to be deprecated in later
/// Jackson 2.x versions (and removed from Jackson 3.0).
///@param v Current value to assign for the current input context of this parser
- void setCurrentValue(jni.JniObject v) => jniAccessors.callMethodWithArgs(
+ void setCurrentValue(jni.JObject v) => jniAccessors.callMethodWithArgs(
reference,
_id_setCurrentValue,
jni.JniCallType.voidType,
@@ -520,7 +518,7 @@
/// (that is, input can not be sent to OutputStream;
/// otherwise number of bytes released (0 if there was nothing to release)
///@throws IOException if write to stream threw exception
- int releaseBuffered(jni.JniObject out) => jniAccessors.callMethodWithArgs(
+ int releaseBuffered(jni.JObject out) => jniAccessors.callMethodWithArgs(
reference,
_id_releaseBuffered,
jni.JniCallType.intType,
@@ -543,7 +541,7 @@
/// (that is, input can not be sent to Writer;
/// otherwise number of chars released (0 if there was nothing to release)
///@throws IOException if write using Writer threw exception
- int releaseBuffered1(jni.JniObject w) => jniAccessors.callMethodWithArgs(
+ int releaseBuffered1(jni.JObject w) => jniAccessors.callMethodWithArgs(
reference,
_id_releaseBuffered1,
jni.JniCallType.intType,
@@ -620,7 +618,7 @@
///@param f Feature to check
///@return {@code True} if feature is enabled; {@code false} otherwise
///@since 2.10
- bool isEnabled1(jni.JniObject f) => jniAccessors.callMethodWithArgs(reference,
+ bool isEnabled1(jni.JObject f) => jniAccessors.callMethodWithArgs(reference,
_id_isEnabled1, jni.JniCallType.booleanType, [f.reference]).boolean;
static final _id_getFeatureMask =
@@ -775,7 +773,7 @@
/// specified name; {@code false} otherwise (different token or non-matching name)
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- bool nextFieldName(jni.JniObject str) => jniAccessors.callMethodWithArgs(
+ bool nextFieldName(jni.JObject str) => jniAccessors.callMethodWithArgs(
reference,
_id_nextFieldName,
jni.JniCallType.booleanType,
@@ -795,8 +793,8 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.5
- jni.JniString nextFieldName1() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JString nextFieldName1() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_nextFieldName1, jni.JniCallType.objectType, []).object);
static final _id_nextTextValue = jniAccessors.getMethodIDOf(
@@ -818,8 +816,8 @@
/// to; or {@code null} if next token is of some other type
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniString nextTextValue() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JString nextTextValue() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_nextTextValue, jni.JniCallType.objectType, []).object);
static final _id_nextIntValue =
@@ -900,8 +898,8 @@
/// token parser advanced to; or {@code null} if next token is of some other type
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniObject nextBooleanValue() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject nextBooleanValue() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_nextBooleanValue, jni.JniCallType.objectType, []).object);
static final _id_skipChildren = jniAccessors.getMethodIDOf(
@@ -1194,9 +1192,11 @@
/// Note that use of this method should only be done as sort of last
/// resort, as it is a work-around for regular operation.
///@param name Name to use as the current name; may be null.
- void overrideCurrentName(jni.JniString name) =>
- jniAccessors.callMethodWithArgs(reference, _id_overrideCurrentName,
- jni.JniCallType.voidType, [name.reference]).check();
+ void overrideCurrentName(jni.JString name) => jniAccessors.callMethodWithArgs(
+ reference,
+ _id_overrideCurrentName,
+ jni.JniCallType.voidType,
+ [name.reference]).check();
static final _id_getCurrentName = jniAccessors.getMethodIDOf(
_classRef, "getCurrentName", "()Ljava/lang/String;");
@@ -1208,8 +1208,8 @@
///@return Name of the current field in the parsing context
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniString getCurrentName() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JString getCurrentName() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getCurrentName, jni.JniCallType.objectType, []).object);
static final _id_currentName = jniAccessors.getMethodIDOf(
@@ -1227,8 +1227,8 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.10
- jni.JniString currentName() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JString currentName() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_currentName, jni.JniCallType.objectType, []).object);
static final _id_getText =
@@ -1245,9 +1245,8 @@
/// by \#nextToken() or other iteration methods)
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniString getText() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_getText, jni.JniCallType.objectType, []).object);
+ jni.JString getText() => jni.JString.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_getText, jni.JniCallType.objectType, []).object);
static final _id_getText1 =
jniAccessors.getMethodIDOf(_classRef, "getText", "(Ljava/io/Writer;)I");
@@ -1269,11 +1268,8 @@
/// {@code writer}, or
/// JsonParseException for decoding problems
///@since 2.8
- int getText1(jni.JniObject writer) => jniAccessors.callMethodWithArgs(
- reference,
- _id_getText1,
- jni.JniCallType.intType,
- [writer.reference]).integer;
+ int getText1(jni.JObject writer) => jniAccessors.callMethodWithArgs(reference,
+ _id_getText1, jni.JniCallType.intType, [writer.reference]).integer;
static final _id_getTextCharacters =
jniAccessors.getMethodIDOf(_classRef, "getTextCharacters", "()[C");
@@ -1308,8 +1304,8 @@
/// at offset 0, and not necessarily until the end of buffer)
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniArray<jni.JChar> getTextCharacters() =>
- jni.JniArray<jni.JChar>.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JArray<jni.JChar> getTextCharacters() =>
+ jni.JArray<jni.JChar>.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getTextCharacters, jni.JniCallType.objectType, []).object);
static final _id_getTextLength =
@@ -1380,8 +1376,8 @@
/// the current token is not numeric, or if decoding of the value fails
/// (invalid format for numbers); plain IOException if underlying
/// content read fails (possible if values are extracted lazily)
- jni.JniObject getNumberValue() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getNumberValue() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getNumberValue, jni.JniCallType.objectType, []).object);
static final _id_getNumberValueExact = jniAccessors.getMethodIDOf(
@@ -1404,8 +1400,8 @@
/// (invalid format for numbers); plain IOException if underlying
/// content read fails (possible if values are extracted lazily)
///@since 2.12
- jni.JniObject getNumberValueExact() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getNumberValueExact() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getNumberValueExact, jni.JniCallType.objectType, []).object);
static final _id_getNumberType = jniAccessors.getMethodIDOf(_classRef,
@@ -1540,8 +1536,8 @@
/// otherwise exception thrown
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniObject getBigIntegerValue() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getBigIntegerValue() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getBigIntegerValue, jni.JniCallType.objectType, []).object);
static final _id_getFloatValue =
@@ -1604,8 +1600,8 @@
/// otherwise exception thrown
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniObject getDecimalValue() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getDecimalValue() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getDecimalValue, jni.JniCallType.objectType, []).object);
static final _id_getBooleanValue =
@@ -1647,8 +1643,8 @@
/// for the current token, if any; {@code null otherwise}
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniObject getEmbeddedObject() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JObject getEmbeddedObject() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getEmbeddedObject, jni.JniCallType.objectType, []).object);
static final _id_getBinaryValue = jniAccessors.getMethodIDOf(_classRef,
@@ -1677,8 +1673,8 @@
///@return Decoded binary data
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniArray<jni.JByte> getBinaryValue(jni.JniObject bv) =>
- jni.JniArray<jni.JByte>.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JArray<jni.JByte> getBinaryValue(jni.JObject bv) =>
+ jni.JArray<jni.JByte>.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_getBinaryValue,
jni.JniCallType.objectType,
@@ -1696,8 +1692,8 @@
///@return Decoded binary data
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
- jni.JniArray<jni.JByte> getBinaryValue1() =>
- jni.JniArray<jni.JByte>.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JArray<jni.JByte> getBinaryValue1() =>
+ jni.JArray<jni.JByte>.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getBinaryValue1, jni.JniCallType.objectType, []).object);
static final _id_readBinaryValue = jniAccessors.getMethodIDOf(
@@ -1716,7 +1712,7 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.1
- int readBinaryValue(jni.JniObject out) => jniAccessors.callMethodWithArgs(
+ int readBinaryValue(jni.JObject out) => jniAccessors.callMethodWithArgs(
reference,
_id_readBinaryValue,
jni.JniCallType.intType,
@@ -1737,7 +1733,7 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.1
- int readBinaryValue1(jni.JniObject bv, jni.JniObject out) =>
+ int readBinaryValue1(jni.JObject bv, jni.JObject out) =>
jniAccessors.callMethodWithArgs(reference, _id_readBinaryValue1,
jni.JniCallType.intType, [bv.reference, out.reference]).integer;
@@ -1932,8 +1928,8 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.1
- jni.JniString getValueAsString() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(reference,
+ jni.JString getValueAsString() =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(reference,
_id_getValueAsString, jni.JniCallType.objectType, []).object);
static final _id_getValueAsString1 = jniAccessors.getMethodIDOf(
@@ -1954,8 +1950,8 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.1
- jni.JniString getValueAsString1(jni.JniString def) =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JString getValueAsString1(jni.JString def) =>
+ jni.JString.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_getValueAsString1,
jni.JniCallType.objectType,
@@ -2018,8 +2014,8 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.3
- jni.JniObject getObjectId() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject getObjectId() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_getObjectId, jni.JniCallType.objectType, []).object);
static final _id_getTypeId = jniAccessors.getMethodIDOf(
@@ -2041,8 +2037,8 @@
///@throws IOException for low-level read issues, or
/// JsonParseException for decoding problems
///@since 2.3
- jni.JniObject getTypeId() =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject getTypeId() =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_getTypeId, jni.JniCallType.objectType, []).object);
static final _id_readValuesAs = jniAccessors.getMethodIDOf(
@@ -2059,8 +2055,8 @@
///@return Iterator for reading multiple Java values from content
///@throws IOException if there is either an underlying I/O problem or decoding
/// issue at format layer
- jni.JniObject readValuesAs(jni.JniObject valueType) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject readValuesAs(jni.JObject valueType) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_readValuesAs,
jni.JniCallType.objectType,
@@ -2082,50 +2078,49 @@
///@return Iterator for reading multiple Java values from content
///@throws IOException if there is either an underlying I/O problem or decoding
/// issue at format layer
- jni.JniObject readValuesAs1(jni.JniObject valueTypeRef) =>
- jni.JniObject.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JObject readValuesAs1(jni.JObject valueTypeRef) =>
+ jni.JObject.fromRef(jniAccessors.callMethodWithArgs(
reference,
_id_readValuesAs1,
jni.JniCallType.objectType,
[valueTypeRef.reference]).object);
}
-class _$JsonParserType extends jni.JniType<JsonParser> {
+class _$JsonParserType extends jni.JType<JsonParser> {
const _$JsonParserType();
@override
String get signature => r"Lcom/fasterxml/jackson/core/JsonParser;";
}
-extension $JsonParserJniArray on jni.JniArray<JsonParser> {
+extension $JsonParserArray on jni.JArray<JsonParser> {
JsonParser operator [](int index) {
return JsonParser.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, JsonParser value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
/// from: com.fasterxml.jackson.core.JsonParser$Feature
///
/// Enumeration that defines all on/off features for parsers.
-class JsonParser_Feature extends jni.JniObject {
+class JsonParser_Feature extends jni.JObject {
static final _classRef =
jniAccessors.getClassOf("com/fasterxml/jackson/core/JsonParser\$Feature");
- JsonParser_Feature.fromRef(jni.JObject ref) : super.fromRef(ref);
+ JsonParser_Feature.fromRef(jni.JObjectPtr ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<JsonParser_Feature> type =
- _$JsonParser_FeatureType();
+ static const jni.JType<JsonParser_Feature> type = _$JsonParser_FeatureType();
static final _id_values = jniAccessors.getStaticMethodIDOf(_classRef,
"values", "()[Lcom/fasterxml/jackson/core/JsonParser\$Feature;");
/// from: static public com.fasterxml.jackson.core.JsonParser.Feature[] values()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<JsonParser_Feature> values() =>
- jni.JniArray<JsonParser_Feature>.fromRef(jniAccessors
+ static jni.JArray<JsonParser_Feature> values() =>
+ jni.JArray<JsonParser_Feature>.fromRef(jniAccessors
.callStaticMethodWithArgs(
_classRef, _id_values, jni.JniCallType.objectType, []).object);
@@ -2136,7 +2131,7 @@
/// from: static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name)
/// The returned object must be deleted after use, by calling the `delete` method.
- static JsonParser_Feature valueOf(jni.JniString name) =>
+ static JsonParser_Feature valueOf(jni.JString name) =>
JsonParser_Feature.fromRef(jniAccessors.callStaticMethodWithArgs(
_classRef,
_id_valueOf,
@@ -2176,21 +2171,21 @@
reference, _id_getMask, jni.JniCallType.intType, []).integer;
}
-class _$JsonParser_FeatureType extends jni.JniType<JsonParser_Feature> {
+class _$JsonParser_FeatureType extends jni.JType<JsonParser_Feature> {
const _$JsonParser_FeatureType();
@override
String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$Feature;";
}
-extension $JsonParser_FeatureJniArray on jni.JniArray<JsonParser_Feature> {
+extension $JsonParser_FeatureArray on jni.JArray<JsonParser_Feature> {
JsonParser_Feature operator [](int index) {
return JsonParser_Feature.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, JsonParser_Feature value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
@@ -2198,21 +2193,21 @@
///
/// Enumeration of possible "native" (optimal) types that can be
/// used for numbers.
-class JsonParser_NumberType extends jni.JniObject {
+class JsonParser_NumberType extends jni.JObject {
static final _classRef = jniAccessors
.getClassOf("com/fasterxml/jackson/core/JsonParser\$NumberType");
- JsonParser_NumberType.fromRef(jni.JObject ref) : super.fromRef(ref);
+ JsonParser_NumberType.fromRef(jni.JObjectPtr ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<JsonParser_NumberType> type =
+ static const jni.JType<JsonParser_NumberType> type =
_$JsonParser_NumberTypeType();
static final _id_values = jniAccessors.getStaticMethodIDOf(_classRef,
"values", "()[Lcom/fasterxml/jackson/core/JsonParser\$NumberType;");
/// from: static public com.fasterxml.jackson.core.JsonParser.NumberType[] values()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<JsonParser_NumberType> values() =>
- jni.JniArray<JsonParser_NumberType>.fromRef(jniAccessors
+ static jni.JArray<JsonParser_NumberType> values() =>
+ jni.JArray<JsonParser_NumberType>.fromRef(jniAccessors
.callStaticMethodWithArgs(
_classRef, _id_values, jni.JniCallType.objectType, []).object);
@@ -2223,7 +2218,7 @@
/// from: static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name)
/// The returned object must be deleted after use, by calling the `delete` method.
- static JsonParser_NumberType valueOf(jni.JniString name) =>
+ static JsonParser_NumberType valueOf(jni.JString name) =>
JsonParser_NumberType.fromRef(jniAccessors.callStaticMethodWithArgs(
_classRef,
_id_valueOf,
@@ -2231,21 +2226,20 @@
[name.reference]).object);
}
-class _$JsonParser_NumberTypeType extends jni.JniType<JsonParser_NumberType> {
+class _$JsonParser_NumberTypeType extends jni.JType<JsonParser_NumberType> {
const _$JsonParser_NumberTypeType();
@override
String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$NumberType;";
}
-extension $JsonParser_NumberTypeJniArray
- on jni.JniArray<JsonParser_NumberType> {
+extension $JsonParser_NumberTypeArray on jni.JArray<JsonParser_NumberType> {
JsonParser_NumberType operator [](int index) {
return JsonParser_NumberType.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, JsonParser_NumberType value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart
index 20af2a4..ae6e31c 100644
--- a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart
+++ b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart
@@ -40,20 +40,20 @@
///
/// Enumeration for basic token types used for returning results
/// of parsing JSON content.
-class JsonToken extends jni.JniObject {
+class JsonToken extends jni.JObject {
static final _classRef =
jniAccessors.getClassOf("com/fasterxml/jackson/core/JsonToken");
- JsonToken.fromRef(jni.JObject ref) : super.fromRef(ref);
+ JsonToken.fromRef(jni.JObjectPtr ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<JsonToken> type = _$JsonTokenType();
+ static const jni.JType<JsonToken> type = _$JsonTokenType();
static final _id_values = jniAccessors.getStaticMethodIDOf(
_classRef, "values", "()[Lcom/fasterxml/jackson/core/JsonToken;");
/// from: static public com.fasterxml.jackson.core.JsonToken[] values()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<JsonToken> values() =>
- jni.JniArray<JsonToken>.fromRef(jniAccessors.callStaticMethodWithArgs(
+ static jni.JArray<JsonToken> values() =>
+ jni.JArray<JsonToken>.fromRef(jniAccessors.callStaticMethodWithArgs(
_classRef, _id_values, jni.JniCallType.objectType, []).object);
static final _id_valueOf = jniAccessors.getStaticMethodIDOf(_classRef,
@@ -61,7 +61,7 @@
/// from: static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name)
/// The returned object must be deleted after use, by calling the `delete` method.
- static JsonToken valueOf(jni.JniString name) =>
+ static JsonToken valueOf(jni.JString name) =>
JsonToken.fromRef(jniAccessors.callStaticMethodWithArgs(_classRef,
_id_valueOf, jni.JniCallType.objectType, [name.reference]).object);
@@ -76,17 +76,16 @@
/// from: public final java.lang.String asString()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniString asString() =>
- jni.JniString.fromRef(jniAccessors.callMethodWithArgs(
- reference, _id_asString, jni.JniCallType.objectType, []).object);
+ jni.JString asString() => jni.JString.fromRef(jniAccessors.callMethodWithArgs(
+ reference, _id_asString, jni.JniCallType.objectType, []).object);
static final _id_asCharArray =
jniAccessors.getMethodIDOf(_classRef, "asCharArray", "()[C");
/// from: public final char[] asCharArray()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniArray<jni.JChar> asCharArray() =>
- jni.JniArray<jni.JChar>.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JArray<jni.JChar> asCharArray() =>
+ jni.JArray<jni.JChar>.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_asCharArray, jni.JniCallType.objectType, []).object);
static final _id_asByteArray =
@@ -94,8 +93,8 @@
/// from: public final byte[] asByteArray()
/// The returned object must be deleted after use, by calling the `delete` method.
- jni.JniArray<jni.JByte> asByteArray() =>
- jni.JniArray<jni.JByte>.fromRef(jniAccessors.callMethodWithArgs(
+ jni.JArray<jni.JByte> asByteArray() =>
+ jni.JArray<jni.JByte>.fromRef(jniAccessors.callMethodWithArgs(
reference, _id_asByteArray, jni.JniCallType.objectType, []).object);
static final _id_isNumeric =
@@ -163,20 +162,20 @@
reference, _id_isBoolean, jni.JniCallType.booleanType, []).boolean;
}
-class _$JsonTokenType extends jni.JniType<JsonToken> {
+class _$JsonTokenType extends jni.JType<JsonToken> {
const _$JsonTokenType();
@override
String get signature => r"Lcom/fasterxml/jackson/core/JsonToken;";
}
-extension $JsonTokenJniArray on jni.JniArray<JsonToken> {
+extension $JsonTokenArray on jni.JArray<JsonToken> {
JsonToken operator [](int index) {
return JsonToken.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, JsonToken value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
diff --git a/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart b/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart
index a65c0f4..a668bbc 100644
--- a/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart
+++ b/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart
@@ -25,11 +25,11 @@
ProtectedJniExtensions.initGeneratedLibrary("simple_package");
/// from: com.github.dart_lang.jnigen.simple_package.Example
-class Example extends jni.JniObject {
+class Example extends jni.JObject {
Example.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<Example> type = _$ExampleType();
+ static const jni.JType<Example> type = _$ExampleType();
/// from: static public final int ON
static const ON = 1;
@@ -47,9 +47,9 @@
static Example_Aux get aux => Example_Aux.fromRef(_get_aux().object);
static final _set_aux = jniLookup<
ffi.NativeFunction<
- jni.JThrowable Function(
+ jni.JThrowablePtr Function(
ffi.Pointer<ffi.Void>)>>("set_Example__aux")
- .asFunction<jni.JThrowable Function(ffi.Pointer<ffi.Void>)>();
+ .asFunction<jni.JThrowablePtr Function(ffi.Pointer<ffi.Void>)>();
/// from: static public com.github.dart_lang.jnigen.simple_package.Example.Aux aux
/// The returned object must be deleted after use, by calling the `delete` method.
@@ -63,9 +63,9 @@
/// from: static public int num
static int get num => _get_num().integer;
static final _set_num =
- jniLookup<ffi.NativeFunction<jni.JThrowable Function(ffi.Int32)>>(
+ jniLookup<ffi.NativeFunction<jni.JThrowablePtr Function(ffi.Int32)>>(
"set_Example__num")
- .asFunction<jni.JThrowable Function(int)>();
+ .asFunction<jni.JThrowablePtr Function(int)>();
/// from: static public int num
static set num(int value) => _set_num(value);
@@ -108,8 +108,8 @@
/// from: static public int[] getArr()
/// The returned object must be deleted after use, by calling the `delete` method.
- static jni.JniArray<jni.JInt> getArr() =>
- jni.JniArray<jni.JInt>.fromRef(_getArr().object);
+ static jni.JArray<jni.JInt> getArr() =>
+ jni.JArray<jni.JInt>.fromRef(_getArr().object);
static final _addAll = jniLookup<
ffi.NativeFunction<
@@ -117,8 +117,7 @@
.asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>();
/// from: static public int addAll(int[] arr)
- static int addAll(jni.JniArray<jni.JInt> arr) =>
- _addAll(arr.reference).integer;
+ static int addAll(jni.JArray<jni.JInt> arr) => _addAll(arr.reference).integer;
static final _getSelf = jniLookup<
ffi.NativeFunction<
@@ -174,7 +173,7 @@
static void throwException() => _throwException().check();
}
-class _$ExampleType extends jni.JniType<Example> {
+class _$ExampleType extends jni.JType<Example> {
const _$ExampleType();
@override
@@ -182,39 +181,39 @@
r"Lcom/github/dart_lang/jnigen/simple_package/Example;";
}
-extension $ExampleJniArray on jni.JniArray<Example> {
+extension $ExampleArray on jni.JArray<Example> {
Example operator [](int index) {
return Example.fromRef(elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, Example value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
/// from: com.github.dart_lang.jnigen.simple_package.Example$Aux
-class Example_Aux extends jni.JniObject {
+class Example_Aux extends jni.JObject {
Example_Aux.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<Example_Aux> type = _$Example_AuxType();
+ static const jni.JType<Example_Aux> type = _$Example_AuxType();
static final _get_value = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>>("get_Example_Aux__value")
.asFunction<
jni.JniResult Function(
- jni.JObject,
+ jni.JObjectPtr,
)>();
/// from: public boolean value
bool get value => _get_value(reference).boolean;
static final _set_value = jniLookup<
ffi.NativeFunction<
- jni.JThrowable Function(
- jni.JObject, ffi.Uint8)>>("set_Example_Aux__value")
- .asFunction<jni.JThrowable Function(jni.JObject, int)>();
+ jni.JThrowablePtr Function(
+ jni.JObjectPtr, ffi.Uint8)>>("set_Example_Aux__value")
+ .asFunction<jni.JThrowablePtr Function(jni.JObjectPtr, int)>();
/// from: public boolean value
set value(bool value) => _set_value(reference, value ? 1 : 0);
@@ -246,7 +245,7 @@
void setValue(bool value) => _setValue(reference, value ? 1 : 0).check();
}
-class _$Example_AuxType extends jni.JniType<Example_Aux> {
+class _$Example_AuxType extends jni.JType<Example_Aux> {
const _$Example_AuxType();
@override
@@ -254,23 +253,23 @@
r"Lcom/github/dart_lang/jnigen/simple_package/Example$Aux;";
}
-extension $Example_AuxJniArray on jni.JniArray<Example_Aux> {
+extension $Example_AuxArray on jni.JArray<Example_Aux> {
Example_Aux operator [](int index) {
return Example_Aux.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, Example_Aux value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
/// from: com.github.dart_lang.jnigen.pkg2.C2
-class C2 extends jni.JniObject {
+class C2 extends jni.JObject {
C2.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<C2> type = _$C2Type();
+ static const jni.JType<C2> type = _$C2Type();
static final _get_CONSTANT =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>(
"get_C2__CONSTANT")
@@ -279,9 +278,9 @@
/// from: static public int CONSTANT
static int get CONSTANT => _get_CONSTANT().integer;
static final _set_CONSTANT =
- jniLookup<ffi.NativeFunction<jni.JThrowable Function(ffi.Int32)>>(
+ jniLookup<ffi.NativeFunction<jni.JThrowablePtr Function(ffi.Int32)>>(
"set_C2__CONSTANT")
- .asFunction<jni.JThrowable Function(int)>();
+ .asFunction<jni.JThrowablePtr Function(int)>();
/// from: static public int CONSTANT
static set CONSTANT(int value) => _set_CONSTANT(value);
@@ -294,29 +293,29 @@
C2() : super.fromRef(_ctor().object);
}
-class _$C2Type extends jni.JniType<C2> {
+class _$C2Type extends jni.JType<C2> {
const _$C2Type();
@override
String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/C2;";
}
-extension $C2JniArray on jni.JniArray<C2> {
+extension $C2Array on jni.JArray<C2> {
C2 operator [](int index) {
return C2.fromRef(elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, C2 value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}
/// from: com.github.dart_lang.jnigen.pkg2.Example
-class Example1 extends jni.JniObject {
+class Example1 extends jni.JObject {
Example1.fromRef(ffi.Pointer<ffi.Void> ref) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
- static const jni.JniType<Example1> type = _$Example1Type();
+ static const jni.JType<Example1> type = _$Example1Type();
static final _ctor =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example1__ctor")
.asFunction<jni.JniResult Function()>();
@@ -334,20 +333,20 @@
int whichExample() => _whichExample(reference).integer;
}
-class _$Example1Type extends jni.JniType<Example1> {
+class _$Example1Type extends jni.JType<Example1> {
const _$Example1Type();
@override
String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/Example;";
}
-extension $Example1JniArray on jni.JniArray<Example1> {
+extension $Example1Array on jni.JArray<Example1> {
Example1 operator [](int index) {
return Example1.fromRef(
elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, Example1 value) {
- (this as jni.JniArray<jni.JniObject>)[index] = value;
+ (this as jni.JArray<jni.JObject>)[index] = value;
}
}