diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml index a187b8dfa..44c31fd74 100644 --- a/.github/workflows/jnigen.yaml +++ b/.github/workflows/jnigen.yaml @@ -105,8 +105,6 @@ jobs: working-directory: ./pkgs/jnigen/java - name: Build summarizer run: dart run jnigen:setup - - name: Generate runtime tests - run: dart run tool/generate_runtime_tests.dart - name: Run VM tests run: dart test --test-randomize-ordering-seed random - name: Install coverage @@ -258,8 +256,6 @@ jobs: - run: dart run jnigen:setup - name: Build summarizer run: dart run jnigen:setup - - name: Generate runtime tests - run: dart run tool/generate_runtime_tests.dart - name: Run tests run: dart test --test-randomize-ordering-seed random @@ -309,8 +305,6 @@ jobs: - run: dart pub get - name: Build summarizer run: dart run jnigen:setup - - name: Generate runtime tests - run: dart run tool/generate_runtime_tests.dart - name: Run tests run: dart test --test-randomize-ordering-seed random diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 757642d74..7186b632d 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.0-wip + +- No changes yet. + ## 0.8.0 - **Breaking Change** ([#981](https://github.com/dart-lang/native/issues/981)): diff --git a/pkgs/jni/lib/src/third_party/global_env_extensions.dart b/pkgs/jni/lib/src/third_party/global_env_extensions.dart index 3e90beda0..2a909ec71 100644 --- a/pkgs/jni/lib/src/third_party/global_env_extensions.dart +++ b/pkgs/jni/lib/src/third_party/global_env_extensions.dart @@ -3,6 +3,9 @@ // This is generated from JNI header in Android NDK. License for the same is // provided below. +// Generation logic resides in `tool/wrapper_generators`. +// To regenerate, run `dart run tool/generate_ffi_bindings.dart`. + /* * Copyright (C) 2006 The Android Open Source Project * diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index 4347e06bb..0fb4de28b 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml @@ -4,7 +4,7 @@ name: jni description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. -version: 0.8.0 +version: 0.9.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/jni topics: diff --git a/pkgs/jni/src/third_party/global_jni_env.c b/pkgs/jni/src/third_party/global_jni_env.c index 4718fa289..70fc7697b 100644 --- a/pkgs/jni/src/third_party/global_jni_env.c +++ b/pkgs/jni/src/third_party/global_jni_env.c @@ -3,6 +3,9 @@ // This is generated from JNI header in Android NDK. License for the same is // provided below. +// Generation logic resides in `tool/wrapper_generators`. +// To regenerate, run `dart run tool/generate_ffi_bindings.dart`. + /* * Copyright (C) 2006 The Android Open Source Project * diff --git a/pkgs/jni/src/third_party/global_jni_env.h b/pkgs/jni/src/third_party/global_jni_env.h index 1423c51c2..041718c69 100644 --- a/pkgs/jni/src/third_party/global_jni_env.h +++ b/pkgs/jni/src/third_party/global_jni_env.h @@ -3,6 +3,9 @@ // This is generated from JNI header in Android NDK. License for the same is // provided below. +// Generation logic resides in `tool/wrapper_generators`. +// To regenerate, run `dart run tool/generate_ffi_bindings.dart`. + /* * Copyright (C) 2006 The Android Open Source Project * diff --git a/pkgs/jni/tool/wrapper_generators/ffigen_util.dart b/pkgs/jni/tool/wrapper_generators/ffigen_util.dart index 2b234f6a9..480757c79 100644 --- a/pkgs/jni/tool/wrapper_generators/ffigen_util.dart +++ b/pkgs/jni/tool/wrapper_generators/ffigen_util.dart @@ -24,6 +24,9 @@ const preamble = ''' // This is generated from JNI header in Android NDK. License for the same is // provided below. +// Generation logic resides in `tool/wrapper_generators`. +// To regenerate, run `dart run tool/generate_ffi_bindings.dart`. + /* * Copyright (C) 2006 The Android Open Source Project * diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 29f3fac28..4f4752613 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -1,5 +1,7 @@ -## 0.8.1-wip +## 0.9.0-wip +- **Breaking Change** ([#660](https://github.com/dart-lang/native/issues/660)): + Removed C-based bindings. Now all bindings are Dart-only. - Expand constraint on `package:cli_config` to allow `^0.2.0`. - Ignore `use_super_parameters` lint in generated files. diff --git a/pkgs/jnigen/README.md b/pkgs/jnigen/README.md index ca921f191..b303604e3 100644 --- a/pkgs/jnigen/README.md +++ b/pkgs/jnigen/README.md @@ -6,7 +6,7 @@ ## Introduction Experimental bindings generator for Java bindings through dart:ffi and JNI. -`jnigen` scans compiled JAR files or Java source code to generate a description of the API, then uses it to generate Dart annd C bindings. The Dart bindings call the C bindings, which in-turn call the Java functions through JNI. Shared functionality and base classes are provided through the support library, `package:jni`. +`jnigen` scans compiled JAR files or Java source code to generate a description of the API, then uses it to generate Dart bindings. The Dart bindings call the C bindings, which in-turn call the Java functions through JNI. Shared functionality and base classes are provided through the support library, `package:jni`. The configuration for binding generation is usually provided through YAML. @@ -14,16 +14,12 @@ Three configuration details are needed to generate the bindings. Everything else * _Inputs_: input can be Java source files (`source_path`), or compiled classes / JARs (`class_path`). Some maven / gradle based tooling is also provided to simplify obtaining dependencies. -* _Outputs_: Output can be generated in package-structured (one file per class) or single file bindings. Target path to write C and Dart bindings needs to be specified. +* _Outputs_: Output can be generated in package-structured (one file per class) or single file bindings. Target path to write Dart bindings needs to be specified. * _Classes_: Specify which classes or packages you need bindings for. Specifying a package includes all classes inside it recursively. Check out the [examples](jnigen/example/) to see some sample configurations. -C code is always generated into a directory with it's own build configuration. It's built as a separate dynamic library. - -Lastly, [dart_only bindings](#pure-dart-bindings) mode is also available as a proof-of-concept. It does not need intermediate C bindings, only a dependency on the support library `package:jni`. - ## Example It's possible to generate bindings for JAR libraries, or Java source files. @@ -53,53 +49,50 @@ This produces the following boilerplate: ```dart /// Some boilerplate is omitted for clarity. -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("android_utils"); - -/// from: com.example.in_app_java.AndroidUtils class AndroidUtils extends jni.JObject { - AndroidUtils.fromReference(JReference reference) : super.fromReference(reference); + @override + late final jni.JObjType $type = type; + + AndroidUtils.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"com/example/in_app_java/AndroidUtils"); - static final _showToast = jniLookup< + /// The type which includes information such as the signature of this class. + static const type = $AndroidUtilsType(); + + static final _id_showToast = _class.staticMethodId( + r"showToast", + r"(Landroid/app/Activity;Ljava/lang/CharSequence;I)V", + ); + + static final _showToast = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>("AndroidUtils__showToast") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Int64 + )>)>>("globalEnv_CallStaticVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); /// from: static public void showToast(android.app.Activity mainActivity, java.lang.CharSequence text, int duration) static void showToast( - jni.JObject mainActivity, jni.JObject text, int duration) => - _showToast(mainActivity.reference, text.reference, duration).check(); -} -``` - -#### C Bindings: - -```c -// Some boilerplate is omitted for clarity. - -// com.example.in_app_java.AndroidUtils -jclass _c_AndroidUtils = NULL; - -jmethodID _m_AndroidUtils__showToast = NULL; -FFI_PLUGIN_EXPORT -JniResult AndroidUtils__showToast(jobject mainActivity, - jobject text, - int32_t duration) { - load_env(); - load_class_gr(&_c_AndroidUtils, "com/example/in_app_java/AndroidUtils"); - if (_c_AndroidUtils == NULL) - return (JniResult){.result = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_AndroidUtils, &_m_AndroidUtils__showToast, "showToast", - "(Landroid/app/Activity;Ljava/lang/CharSequence;I)V"); - if (_m_AndroidUtils__showToast == NULL) - return (JniResult){.result = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_AndroidUtils, - _m_AndroidUtils__showToast, mainActivity, - text, duration); - return (JniResult){.result = {.j = 0}, .exception = check_exception()}; + jni.JObject mainActivity, + jni.JObject text, + int duration, + ) { + _showToast(_class.reference.pointer, _id_showToast as jni.JMethodIDPtr, + mainActivity.reference.pointer, text.reference.pointer, duration) + .check(); + } } ``` @@ -110,9 +103,6 @@ android_sdk_config: add_gradle_deps: true output: - c: - library_name: android_utils - path: src/android_utils/ dart: path: lib/android_utils.dart structure: single_file @@ -145,8 +135,6 @@ More advanced features such as callbacks are not supported yet. Support for thes On Flutter targets, native libraries are built automatically and bundled. On standalone platforms, no such infrastructure exists yet. As a stopgap solution, running `dart run jni:setup` in a target directory builds all JNI native dependencies of the package into `build/jni_libs`. -By default `jni:setup` goes through pubspec configuration and builds all JNI dependencies of the project. It can be overridden to build a custom directory using `-s` switch, which can be useful when output configuration for C bindings does not follow standard FFI plugin layout. - The build directory has to be passed to `Jni.spawn` call. It's assumed that all dependencies are built into the same target directory, so that once JNI is initialized, generated bindings can load their respective C libraries automatically. ## Requirements @@ -171,10 +159,8 @@ $env:Path += ";${env:JAVA_HOME}\bin\server". If JAVA_HOME not set, find the `java.exe` executable and set the environment variable in Control Panel. If java is installed through a package manager, there may be a more automatic way to do this. (Eg: `scoop reset`). -### C/C++ tooling -CMake and a standard C toolchain are required to build `package:jni` and C bindings generated by `jnigen`. - -It's recommended to have `clang-format` installed for formatting the generated C bindings. On Windows, it's part of LLVM installation. On most Linux distributions it is available as a separate package. On MacOS, it can be installed using Homebrew. +### C tooling +CMake and a standard C toolchain are required to build `package:jni`. ## FAQs @@ -225,11 +211,6 @@ A `*` denotes required configuration. | `classes` * | List of qualified class / package names | List of qualified class / package names. `source_path` will be scanned assuming the sources follow standard java-ish hierarchy. That is a.b.c either maps to a directory `a/b/c` or a class file `a/b/c.java`. | | `enable_experiment` | List of experiment names:
  • `interface_implementation`
| List of enabled experiments. These features are still in development and their API might break. | | `output:` | (Subsection) | This subsection will contain configuration related to output files. | -| `output:` >> `bindings_type` | `c_based` (default) or `dart_only` | Binding generation strategy. [Trade-offs](#pure-dart-bindings) are explained at the end of this document. | -| `output:` >> `c:` | (Subsection) | This subsection specified C output configuration. Required if `bindings_type` is `c_based`. | -| `output:` >> `c:` >> path * | Directory path | Directory to write C bindings. Usually `src/` in case of an FFI plugin template. | -| `output:` >> `c:` >> subdir | Directory path | If specified, C bindings will be written to `subdir` resolved relative to `path`. This is useful when bindings are supposed to be under source's license, and written to a subdirectory such as `third_party`. | -| `output:` >> `c:` >> `library_name` *| Identifier (snake_case) | Name for generated C library. | `output:` >> `dart:` | (Subsection) | This subsection specifies Dart output configuration. | | `output:` >> `dart:` >> `structure` | `package_structure` / `single_file` | Whether to map resulting dart bindings to file-per-class source layout, or write all bindings to single file. | `output:` >> `dart:` >> `path` * | Directory path or File path | Path to write Dart bindings. Should end in `.dart` for `single_file` configurations, and end in `/` for `package_structure` (default) configuration. | @@ -255,19 +236,6 @@ It's possible to use the programmatic API instead of YAML. * import `package:jnigen/jnigen.dart` * construct a `Config` object and pass it to `generateJniBindings` function. The parameters are similar to the ones described above. -## Pure dart Bindings -It's possible to generate bindings that do not rely on an intermediate layer of C code. Bindings will still depend on `package:jni` and its support library written in C. But this approach avoids large C bindings. - -To enable pure dart bindings, specify -``` -output: - bindings_type: dart_only -``` - -Any C output configuration will be ignored. - -However, pure dart bindings will require additional allocations and check runtimeType of the arguments. This will be the case until Variadic arguments land in Dart FFI. - ## Android core libraries These days, Android projects depend heavily on AndroidX and other libraries downloaded via gradle. We have a tracking issue to improve detection of android SDK and dependencies. (#31). Currently we can fetch the JAR dependencies of an android project, by running a gradle stub, if `android_sdk_config` >> `add_gradle_deps` is specified. diff --git a/pkgs/jnigen/android_test_runner/android/app/build.gradle b/pkgs/jnigen/android_test_runner/android/app/build.gradle index e8e50be1b..18596cf0a 100644 --- a/pkgs/jnigen/android_test_runner/android/app/build.gradle +++ b/pkgs/jnigen/android_test_runner/android/app/build.gradle @@ -59,11 +59,6 @@ android { signingConfig signingConfigs.debug } } - externalNativeBuild { - cmake { - path 'CMakeLists.txt' - } - } } flutter { diff --git a/pkgs/jnigen/android_test_runner/integration_test/.gitignore b/pkgs/jnigen/android_test_runner/integration_test/.gitignore deleted file mode 100644 index af7c365a2..000000000 --- a/pkgs/jnigen/android_test_runner/integration_test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -runtime_test.dart \ No newline at end of file diff --git a/pkgs/jnigen/android_test_runner/integration_test/runtime_test.dart b/pkgs/jnigen/android_test_runner/integration_test/runtime_test.dart new file mode 100644 index 000000000..a974b5bf0 --- /dev/null +++ b/pkgs/jnigen/android_test_runner/integration_test/runtime_test.dart @@ -0,0 +1,25 @@ +// Generated file. Do not edit or check-in to version control. + +// Copyright (c) 2023, 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 "package:flutter_test/flutter_test.dart"; + +import "../../test/jackson_core_test/runtime_test_registrant.dart" + as jackson_core_test; +import "../../test/simple_package_test/runtime_test_registrant.dart" + as simple_package_test; +import "../../test/kotlin_test/runtime_test_registrant.dart" as kotlin_test; + +typedef TestCaseCallback = void Function(); + +void test(String description, TestCaseCallback testCase) { + testWidgets(description, (widgetTester) async => testCase()); +} + +void main() { + jackson_core_test.registerTests("jackson_core_test", test); + simple_package_test.registerTests("simple_package_test", test); + kotlin_test.registerTests("kotlin_test", test); +} diff --git a/pkgs/jnigen/cmake/CMakeLists.txt.tmpl b/pkgs/jnigen/cmake/CMakeLists.txt.tmpl deleted file mode 100644 index d0b8a7378..000000000 --- a/pkgs/jnigen/cmake/CMakeLists.txt.tmpl +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project({{LIBRARY_NAME}} VERSION 0.0.1 LANGUAGES C) - -add_library({{LIBRARY_NAME}} SHARED - "{{SUBDIR}}/{{LIBRARY_NAME}}.c" -) - -set_target_properties({{LIBRARY_NAME}} PROPERTIES - OUTPUT_NAME "{{LIBRARY_NAME}}" -) - -target_compile_definitions({{LIBRARY_NAME}} PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries({{LIBRARY_NAME}} log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries({{LIBRARY_NAME}} ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/cmake/README.md b/pkgs/jnigen/cmake/README.md deleted file mode 100644 index 65f9951ba..000000000 --- a/pkgs/jnigen/cmake/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains a CMakeLists.txt.tmpl file which will be used to generate build configuration for generated C code. - -`{{LIBRARY_NAME}}` in this template will be replaced by `library_name` configuration parameter. \ No newline at end of file diff --git a/pkgs/jnigen/example/in_app_java/README.md b/pkgs/jnigen/example/in_app_java/README.md index 13813a821..5c4da0a3d 100644 --- a/pkgs/jnigen/example/in_app_java/README.md +++ b/pkgs/jnigen/example/in_app_java/README.md @@ -1,24 +1,28 @@ # In-App Java Example -This example shows how to write custom java code in `android/app/src` and call it using `jnigen` generated bindings. +This example shows how to write custom java code in `android/app/src` and call +it using `jnigen` generated bindings. #### How to run this example: -* Run `flutter run` to run the app. -* To regenerate bindings after changing Java code, run `flutter pub run jnigen --config jnigen.yaml`. This requires at least one APK build to have been run before, so that it's possible for `jnigen` to obtain classpaths of Android Gradle libraries. Therefore, once run `flutter build apk` before generating bindings for the first time, or after a `flutter clean`. +- Run `flutter run` to run the app. -#### General steps -These are general steps to integrate Java code into a flutter project using `jnigen`. - -* Write Java code in suitable package folder, under `android/` subproject of the flutter app. - -* Create A jnigen config like `jnigen.yaml` in this example. +- To regenerate bindings after changing Java code, run + `flutter pub run jnigen --config jnigen.yaml`. This requires at least one APK + build to have been run before, so that it's possible for `jnigen` to obtain + classpaths of Android Gradle libraries. Therefore, once run + `flutter build apk` before generating bindings for the first time, or after a + `flutter clean`. -* Generate bindings using jnigen config. - -* Add an `externalNativeBuild` to gradle script (see `android/app/build.gradle` in this example). - -* Add proguard rules to exclude your custom classes from tree shaking, since they are always accessed reflectively in JNI. +#### General steps -* Build and run the app. +These are general steps to integrate Java code into a flutter project using +`jnigen`. +- Write Java code in suitable package folder, under `android/` subproject of the + flutter app. +- Create A jnigen config like `jnigen.yaml` in this example. +- Generate bindings using jnigen config. +- Add proguard rules to exclude your custom classes from tree shaking, since + they are always accessed reflectively in JNI. +- Build and run the app. diff --git a/pkgs/jnigen/example/in_app_java/android/app/build.gradle b/pkgs/jnigen/example/in_app_java/android/app/build.gradle index 21410cd00..96798166c 100644 --- a/pkgs/jnigen/example/in_app_java/android/app/build.gradle +++ b/pkgs/jnigen/example/in_app_java/android/app/build.gradle @@ -57,12 +57,6 @@ android { signingConfig signingConfigs.debug } } - - externalNativeBuild { - cmake { - path "../../src/android_utils/CMakeLists.txt" - } - } } flutter { diff --git a/pkgs/jnigen/example/in_app_java/jnigen.yaml b/pkgs/jnigen/example/in_app_java/jnigen.yaml index e588f4a4c..14a4d7051 100644 --- a/pkgs/jnigen/example/in_app_java/jnigen.yaml +++ b/pkgs/jnigen/example/in_app_java/jnigen.yaml @@ -3,9 +3,6 @@ android_sdk_config: add_gradle_sources: true output: - c: - library_name: android_utils - path: src/android_utils/ dart: path: lib/android_utils.dart structure: single_file 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 f6933b4ed..48599b23d 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -23,11 +23,6 @@ import "dart:ffi" as ffi; import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("android_utils"); - /// from: androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult class EmojiCompat_CodepointSequenceMatchResult extends jni.JObject { @override @@ -38,6 +33,9 @@ class EmojiCompat_CodepointSequenceMatchResult extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_CodepointSequenceMatchResultType(); } @@ -85,13 +83,25 @@ class EmojiCompat_Config extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat$Config"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_ConfigType(); - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat_Config__new0") - .asFunction)>(); + static final _id_new0 = _class.constructorId( + r"(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void (androidx.emoji2.text.EmojiCompat.MetadataRepoLoader metadataLoader) /// The returned object must be released after use, by calling the [release] method. @@ -101,18 +111,26 @@ class EmojiCompat_Config extends jni.JObject { factory EmojiCompat_Config( EmojiCompat_MetadataRepoLoader metadataLoader, ) { - return EmojiCompat_Config.fromReference( - _new0(metadataLoader.reference.pointer).reference); + return EmojiCompat_Config.fromReference(_new0(_class.reference.pointer, + _id_new0 as jni.JMethodIDPtr, metadataLoader.reference.pointer) + .reference); } - static final _registerInitCallback = jniLookup< + static final _id_registerInitCallback = _class.instanceMethodId( + r"registerInitCallback", + r"(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _registerInitCallback = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_Config__registerInitCallback") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) /// The returned object must be released after use, by calling the [release] method. @@ -124,18 +142,27 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_InitCallback initCallback, ) { return _registerInitCallback( - reference.pointer, initCallback.reference.pointer) + reference.pointer, + _id_registerInitCallback as jni.JMethodIDPtr, + initCallback.reference.pointer) .object(const $EmojiCompat_ConfigType()); } - static final _unregisterInitCallback = jniLookup< + static final _id_unregisterInitCallback = _class.instanceMethodId( + r"unregisterInitCallback", + r"(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _unregisterInitCallback = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_Config__unregisterInitCallback") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) /// The returned object must be released after use, by calling the [release] method. @@ -147,15 +174,24 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_InitCallback initCallback, ) { return _unregisterInitCallback( - reference.pointer, initCallback.reference.pointer) + reference.pointer, + _id_unregisterInitCallback as jni.JMethodIDPtr, + initCallback.reference.pointer) .object(const $EmojiCompat_ConfigType()); } - static final _setReplaceAll = jniLookup< + static final _id_setReplaceAll = _class.instanceMethodId( + r"setReplaceAll", + r"(Z)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setReplaceAll = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("EmojiCompat_Config__setReplaceAll") - .asFunction, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setReplaceAll(boolean replaceAll) /// The returned object must be released after use, by calling the [release] method. @@ -168,15 +204,23 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_Config setReplaceAll( bool replaceAll, ) { - return _setReplaceAll(reference.pointer, replaceAll ? 1 : 0) + return _setReplaceAll(reference.pointer, + _id_setReplaceAll as jni.JMethodIDPtr, replaceAll ? 1 : 0) .object(const $EmojiCompat_ConfigType()); } - static final _setUseEmojiAsDefaultStyle = jniLookup< + static final _id_setUseEmojiAsDefaultStyle = _class.instanceMethodId( + r"setUseEmojiAsDefaultStyle", + r"(Z)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setUseEmojiAsDefaultStyle = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("EmojiCompat_Config__setUseEmojiAsDefaultStyle") - .asFunction, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle) /// The returned object must be released after use, by calling the [release] method. @@ -197,18 +241,27 @@ class EmojiCompat_Config extends jni.JObject { bool useEmojiAsDefaultStyle, ) { return _setUseEmojiAsDefaultStyle( - reference.pointer, useEmojiAsDefaultStyle ? 1 : 0) + reference.pointer, + _id_setUseEmojiAsDefaultStyle as jni.JMethodIDPtr, + useEmojiAsDefaultStyle ? 1 : 0) .object(const $EmojiCompat_ConfigType()); } - static final _setUseEmojiAsDefaultStyle1 = jniLookup< + static final _id_setUseEmojiAsDefaultStyle1 = _class.instanceMethodId( + r"setUseEmojiAsDefaultStyle", + r"(ZLjava/util/List;)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setUseEmojiAsDefaultStyle1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Uint8, - ffi.Pointer)>>( - "EmojiCompat_Config__setUseEmojiAsDefaultStyle1") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, int, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle, java.util.List emojiAsDefaultStyleExceptions) /// The returned object must be released after use, by calling the [release] method. @@ -231,16 +284,24 @@ class EmojiCompat_Config extends jni.JObject { ) { return _setUseEmojiAsDefaultStyle1( reference.pointer, + _id_setUseEmojiAsDefaultStyle1 as jni.JMethodIDPtr, useEmojiAsDefaultStyle ? 1 : 0, emojiAsDefaultStyleExceptions.reference.pointer) .object(const $EmojiCompat_ConfigType()); } - static final _setEmojiSpanIndicatorEnabled = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Uint8)>>( - "EmojiCompat_Config__setEmojiSpanIndicatorEnabled") - .asFunction, int)>(); + static final _id_setEmojiSpanIndicatorEnabled = _class.instanceMethodId( + r"setEmojiSpanIndicatorEnabled", + r"(Z)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setEmojiSpanIndicatorEnabled = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorEnabled(boolean emojiSpanIndicatorEnabled) /// The returned object must be released after use, by calling the [release] method. @@ -254,15 +315,24 @@ class EmojiCompat_Config extends jni.JObject { bool emojiSpanIndicatorEnabled, ) { return _setEmojiSpanIndicatorEnabled( - reference.pointer, emojiSpanIndicatorEnabled ? 1 : 0) + reference.pointer, + _id_setEmojiSpanIndicatorEnabled as jni.JMethodIDPtr, + emojiSpanIndicatorEnabled ? 1 : 0) .object(const $EmojiCompat_ConfigType()); } - static final _setEmojiSpanIndicatorColor = jniLookup< + static final _id_setEmojiSpanIndicatorColor = _class.instanceMethodId( + r"setEmojiSpanIndicatorColor", + r"(I)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setEmojiSpanIndicatorColor = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("EmojiCompat_Config__setEmojiSpanIndicatorColor") - .asFunction, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorColor(int color) /// The returned object must be released after use, by calling the [release] method. @@ -273,15 +343,23 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_Config setEmojiSpanIndicatorColor( int color, ) { - return _setEmojiSpanIndicatorColor(reference.pointer, color) + return _setEmojiSpanIndicatorColor(reference.pointer, + _id_setEmojiSpanIndicatorColor as jni.JMethodIDPtr, color) .object(const $EmojiCompat_ConfigType()); } - static final _setMetadataLoadStrategy = jniLookup< + static final _id_setMetadataLoadStrategy = _class.instanceMethodId( + r"setMetadataLoadStrategy", + r"(I)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setMetadataLoadStrategy = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("EmojiCompat_Config__setMetadataLoadStrategy") - .asFunction, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setMetadataLoadStrategy(int strategy) /// The returned object must be released after use, by calling the [release] method. @@ -321,17 +399,26 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_Config setMetadataLoadStrategy( int strategy, ) { - return _setMetadataLoadStrategy(reference.pointer, strategy) + return _setMetadataLoadStrategy(reference.pointer, + _id_setMetadataLoadStrategy as jni.JMethodIDPtr, strategy) .object(const $EmojiCompat_ConfigType()); } - static final _setSpanFactory = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat_Config__setSpanFactory") + static final _id_setSpanFactory = _class.instanceMethodId( + r"setSpanFactory", + r"(Landroidx/emoji2/text/EmojiCompat$SpanFactory;)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setSpanFactory = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setSpanFactory(androidx.emoji2.text.EmojiCompat.SpanFactory factory) /// The returned object must be released after use, by calling the [release] method. @@ -342,18 +429,26 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_Config setSpanFactory( EmojiCompat_SpanFactory factory0, ) { - return _setSpanFactory(reference.pointer, factory0.reference.pointer) + return _setSpanFactory(reference.pointer, + _id_setSpanFactory as jni.JMethodIDPtr, factory0.reference.pointer) .object(const $EmojiCompat_ConfigType()); } - static final _setGlyphChecker = jniLookup< + static final _id_setGlyphChecker = _class.instanceMethodId( + r"setGlyphChecker", + r"(Landroidx/emoji2/text/EmojiCompat$GlyphChecker;)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _setGlyphChecker = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_Config__setGlyphChecker") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setGlyphChecker(androidx.emoji2.text.EmojiCompat.GlyphChecker glyphChecker) /// The returned object must be released after use, by calling the [release] method. @@ -364,18 +459,28 @@ class EmojiCompat_Config extends jni.JObject { EmojiCompat_Config setGlyphChecker( EmojiCompat_GlyphChecker glyphChecker, ) { - return _setGlyphChecker(reference.pointer, glyphChecker.reference.pointer) + return _setGlyphChecker( + reference.pointer, + _id_setGlyphChecker as jni.JMethodIDPtr, + glyphChecker.reference.pointer) .object(const $EmojiCompat_ConfigType()); } - static final _getMetadataRepoLoader = jniLookup< + static final _id_getMetadataRepoLoader = _class.instanceMethodId( + r"getMetadataRepoLoader", + r"()Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;", + ); + + static final _getMetadataRepoLoader = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("EmojiCompat_Config__getMetadataRepoLoader") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected final androidx.emoji2.text.EmojiCompat.MetadataRepoLoader getMetadataRepoLoader() @@ -383,7 +488,8 @@ class EmojiCompat_Config extends jni.JObject { /// /// Returns the MetadataRepoLoader. EmojiCompat_MetadataRepoLoader getMetadataRepoLoader() { - return _getMetadataRepoLoader(reference.pointer) + return _getMetadataRepoLoader( + reference.pointer, _id_getMetadataRepoLoader as jni.JMethodIDPtr) .object(const $EmojiCompat_MetadataRepoLoaderType()); } } @@ -425,26 +531,50 @@ class EmojiCompat_DefaultSpanFactory extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/EmojiCompat$DefaultSpanFactory"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_DefaultSpanFactoryType(); - static final _new0 = jniLookup>( - "EmojiCompat_DefaultSpanFactory__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_DefaultSpanFactory() { - return EmojiCompat_DefaultSpanFactory.fromReference(_new0().reference); + return EmojiCompat_DefaultSpanFactory.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _createSpan = jniLookup< + static final _id_createSpan = _class.instanceMethodId( + r"createSpan", + r"(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;", + ); + + static final _createSpan = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_DefaultSpanFactory__createSpan") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer rasterizer) /// The returned object must be released after use, by calling the [release] method. @@ -456,7 +586,8 @@ class EmojiCompat_DefaultSpanFactory extends jni.JObject { jni.JObject createSpan( jni.JObject rasterizer, ) { - return _createSpan(reference.pointer, rasterizer.reference.pointer) + return _createSpan(reference.pointer, _id_createSpan as jni.JMethodIDPtr, + rasterizer.reference.pointer) .object(const jni.JObjectType()); } } @@ -500,19 +631,31 @@ class EmojiCompat_GlyphChecker extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat$GlyphChecker"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_GlyphCheckerType(); - static final _hasGlyph = jniLookup< + static final _id_hasGlyph = _class.instanceMethodId( + r"hasGlyph", + r"(Ljava/lang/CharSequence;III)Z", + ); + + static final _hasGlyph = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("EmojiCompat_GlyphChecker__hasGlyph") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64 + )>)>>("globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, int, int)>(); /// from: public abstract boolean hasGlyph(java.lang.CharSequence charSequence, int start, int end, int sdkAdded) /// @@ -557,8 +700,8 @@ class EmojiCompat_GlyphChecker extends jni.JObject { int end, int sdkAdded, ) { - return _hasGlyph(reference.pointer, charSequence.reference.pointer, start, - end, sdkAdded) + return _hasGlyph(reference.pointer, _id_hasGlyph as jni.JMethodIDPtr, + charSequence.reference.pointer, start, end, sdkAdded) .boolean; } } @@ -601,26 +744,50 @@ class EmojiCompat_InitCallback extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat$InitCallback"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_InitCallbackType(); - static final _new0 = jniLookup>( - "EmojiCompat_InitCallback__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_InitCallback() { - return EmojiCompat_InitCallback.fromReference(_new0().reference); + return EmojiCompat_InitCallback.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _onInitialized = jniLookup< + static final _id_onInitialized = _class.instanceMethodId( + r"onInitialized", + r"()V", + ); + + static final _onInitialized = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("EmojiCompat_InitCallback__onInitialized") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public void onInitialized() @@ -628,16 +795,25 @@ class EmojiCompat_InitCallback extends jni.JObject { /// Called when EmojiCompat is initialized and the emoji data is loaded. When used on devices /// running API 18 or below, this function is always called. void onInitialized() { - _onInitialized(reference.pointer).check(); + _onInitialized(reference.pointer, _id_onInitialized as jni.JMethodIDPtr) + .check(); } - static final _onFailed = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat_InitCallback__onFailed") + static final _id_onFailed = _class.instanceMethodId( + r"onFailed", + r"(Ljava/lang/Throwable;)V", + ); + + static final _onFailed = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void onFailed(java.lang.Throwable throwable) /// @@ -646,7 +822,9 @@ class EmojiCompat_InitCallback extends jni.JObject { void onFailed( jni.JObject throwable, ) { - _onFailed(reference.pointer, throwable.reference.pointer).check(); + _onFailed(reference.pointer, _id_onFailed as jni.JMethodIDPtr, + throwable.reference.pointer) + .check(); } } @@ -686,6 +864,9 @@ class EmojiCompat_LoadStrategy extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat$LoadStrategy"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_LoadStrategyType(); } @@ -728,16 +909,26 @@ class EmojiCompat_MetadataRepoLoader extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/EmojiCompat$MetadataRepoLoader"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_MetadataRepoLoaderType(); - static final _load = jniLookup< + static final _id_load = _class.instanceMethodId( + r"load", + r"(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V", + ); + + static final _load = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_MetadataRepoLoader__load") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public abstract void load(androidx.emoji2.text.EmojiCompat.MetadataRepoLoaderCallback loaderCallback) /// @@ -748,7 +939,9 @@ class EmojiCompat_MetadataRepoLoader extends jni.JObject { void load( EmojiCompat_MetadataRepoLoaderCallback loaderCallback, ) { - _load(reference.pointer, loaderCallback.reference.pointer).check(); + _load(reference.pointer, _id_load as jni.JMethodIDPtr, + loaderCallback.reference.pointer) + .check(); } } @@ -792,27 +985,50 @@ class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_MetadataRepoLoaderCallbackType(); - static final _new0 = jniLookup>( - "EmojiCompat_MetadataRepoLoaderCallback__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_MetadataRepoLoaderCallback() { return EmojiCompat_MetadataRepoLoaderCallback.fromReference( - _new0().reference); + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _onLoaded = jniLookup< + static final _id_onLoaded = _class.instanceMethodId( + r"onLoaded", + r"(Landroidx/emoji2/text/MetadataRepo;)V", + ); + + static final _onLoaded = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_MetadataRepoLoaderCallback__onLoaded") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public abstract void onLoaded(androidx.emoji2.text.MetadataRepo metadataRepo) /// @@ -821,17 +1037,26 @@ class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { void onLoaded( jni.JObject metadataRepo, ) { - _onLoaded(reference.pointer, metadataRepo.reference.pointer).check(); + _onLoaded(reference.pointer, _id_onLoaded as jni.JMethodIDPtr, + metadataRepo.reference.pointer) + .check(); } - static final _onFailed = jniLookup< + static final _id_onFailed = _class.instanceMethodId( + r"onFailed", + r"(Ljava/lang/Throwable;)V", + ); + + static final _onFailed = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_MetadataRepoLoaderCallback__onFailed") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public abstract void onFailed(java.lang.Throwable throwable) /// @@ -840,7 +1065,9 @@ class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { void onFailed( jni.JObject throwable, ) { - _onFailed(reference.pointer, throwable.reference.pointer).check(); + _onFailed(reference.pointer, _id_onFailed as jni.JMethodIDPtr, + throwable.reference.pointer) + .check(); } } @@ -882,6 +1109,9 @@ class EmojiCompat_ReplaceStrategy extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat$ReplaceStrategy"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_ReplaceStrategyType(); } @@ -929,16 +1159,26 @@ class EmojiCompat_SpanFactory extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat$SpanFactory"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_SpanFactoryType(); - static final _createSpan = jniLookup< + static final _id_createSpan = _class.instanceMethodId( + r"createSpan", + r"(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;", + ); + + static final _createSpan = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_SpanFactory__createSpan") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public abstract androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer rasterizer) /// The returned object must be released after use, by calling the [release] method. @@ -950,7 +1190,8 @@ class EmojiCompat_SpanFactory extends jni.JObject { jni.JObject createSpan( jni.JObject rasterizer, ) { - return _createSpan(reference.pointer, rasterizer.reference.pointer) + return _createSpan(reference.pointer, _id_createSpan as jni.JMethodIDPtr, + rasterizer.reference.pointer) .object(const jni.JObjectType()); } } @@ -1039,12 +1280,14 @@ class EmojiCompat extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"androidx/emoji2/text/EmojiCompat"); + /// The type which includes information such as the signature of this class. static const type = $EmojiCompatType(); - static final _get_EDITOR_INFO_METAVERSION_KEY = - jniLookup>( - "get_EmojiCompat__EDITOR_INFO_METAVERSION_KEY") - .asFunction(); + static final _id_EDITOR_INFO_METAVERSION_KEY = _class.staticFieldId( + r"EDITOR_INFO_METAVERSION_KEY", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String EDITOR_INFO_METAVERSION_KEY /// The returned object must be released after use, by calling the [release] method. @@ -1056,12 +1299,12 @@ class EmojiCompat extends jni.JObject { /// see whether the widget has the ability to display a certain emoji using /// \#hasEmojiGlyph(CharSequence, int). static jni.JString get EDITOR_INFO_METAVERSION_KEY => - _get_EDITOR_INFO_METAVERSION_KEY().object(const jni.JStringType()); + _id_EDITOR_INFO_METAVERSION_KEY.get(_class, const jni.JStringType()); - static final _get_EDITOR_INFO_REPLACE_ALL_KEY = - jniLookup>( - "get_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY") - .asFunction(); + static final _id_EDITOR_INFO_REPLACE_ALL_KEY = _class.staticFieldId( + r"EDITOR_INFO_REPLACE_ALL_KEY", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String EDITOR_INFO_REPLACE_ALL_KEY /// The returned object must be released after use, by calling the [release] method. @@ -1069,7 +1312,7 @@ class EmojiCompat extends jni.JObject { /// Key in EditorInfo\#extras that represents EmojiCompat.Config\#setReplaceAll(boolean) configuration parameter. The key is added only if /// EmojiCompat is used by the widget. If exists, the value is a boolean. static jni.JString get EDITOR_INFO_REPLACE_ALL_KEY => - _get_EDITOR_INFO_REPLACE_ALL_KEY().object(const jni.JStringType()); + _id_EDITOR_INFO_REPLACE_ALL_KEY.get(_class, const jni.JStringType()); /// from: static public final int LOAD_STATE_DEFAULT /// @@ -1235,11 +1478,21 @@ class EmojiCompat extends jni.JObject { /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) for each emoji /// subsequence. static const EMOJI_FALLBACK = 2; - static final _init = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__init") - .asFunction)>(); + static final _id_init = _class.staticMethodId( + r"init", + r"(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat;", + ); + + static final _init = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context) /// The returned object must be released after use, by calling the [release] method. @@ -1262,15 +1515,28 @@ class EmojiCompat extends jni.JObject { static EmojiCompat init( jni.JObject context, ) { - return _init(context.reference.pointer).object(const $EmojiCompatType()); + return _init(_class.reference.pointer, _id_init as jni.JMethodIDPtr, + context.reference.pointer) + .object(const $EmojiCompatType()); } - static final _init1 = jniLookup< + static final _id_init1 = _class.staticMethodId( + r"init", + r"(Landroid/content/Context;Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;)Landroidx/emoji2/text/EmojiCompat;", + ); + + static final _init1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__init1") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigFactory defaultFactory) @@ -1281,15 +1547,26 @@ class EmojiCompat extends jni.JObject { jni.JObject context, DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory defaultFactory, ) { - return _init1(context.reference.pointer, defaultFactory.reference.pointer) + return _init1(_class.reference.pointer, _id_init1 as jni.JMethodIDPtr, + context.reference.pointer, defaultFactory.reference.pointer) .object(const $EmojiCompatType()); } - static final _init2 = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__init2") - .asFunction)>(); + static final _id_init2 = _class.staticMethodId( + r"init", + r"(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/emoji2/text/EmojiCompat;", + ); + + static final _init2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public androidx.emoji2.text.EmojiCompat init(androidx.emoji2.text.EmojiCompat.Config config) /// The returned object must be released after use, by calling the [release] method. @@ -1303,13 +1580,27 @@ class EmojiCompat extends jni.JObject { static EmojiCompat init2( EmojiCompat_Config config, ) { - return _init2(config.reference.pointer).object(const $EmojiCompatType()); + return _init2(_class.reference.pointer, _id_init2 as jni.JMethodIDPtr, + config.reference.pointer) + .object(const $EmojiCompatType()); } - static final _isConfigured = - jniLookup>( - "EmojiCompat__isConfigured") - .asFunction(); + static final _id_isConfigured = _class.staticMethodId( + r"isConfigured", + r"()Z", + ); + + static final _isConfigured = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallStaticBooleanMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: static public boolean isConfigured() /// @@ -1323,14 +1614,26 @@ class EmojiCompat extends jni.JObject { /// font is still loading, or has failed to load. ///@return true if EmojiCompat has been successfully initialized. static bool isConfigured() { - return _isConfigured().boolean; + return _isConfigured( + _class.reference.pointer, _id_isConfigured as jni.JMethodIDPtr) + .boolean; } - static final _reset = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__reset") - .asFunction)>(); + static final _id_reset = _class.staticMethodId( + r"reset", + r"(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/emoji2/text/EmojiCompat;", + ); + + static final _reset = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat.Config config) /// The returned object must be released after use, by calling the [release] method. @@ -1341,14 +1644,26 @@ class EmojiCompat extends jni.JObject { static EmojiCompat reset( EmojiCompat_Config config, ) { - return _reset(config.reference.pointer).object(const $EmojiCompatType()); + return _reset(_class.reference.pointer, _id_reset as jni.JMethodIDPtr, + config.reference.pointer) + .object(const $EmojiCompatType()); } - static final _reset1 = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__reset1") - .asFunction)>(); + static final _id_reset1 = _class.staticMethodId( + r"reset", + r"(Landroidx/emoji2/text/EmojiCompat;)Landroidx/emoji2/text/EmojiCompat;", + ); + + static final _reset1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat emojiCompat) /// The returned object must be released after use, by calling the [release] method. @@ -1358,14 +1673,25 @@ class EmojiCompat extends jni.JObject { static EmojiCompat reset1( EmojiCompat emojiCompat, ) { - return _reset1(emojiCompat.reference.pointer) + return _reset1(_class.reference.pointer, _id_reset1 as jni.JMethodIDPtr, + emojiCompat.reference.pointer) .object(const $EmojiCompatType()); } - static final _skipDefaultConfigurationLookup = - jniLookup>( - "EmojiCompat__skipDefaultConfigurationLookup") - .asFunction(); + static final _id_skipDefaultConfigurationLookup = _class.staticMethodId( + r"skipDefaultConfigurationLookup", + r"(Z)V", + ); + + static final _skipDefaultConfigurationLookup = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallStaticVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: static public void skipDefaultConfigurationLookup(boolean shouldSkip) /// @@ -1374,12 +1700,29 @@ class EmojiCompat extends jni.JObject { static void skipDefaultConfigurationLookup( bool shouldSkip, ) { - _skipDefaultConfigurationLookup(shouldSkip ? 1 : 0).check(); + _skipDefaultConfigurationLookup( + _class.reference.pointer, + _id_skipDefaultConfigurationLookup as jni.JMethodIDPtr, + shouldSkip ? 1 : 0) + .check(); } - static final _get0 = jniLookup>( - "EmojiCompat__get0") - .asFunction(); + static final _id_get0 = _class.staticMethodId( + r"get", + r"()Landroidx/emoji2/text/EmojiCompat;", + ); + + static final _get0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: static public androidx.emoji2.text.EmojiCompat get() /// The returned object must be released after use, by calling the [release] method. @@ -1389,17 +1732,25 @@ class EmojiCompat extends jni.JObject { ///@return EmojiCompat instance ///@throws IllegalStateException if called before \#init(EmojiCompat.Config) static EmojiCompat get0() { - return _get0().object(const $EmojiCompatType()); + return _get0(_class.reference.pointer, _id_get0 as jni.JMethodIDPtr) + .object(const $EmojiCompatType()); } - static final _load = jniLookup< + static final _id_load = _class.instanceMethodId( + r"load", + r"()V", + ); + + static final _load = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("EmojiCompat__load") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public void load() @@ -1418,16 +1769,24 @@ class EmojiCompat extends jni.JObject { ///@throws IllegalStateException when Config\#setMetadataLoadStrategy(int) is not set /// to \#LOAD_STRATEGY_MANUAL void load() { - _load(reference.pointer).check(); + _load(reference.pointer, _id_load as jni.JMethodIDPtr).check(); } - static final _registerInitCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__registerInitCallback") + static final _id_registerInitCallback = _class.instanceMethodId( + r"registerInitCallback", + r"(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V", + ); + + static final _registerInitCallback = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) /// @@ -1443,18 +1802,28 @@ class EmojiCompat extends jni.JObject { void registerInitCallback( EmojiCompat_InitCallback initCallback, ) { - _registerInitCallback(reference.pointer, initCallback.reference.pointer) + _registerInitCallback( + reference.pointer, + _id_registerInitCallback as jni.JMethodIDPtr, + initCallback.reference.pointer) .check(); } - static final _unregisterInitCallback = jniLookup< + static final _id_unregisterInitCallback = _class.instanceMethodId( + r"unregisterInitCallback", + r"(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V", + ); + + static final _unregisterInitCallback = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat__unregisterInitCallback") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) /// @@ -1463,18 +1832,28 @@ class EmojiCompat extends jni.JObject { void unregisterInitCallback( EmojiCompat_InitCallback initCallback, ) { - _unregisterInitCallback(reference.pointer, initCallback.reference.pointer) + _unregisterInitCallback( + reference.pointer, + _id_unregisterInitCallback as jni.JMethodIDPtr, + initCallback.reference.pointer) .check(); } - static final _getLoadState = jniLookup< + static final _id_getLoadState = _class.instanceMethodId( + r"getLoadState", + r"()I", + ); + + static final _getLoadState = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("EmojiCompat__getLoadState") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int getLoadState() @@ -1484,17 +1863,26 @@ class EmojiCompat extends jni.JObject { ///@return one of \#LOAD_STATE_DEFAULT, \#LOAD_STATE_LOADING, /// \#LOAD_STATE_SUCCEEDED, \#LOAD_STATE_FAILED int getLoadState() { - return _getLoadState(reference.pointer).integer; + return _getLoadState( + reference.pointer, _id_getLoadState as jni.JMethodIDPtr) + .integer; } - static final _isEmojiSpanIndicatorEnabled = jniLookup< + static final _id_isEmojiSpanIndicatorEnabled = _class.instanceMethodId( + r"isEmojiSpanIndicatorEnabled", + r"()Z", + ); + + static final _isEmojiSpanIndicatorEnabled = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("EmojiCompat__isEmojiSpanIndicatorEnabled") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean isEmojiSpanIndicatorEnabled() @@ -1502,17 +1890,26 @@ class EmojiCompat extends jni.JObject { /// @return whether a background should be drawn for the emoji for debugging ///@hide bool isEmojiSpanIndicatorEnabled() { - return _isEmojiSpanIndicatorEnabled(reference.pointer).boolean; + return _isEmojiSpanIndicatorEnabled(reference.pointer, + _id_isEmojiSpanIndicatorEnabled as jni.JMethodIDPtr) + .boolean; } - static final _getEmojiSpanIndicatorColor = jniLookup< + static final _id_getEmojiSpanIndicatorColor = _class.instanceMethodId( + r"getEmojiSpanIndicatorColor", + r"()I", + ); + + static final _getEmojiSpanIndicatorColor = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("EmojiCompat__getEmojiSpanIndicatorColor") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int getEmojiSpanIndicatorColor() @@ -1520,18 +1917,26 @@ class EmojiCompat extends jni.JObject { /// @return color of background drawn if EmojiCompat\#isEmojiSpanIndicatorEnabled is true ///@hide int getEmojiSpanIndicatorColor() { - return _getEmojiSpanIndicatorColor(reference.pointer).integer; + return _getEmojiSpanIndicatorColor(reference.pointer, + _id_getEmojiSpanIndicatorColor as jni.JMethodIDPtr) + .integer; } - static final _getEmojiStart = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__getEmojiStart") + static final _id_getEmojiStart = _class.instanceMethodId( + r"getEmojiStart", + r"(Ljava/lang/CharSequence;I)I", + ); + + static final _getEmojiStart = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, ffi.Int64)>)>>( + "globalEnv_CallIntMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); /// from: public int getEmojiStart(java.lang.CharSequence charSequence, int offset) /// @@ -1549,19 +1954,28 @@ class EmojiCompat extends jni.JObject { int offset, ) { return _getEmojiStart( - reference.pointer, charSequence.reference.pointer, offset) + reference.pointer, + _id_getEmojiStart as jni.JMethodIDPtr, + charSequence.reference.pointer, + offset) .integer; } - static final _getEmojiEnd = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__getEmojiEnd") + static final _id_getEmojiEnd = _class.instanceMethodId( + r"getEmojiEnd", + r"(Ljava/lang/CharSequence;I)I", + ); + + static final _getEmojiEnd = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, ffi.Int64)>)>>( + "globalEnv_CallIntMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); /// from: public int getEmojiEnd(java.lang.CharSequence charSequence, int offset) /// @@ -1570,17 +1984,29 @@ class EmojiCompat extends jni.JObject { jni.JObject charSequence, int offset, ) { - return _getEmojiEnd( - reference.pointer, charSequence.reference.pointer, offset) + return _getEmojiEnd(reference.pointer, _id_getEmojiEnd as jni.JMethodIDPtr, + charSequence.reference.pointer, offset) .integer; } - static final _handleOnKeyDown = jniLookup< + static final _id_handleOnKeyDown = _class.staticMethodId( + r"handleOnKeyDown", + r"(Landroid/text/Editable;ILandroid/view/KeyEvent;)Z", + ); + + static final _handleOnKeyDown = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Int32, - ffi.Pointer)>>("EmojiCompat__handleOnKeyDown") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Int64, + ffi.Pointer + )>)>>("globalEnv_CallStaticBooleanMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); /// from: static public boolean handleOnKeyDown(android.text.Editable editable, int keyCode, android.view.KeyEvent event) @@ -1607,20 +2033,34 @@ class EmojiCompat extends jni.JObject { jni.JObject event, ) { return _handleOnKeyDown( - editable.reference.pointer, keyCode, event.reference.pointer) + _class.reference.pointer, + _id_handleOnKeyDown as jni.JMethodIDPtr, + editable.reference.pointer, + keyCode, + event.reference.pointer) .boolean; } - static final _handleDeleteSurroundingText = jniLookup< + static final _id_handleDeleteSurroundingText = _class.staticMethodId( + r"handleDeleteSurroundingText", + r"(Landroid/view/inputmethod/InputConnection;Landroid/text/Editable;IIZ)Z", + ); + + static final _handleDeleteSurroundingText = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Uint8)>>("EmojiCompat__handleDeleteSurroundingText") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64 + )>)>>("globalEnv_CallStaticBooleanMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int, int, int)>(); /// from: static public boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection inputConnection, android.text.Editable editable, int beforeLength, int afterLength, boolean inCodePoints) @@ -1647,6 +2087,8 @@ class EmojiCompat extends jni.JObject { bool inCodePoints, ) { return _handleDeleteSurroundingText( + _class.reference.pointer, + _id_handleDeleteSurroundingText as jni.JMethodIDPtr, inputConnection.reference.pointer, editable.reference.pointer, beforeLength, @@ -1655,13 +2097,21 @@ class EmojiCompat extends jni.JObject { .boolean; } - static final _hasEmojiGlyph = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__hasEmojiGlyph") + static final _id_hasEmojiGlyph = _class.instanceMethodId( + r"hasEmojiGlyph", + r"(Ljava/lang/CharSequence;)Z", + ); + + static final _hasEmojiGlyph = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public boolean hasEmojiGlyph(java.lang.CharSequence sequence) /// @@ -1674,19 +2124,26 @@ class EmojiCompat extends jni.JObject { bool hasEmojiGlyph( jni.JObject sequence, ) { - return _hasEmojiGlyph(reference.pointer, sequence.reference.pointer) + return _hasEmojiGlyph(reference.pointer, + _id_hasEmojiGlyph as jni.JMethodIDPtr, sequence.reference.pointer) .boolean; } - static final _hasEmojiGlyph1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__hasEmojiGlyph1") + static final _id_hasEmojiGlyph1 = _class.instanceMethodId( + r"hasEmojiGlyph", + r"(Ljava/lang/CharSequence;I)Z", + ); + + static final _hasEmojiGlyph1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, ffi.Int64)>)>>( + "globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); /// from: public boolean hasEmojiGlyph(java.lang.CharSequence sequence, int metadataVersion) /// @@ -1703,19 +2160,28 @@ class EmojiCompat extends jni.JObject { int metadataVersion, ) { return _hasEmojiGlyph1( - reference.pointer, sequence.reference.pointer, metadataVersion) + reference.pointer, + _id_hasEmojiGlyph1 as jni.JMethodIDPtr, + sequence.reference.pointer, + metadataVersion) .boolean; } - static final _getEmojiMatch = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__getEmojiMatch") + static final _id_getEmojiMatch = _class.instanceMethodId( + r"getEmojiMatch", + r"(Ljava/lang/CharSequence;I)I", + ); + + static final _getEmojiMatch = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, ffi.Int64)>)>>( + "globalEnv_CallIntMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); /// from: public int getEmojiMatch(java.lang.CharSequence sequence, int metadataVersion) /// @@ -1735,17 +2201,28 @@ class EmojiCompat extends jni.JObject { int metadataVersion, ) { return _getEmojiMatch( - reference.pointer, sequence.reference.pointer, metadataVersion) + reference.pointer, + _id_getEmojiMatch as jni.JMethodIDPtr, + sequence.reference.pointer, + metadataVersion) .integer; } - static final _process = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__process") + static final _id_process = _class.instanceMethodId( + r"process", + r"(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;", + ); + + static final _process = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence) /// The returned object must be released after use, by calling the [release] method. @@ -1759,20 +2236,30 @@ class EmojiCompat extends jni.JObject { jni.JObject process( jni.JObject charSequence, ) { - return _process(reference.pointer, charSequence.reference.pointer) + return _process(reference.pointer, _id_process as jni.JMethodIDPtr, + charSequence.reference.pointer) .object(const jni.JObjectType()); } - static final _process1 = jniLookup< + static final _id_process1 = _class.instanceMethodId( + r"process", + r"(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;", + ); + + static final _process1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32)>>("EmojiCompat__process1") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Int64, + ffi.Int64 + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, int)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence, int start, int end) /// The returned object must be released after use, by calling the [release] method. @@ -1805,22 +2292,31 @@ class EmojiCompat extends jni.JObject { int start, int end, ) { - return _process1( - reference.pointer, charSequence.reference.pointer, start, end) + return _process1(reference.pointer, _id_process1 as jni.JMethodIDPtr, + charSequence.reference.pointer, start, end) .object(const jni.JObjectType()); } - static final _process2 = jniLookup< + static final _id_process2 = _class.instanceMethodId( + r"process", + r"(Ljava/lang/CharSequence;III)Ljava/lang/CharSequence;", + ); + + static final _process2 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("EmojiCompat__process2") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64 + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, int, int)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence, int start, int end, int maxEmojiCount) /// The returned object must be released after use, by calling the [release] method. @@ -1857,23 +2353,32 @@ class EmojiCompat extends jni.JObject { int end, int maxEmojiCount, ) { - return _process2(reference.pointer, charSequence.reference.pointer, start, - end, maxEmojiCount) + return _process2(reference.pointer, _id_process2 as jni.JMethodIDPtr, + charSequence.reference.pointer, start, end, maxEmojiCount) .object(const jni.JObjectType()); } - static final _process3 = jniLookup< + static final _id_process3 = _class.instanceMethodId( + r"process", + r"(Ljava/lang/CharSequence;IIII)Ljava/lang/CharSequence;", + ); + + static final _process3 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("EmojiCompat__process3") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ffi.Int64 + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - int, int, int, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, int, int, int)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence, int start, int end, int maxEmojiCount, int replaceStrategy) /// The returned object must be released after use, by calling the [release] method. @@ -1915,19 +2420,32 @@ class EmojiCompat extends jni.JObject { int maxEmojiCount, int replaceStrategy, ) { - return _process3(reference.pointer, charSequence.reference.pointer, start, - end, maxEmojiCount, replaceStrategy) + return _process3( + reference.pointer, + _id_process3 as jni.JMethodIDPtr, + charSequence.reference.pointer, + start, + end, + maxEmojiCount, + replaceStrategy) .object(const jni.JObjectType()); } - static final _getAssetSignature = jniLookup< + static final _id_getAssetSignature = _class.instanceMethodId( + r"getAssetSignature", + r"()Ljava/lang/String;", + ); + + static final _getAssetSignature = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("EmojiCompat__getAssetSignature") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getAssetSignature() @@ -1938,17 +2456,26 @@ class EmojiCompat extends jni.JObject { /// then previous executions. When used on devices running API 18 or below, returns empty string. ///@throws IllegalStateException if not initialized yet jni.JString getAssetSignature() { - return _getAssetSignature(reference.pointer) + return _getAssetSignature( + reference.pointer, _id_getAssetSignature as jni.JMethodIDPtr) .object(const jni.JStringType()); } - static final _updateEditorInfo = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__updateEditorInfo") + static final _id_updateEditorInfo = _class.instanceMethodId( + r"updateEditorInfo", + r"(Landroid/view/inputmethod/EditorInfo;)V", + ); + + static final _updateEditorInfo = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void updateEditorInfo(android.view.inputmethod.EditorInfo outAttrs) /// @@ -1970,7 +2497,11 @@ class EmojiCompat extends jni.JObject { void updateEditorInfo( jni.JObject outAttrs, ) { - _updateEditorInfo(reference.pointer, outAttrs.reference.pointer).check(); + _updateEditorInfo( + reference.pointer, + _id_updateEditorInfo as jni.JMethodIDPtr, + outAttrs.reference.pointer) + .check(); } } @@ -2015,14 +2546,26 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); + /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0") - .asFunction)>(); + static final _id_new0 = _class.constructorId( + r"(Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void (androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigHelper helper) /// The returned object must be released after use, by calling the [release] method. @@ -2032,17 +2575,26 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper helper, ) { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory - .fromReference(_new0(helper.reference.pointer).reference); + .fromReference(_new0(_class.reference.pointer, + _id_new0 as jni.JMethodIDPtr, helper.reference.pointer) + .reference); } - static final _create = jniLookup< + static final _id_create = _class.instanceMethodId( + r"create", + r"(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat$Config;", + ); + + static final _create = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config create(android.content.Context context) /// The returned object must be released after use, by calling the [release] method. @@ -2052,7 +2604,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory EmojiCompat_Config create( jni.JObject context, ) { - return _create(reference.pointer, context.reference.pointer) + return _create(reference.pointer, _id_create as jni.JMethodIDPtr, + context.reference.pointer) .object(const $EmojiCompat_ConfigType()); } } @@ -2105,28 +2658,55 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper"); + /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); - static final _new0 = jniLookup>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper - .fromReference(_new0().reference); + .fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _getSigningSignatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures") + static final _id_getSigningSignatures = _class.instanceMethodId( + r"getSigningSignatures", + r"(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/content/pm/Signature;", + ); + + static final _getSigningSignatures = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String providerPackage) /// The returned object must be released after use, by calling the [release] method. @@ -2136,22 +2716,33 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper jni.JObject packageManager, jni.JString providerPackage, ) { - return _getSigningSignatures(reference.pointer, - packageManager.reference.pointer, providerPackage.reference.pointer) + return _getSigningSignatures( + reference.pointer, + _id_getSigningSignatures as jni.JMethodIDPtr, + packageManager.reference.pointer, + providerPackage.reference.pointer) .object(const jni.JArrayType(jni.JObjectType())); } - static final _queryIntentContentProviders = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders") + static final _id_queryIntentContentProviders = _class.instanceMethodId( + r"queryIntentContentProviders", + r"(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/util/List;", + ); + + static final _queryIntentContentProviders = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Int64 + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer, int)>(); /// from: public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int flags) /// The returned object must be released after use, by calling the [release] method. @@ -2162,19 +2753,30 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper jni.JObject intent, int flags, ) { - return _queryIntentContentProviders(reference.pointer, - packageManager.reference.pointer, intent.reference.pointer, flags) + return _queryIntentContentProviders( + reference.pointer, + _id_queryIntentContentProviders as jni.JMethodIDPtr, + packageManager.reference.pointer, + intent.reference.pointer, + flags) .object(const jni.JListType(jni.JObjectType())); } - static final _getProviderInfo = jniLookup< + static final _id_getProviderInfo = _class.instanceMethodId( + r"getProviderInfo", + r"(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;", + ); + + static final _getProviderInfo = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo) /// The returned object must be released after use, by calling the [release] method. @@ -2185,7 +2787,10 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper jni.JObject getProviderInfo( jni.JObject resolveInfo, ) { - return _getProviderInfo(reference.pointer, resolveInfo.reference.pointer) + return _getProviderInfo( + reference.pointer, + _id_getProviderInfo as jni.JMethodIDPtr, + resolveInfo.reference.pointer) .object(const jni.JObjectType()); } } @@ -2238,31 +2843,56 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); + /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); - static final _new0 = jniLookup>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 - .fromReference(_new0().reference); + .fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _queryIntentContentProviders = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders") + static final _id_queryIntentContentProviders = _class.instanceMethodId( + r"queryIntentContentProviders", + r"(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/util/List;", + ); + + static final _queryIntentContentProviders = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Int64 + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer, int)>(); /// from: public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int flags) /// The returned object must be released after use, by calling the [release] method. @@ -2271,26 +2901,40 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 jni.JObject intent, int flags, ) { - return _queryIntentContentProviders(reference.pointer, - packageManager.reference.pointer, intent.reference.pointer, flags) + return _queryIntentContentProviders( + reference.pointer, + _id_queryIntentContentProviders as jni.JMethodIDPtr, + packageManager.reference.pointer, + intent.reference.pointer, + flags) .object(const jni.JListType(jni.JObjectType())); } - static final _getProviderInfo = jniLookup< + static final _id_getProviderInfo = _class.instanceMethodId( + r"getProviderInfo", + r"(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;", + ); + + static final _getProviderInfo = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo) /// The returned object must be released after use, by calling the [release] method. jni.JObject getProviderInfo( jni.JObject resolveInfo, ) { - return _getProviderInfo(reference.pointer, resolveInfo.reference.pointer) + return _getProviderInfo( + reference.pointer, + _id_getProviderInfo as jni.JMethodIDPtr, + resolveInfo.reference.pointer) .object(const jni.JObjectType()); } } @@ -2346,28 +2990,55 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName( + r"androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28"); + /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); - static final _new0 = jniLookup>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 - .fromReference(_new0().reference); + .fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _getSigningSignatures1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1") + static final _id_getSigningSignatures1 = _class.instanceMethodId( + r"getSigningSignatures", + r"(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/content/pm/Signature;", + ); + + static final _getSigningSignatures1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String providerPackage) /// The returned object must be released after use, by calling the [release] method. @@ -2375,8 +3046,11 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 jni.JObject packageManager, jni.JString providerPackage, ) { - return _getSigningSignatures1(reference.pointer, - packageManager.reference.pointer, providerPackage.reference.pointer) + return _getSigningSignatures1( + reference.pointer, + _id_getSigningSignatures1 as jni.JMethodIDPtr, + packageManager.reference.pointer, + providerPackage.reference.pointer) .object(const jni.JArrayType(jni.JObjectType())); } } @@ -2461,13 +3135,26 @@ class DefaultEmojiCompatConfig extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"androidx/emoji2/text/DefaultEmojiCompatConfig"); + /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfigType(); - static final _create = jniLookup< - ffi - .NativeFunction)>>( - "DefaultEmojiCompatConfig__create") - .asFunction)>(); + static final _id_create = _class.staticMethodId( + r"create", + r"(Landroid/content/Context;)Landroidx/emoji2/text/FontRequestEmojiCompatConfig;", + ); + + static final _create = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public androidx.emoji2.text.FontRequestEmojiCompatConfig create(android.content.Context context) /// The returned object must be released after use, by calling the [release] method. @@ -2484,7 +3171,9 @@ class DefaultEmojiCompatConfig extends jni.JObject { static jni.JObject create( jni.JObject context, ) { - return _create(context.reference.pointer).object(const jni.JObjectType()); + return _create(_class.reference.pointer, _id_create as jni.JMethodIDPtr, + context.reference.pointer) + .object(const jni.JObjectType()); } } @@ -2524,93 +3213,139 @@ class Build_Partition extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"android/os/Build$Partition"); + /// The type which includes information such as the signature of this class. static const type = $Build_PartitionType(); - static final _get_PARTITION_NAME_SYSTEM = - jniLookup>( - "get_Build_Partition__PARTITION_NAME_SYSTEM") - .asFunction(); + static final _id_PARTITION_NAME_SYSTEM = _class.staticFieldId( + r"PARTITION_NAME_SYSTEM", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String PARTITION_NAME_SYSTEM /// The returned object must be released after use, by calling the [release] method. static jni.JString get PARTITION_NAME_SYSTEM => - _get_PARTITION_NAME_SYSTEM().object(const jni.JStringType()); + _id_PARTITION_NAME_SYSTEM.get(_class, const jni.JStringType()); - static final _getName = jniLookup< + static final _id_getName = _class.instanceMethodId( + r"getName", + r"()Ljava/lang/String;", + ); + + static final _getName = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("Build_Partition__getName") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getName() /// The returned object must be released after use, by calling the [release] method. jni.JString getName() { - return _getName(reference.pointer).object(const jni.JStringType()); + return _getName(reference.pointer, _id_getName as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _getFingerprint = jniLookup< + static final _id_getFingerprint = _class.instanceMethodId( + r"getFingerprint", + r"()Ljava/lang/String;", + ); + + static final _getFingerprint = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("Build_Partition__getFingerprint") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getFingerprint() /// The returned object must be released after use, by calling the [release] method. jni.JString getFingerprint() { - return _getFingerprint(reference.pointer).object(const jni.JStringType()); + return _getFingerprint( + reference.pointer, _id_getFingerprint as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _getBuildTimeMillis = jniLookup< + static final _id_getBuildTimeMillis = _class.instanceMethodId( + r"getBuildTimeMillis", + r"()J", + ); + + static final _getBuildTimeMillis = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("Build_Partition__getBuildTimeMillis") + jni.JMethodIDPtr, + )>>("globalEnv_CallLongMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public long getBuildTimeMillis() int getBuildTimeMillis() { - return _getBuildTimeMillis(reference.pointer).long; + return _getBuildTimeMillis( + reference.pointer, _id_getBuildTimeMillis as jni.JMethodIDPtr) + .long; } - static final _equals = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("Build_Partition__equals") + static final _id_equals = _class.instanceMethodId( + r"equals", + r"(Ljava/lang/Object;)Z", + ); + + static final _equals = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public boolean equals(java.lang.Object object) bool equals( jni.JObject object, ) { - return _equals(reference.pointer, object.reference.pointer).boolean; + return _equals(reference.pointer, _id_equals as jni.JMethodIDPtr, + object.reference.pointer) + .boolean; } - static final _hashCode1 = jniLookup< + static final _id_hashCode1 = _class.instanceMethodId( + r"hashCode", + r"()I", + ); + + static final _hashCode1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("Build_Partition__hashCode1") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int hashCode() int hashCode1() { - return _hashCode1(reference.pointer).integer; + return _hashCode1(reference.pointer, _id_hashCode1 as jni.JMethodIDPtr) + .integer; } } @@ -2649,120 +3384,137 @@ class Build_VERSION extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"android/os/Build$VERSION"); + /// The type which includes information such as the signature of this class. static const type = $Build_VERSIONType(); - static final _get_BASE_OS = - jniLookup>( - "get_Build_VERSION__BASE_OS") - .asFunction(); + static final _id_BASE_OS = _class.staticFieldId( + r"BASE_OS", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String BASE_OS /// The returned object must be released after use, by calling the [release] method. static jni.JString get BASE_OS => - _get_BASE_OS().object(const jni.JStringType()); + _id_BASE_OS.get(_class, const jni.JStringType()); - static final _get_CODENAME = - jniLookup>( - "get_Build_VERSION__CODENAME") - .asFunction(); + static final _id_CODENAME = _class.staticFieldId( + r"CODENAME", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String CODENAME /// The returned object must be released after use, by calling the [release] method. static jni.JString get CODENAME => - _get_CODENAME().object(const jni.JStringType()); + _id_CODENAME.get(_class, const jni.JStringType()); - static final _get_INCREMENTAL = - jniLookup>( - "get_Build_VERSION__INCREMENTAL") - .asFunction(); + static final _id_INCREMENTAL = _class.staticFieldId( + r"INCREMENTAL", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String INCREMENTAL /// The returned object must be released after use, by calling the [release] method. static jni.JString get INCREMENTAL => - _get_INCREMENTAL().object(const jni.JStringType()); + _id_INCREMENTAL.get(_class, const jni.JStringType()); - static final _get_MEDIA_PERFORMANCE_CLASS = - jniLookup>( - "get_Build_VERSION__MEDIA_PERFORMANCE_CLASS") - .asFunction(); + static final _id_MEDIA_PERFORMANCE_CLASS = _class.staticFieldId( + r"MEDIA_PERFORMANCE_CLASS", + r"I", + ); /// from: static public final int MEDIA_PERFORMANCE_CLASS static int get MEDIA_PERFORMANCE_CLASS => - _get_MEDIA_PERFORMANCE_CLASS().integer; + _id_MEDIA_PERFORMANCE_CLASS.get(_class, const jni.jintType()); - static final _get_PREVIEW_SDK_INT = - jniLookup>( - "get_Build_VERSION__PREVIEW_SDK_INT") - .asFunction(); + static final _id_PREVIEW_SDK_INT = _class.staticFieldId( + r"PREVIEW_SDK_INT", + r"I", + ); /// from: static public final int PREVIEW_SDK_INT - static int get PREVIEW_SDK_INT => _get_PREVIEW_SDK_INT().integer; + static int get PREVIEW_SDK_INT => + _id_PREVIEW_SDK_INT.get(_class, const jni.jintType()); - static final _get_RELEASE = - jniLookup>( - "get_Build_VERSION__RELEASE") - .asFunction(); + static final _id_RELEASE = _class.staticFieldId( + r"RELEASE", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String RELEASE /// The returned object must be released after use, by calling the [release] method. static jni.JString get RELEASE => - _get_RELEASE().object(const jni.JStringType()); + _id_RELEASE.get(_class, const jni.JStringType()); - static final _get_RELEASE_OR_CODENAME = - jniLookup>( - "get_Build_VERSION__RELEASE_OR_CODENAME") - .asFunction(); + static final _id_RELEASE_OR_CODENAME = _class.staticFieldId( + r"RELEASE_OR_CODENAME", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String RELEASE_OR_CODENAME /// The returned object must be released after use, by calling the [release] method. static jni.JString get RELEASE_OR_CODENAME => - _get_RELEASE_OR_CODENAME().object(const jni.JStringType()); + _id_RELEASE_OR_CODENAME.get(_class, const jni.JStringType()); - static final _get_RELEASE_OR_PREVIEW_DISPLAY = - jniLookup>( - "get_Build_VERSION__RELEASE_OR_PREVIEW_DISPLAY") - .asFunction(); + static final _id_RELEASE_OR_PREVIEW_DISPLAY = _class.staticFieldId( + r"RELEASE_OR_PREVIEW_DISPLAY", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String RELEASE_OR_PREVIEW_DISPLAY /// The returned object must be released after use, by calling the [release] method. static jni.JString get RELEASE_OR_PREVIEW_DISPLAY => - _get_RELEASE_OR_PREVIEW_DISPLAY().object(const jni.JStringType()); + _id_RELEASE_OR_PREVIEW_DISPLAY.get(_class, const jni.JStringType()); - static final _get_SDK = - jniLookup>( - "get_Build_VERSION__SDK") - .asFunction(); + static final _id_SDK = _class.staticFieldId( + r"SDK", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String SDK /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SDK => _get_SDK().object(const jni.JStringType()); + static jni.JString get SDK => _id_SDK.get(_class, const jni.JStringType()); - static final _get_SDK_INT = - jniLookup>( - "get_Build_VERSION__SDK_INT") - .asFunction(); + static final _id_SDK_INT = _class.staticFieldId( + r"SDK_INT", + r"I", + ); /// from: static public final int SDK_INT - static int get SDK_INT => _get_SDK_INT().integer; + static int get SDK_INT => _id_SDK_INT.get(_class, const jni.jintType()); - static final _get_SECURITY_PATCH = - jniLookup>( - "get_Build_VERSION__SECURITY_PATCH") - .asFunction(); + static final _id_SECURITY_PATCH = _class.staticFieldId( + r"SECURITY_PATCH", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String SECURITY_PATCH /// The returned object must be released after use, by calling the [release] method. static jni.JString get SECURITY_PATCH => - _get_SECURITY_PATCH().object(const jni.JStringType()); + _id_SECURITY_PATCH.get(_class, const jni.JStringType()); - static final _new0 = jniLookup>( - "Build_VERSION__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION() { - return Build_VERSION.fromReference(_new0().reference); + return Build_VERSION.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } } @@ -2801,6 +3553,8 @@ class Build_VERSION_CODES extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"android/os/Build$VERSION_CODES"); + /// The type which includes information such as the signature of this class. static const type = $Build_VERSION_CODESType(); @@ -2905,14 +3659,28 @@ class Build_VERSION_CODES extends jni.JObject { /// from: static public final int TIRAMISU static const TIRAMISU = 33; - static final _new0 = jniLookup>( - "Build_VERSION_CODES__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION_CODES() { - return Build_VERSION_CODES.fromReference(_new0().reference); + return Build_VERSION_CODES.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } } @@ -2951,313 +3719,381 @@ class Build extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"android/os/Build"); + /// The type which includes information such as the signature of this class. static const type = $BuildType(); - static final _get_BOARD = - jniLookup>( - "get_Build__BOARD") - .asFunction(); + static final _id_BOARD = _class.staticFieldId( + r"BOARD", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String BOARD /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BOARD => _get_BOARD().object(const jni.JStringType()); + static jni.JString get BOARD => + _id_BOARD.get(_class, const jni.JStringType()); - static final _get_BOOTLOADER = - jniLookup>( - "get_Build__BOOTLOADER") - .asFunction(); + static final _id_BOOTLOADER = _class.staticFieldId( + r"BOOTLOADER", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String BOOTLOADER /// The returned object must be released after use, by calling the [release] method. static jni.JString get BOOTLOADER => - _get_BOOTLOADER().object(const jni.JStringType()); + _id_BOOTLOADER.get(_class, const jni.JStringType()); - static final _get_BRAND = - jniLookup>( - "get_Build__BRAND") - .asFunction(); + static final _id_BRAND = _class.staticFieldId( + r"BRAND", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String BRAND /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BRAND => _get_BRAND().object(const jni.JStringType()); + static jni.JString get BRAND => + _id_BRAND.get(_class, const jni.JStringType()); - static final _get_CPU_ABI = - jniLookup>( - "get_Build__CPU_ABI") - .asFunction(); + static final _id_CPU_ABI = _class.staticFieldId( + r"CPU_ABI", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String CPU_ABI /// The returned object must be released after use, by calling the [release] method. static jni.JString get CPU_ABI => - _get_CPU_ABI().object(const jni.JStringType()); + _id_CPU_ABI.get(_class, const jni.JStringType()); - static final _get_CPU_ABI2 = - jniLookup>( - "get_Build__CPU_ABI2") - .asFunction(); + static final _id_CPU_ABI2 = _class.staticFieldId( + r"CPU_ABI2", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String CPU_ABI2 /// The returned object must be released after use, by calling the [release] method. static jni.JString get CPU_ABI2 => - _get_CPU_ABI2().object(const jni.JStringType()); + _id_CPU_ABI2.get(_class, const jni.JStringType()); - static final _get_DEVICE = - jniLookup>( - "get_Build__DEVICE") - .asFunction(); + static final _id_DEVICE = _class.staticFieldId( + r"DEVICE", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String DEVICE /// The returned object must be released after use, by calling the [release] method. static jni.JString get DEVICE => - _get_DEVICE().object(const jni.JStringType()); + _id_DEVICE.get(_class, const jni.JStringType()); - static final _get_DISPLAY = - jniLookup>( - "get_Build__DISPLAY") - .asFunction(); + static final _id_DISPLAY = _class.staticFieldId( + r"DISPLAY", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String DISPLAY /// The returned object must be released after use, by calling the [release] method. static jni.JString get DISPLAY => - _get_DISPLAY().object(const jni.JStringType()); + _id_DISPLAY.get(_class, const jni.JStringType()); - static final _get_FINGERPRINT = - jniLookup>( - "get_Build__FINGERPRINT") - .asFunction(); + static final _id_FINGERPRINT = _class.staticFieldId( + r"FINGERPRINT", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String FINGERPRINT /// The returned object must be released after use, by calling the [release] method. static jni.JString get FINGERPRINT => - _get_FINGERPRINT().object(const jni.JStringType()); + _id_FINGERPRINT.get(_class, const jni.JStringType()); - static final _get_HARDWARE = - jniLookup>( - "get_Build__HARDWARE") - .asFunction(); + static final _id_HARDWARE = _class.staticFieldId( + r"HARDWARE", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String HARDWARE /// The returned object must be released after use, by calling the [release] method. static jni.JString get HARDWARE => - _get_HARDWARE().object(const jni.JStringType()); + _id_HARDWARE.get(_class, const jni.JStringType()); - static final _get_HOST = - jniLookup>("get_Build__HOST") - .asFunction(); + static final _id_HOST = _class.staticFieldId( + r"HOST", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String HOST /// The returned object must be released after use, by calling the [release] method. - static jni.JString get HOST => _get_HOST().object(const jni.JStringType()); + static jni.JString get HOST => _id_HOST.get(_class, const jni.JStringType()); - static final _get_ID = - jniLookup>("get_Build__ID") - .asFunction(); + static final _id_ID = _class.staticFieldId( + r"ID", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String ID /// The returned object must be released after use, by calling the [release] method. - static jni.JString get ID => _get_ID().object(const jni.JStringType()); + static jni.JString get ID => _id_ID.get(_class, const jni.JStringType()); - static final _get_MANUFACTURER = - jniLookup>( - "get_Build__MANUFACTURER") - .asFunction(); + static final _id_MANUFACTURER = _class.staticFieldId( + r"MANUFACTURER", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String MANUFACTURER /// The returned object must be released after use, by calling the [release] method. static jni.JString get MANUFACTURER => - _get_MANUFACTURER().object(const jni.JStringType()); + _id_MANUFACTURER.get(_class, const jni.JStringType()); - static final _get_MODEL = - jniLookup>( - "get_Build__MODEL") - .asFunction(); + static final _id_MODEL = _class.staticFieldId( + r"MODEL", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String MODEL /// The returned object must be released after use, by calling the [release] method. - static jni.JString get MODEL => _get_MODEL().object(const jni.JStringType()); + static jni.JString get MODEL => + _id_MODEL.get(_class, const jni.JStringType()); - static final _get_ODM_SKU = - jniLookup>( - "get_Build__ODM_SKU") - .asFunction(); + static final _id_ODM_SKU = _class.staticFieldId( + r"ODM_SKU", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String ODM_SKU /// The returned object must be released after use, by calling the [release] method. static jni.JString get ODM_SKU => - _get_ODM_SKU().object(const jni.JStringType()); + _id_ODM_SKU.get(_class, const jni.JStringType()); - static final _get_PRODUCT = - jniLookup>( - "get_Build__PRODUCT") - .asFunction(); + static final _id_PRODUCT = _class.staticFieldId( + r"PRODUCT", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String PRODUCT /// The returned object must be released after use, by calling the [release] method. static jni.JString get PRODUCT => - _get_PRODUCT().object(const jni.JStringType()); + _id_PRODUCT.get(_class, const jni.JStringType()); - static final _get_RADIO = - jniLookup>( - "get_Build__RADIO") - .asFunction(); + static final _id_RADIO = _class.staticFieldId( + r"RADIO", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String RADIO /// The returned object must be released after use, by calling the [release] method. - static jni.JString get RADIO => _get_RADIO().object(const jni.JStringType()); + static jni.JString get RADIO => + _id_RADIO.get(_class, const jni.JStringType()); - static final _get_SERIAL = - jniLookup>( - "get_Build__SERIAL") - .asFunction(); + static final _id_SERIAL = _class.staticFieldId( + r"SERIAL", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String SERIAL /// The returned object must be released after use, by calling the [release] method. static jni.JString get SERIAL => - _get_SERIAL().object(const jni.JStringType()); + _id_SERIAL.get(_class, const jni.JStringType()); - static final _get_SKU = - jniLookup>("get_Build__SKU") - .asFunction(); + static final _id_SKU = _class.staticFieldId( + r"SKU", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String SKU /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SKU => _get_SKU().object(const jni.JStringType()); + static jni.JString get SKU => _id_SKU.get(_class, const jni.JStringType()); - static final _get_SOC_MANUFACTURER = - jniLookup>( - "get_Build__SOC_MANUFACTURER") - .asFunction(); + static final _id_SOC_MANUFACTURER = _class.staticFieldId( + r"SOC_MANUFACTURER", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String SOC_MANUFACTURER /// The returned object must be released after use, by calling the [release] method. static jni.JString get SOC_MANUFACTURER => - _get_SOC_MANUFACTURER().object(const jni.JStringType()); + _id_SOC_MANUFACTURER.get(_class, const jni.JStringType()); - static final _get_SOC_MODEL = - jniLookup>( - "get_Build__SOC_MODEL") - .asFunction(); + static final _id_SOC_MODEL = _class.staticFieldId( + r"SOC_MODEL", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String SOC_MODEL /// The returned object must be released after use, by calling the [release] method. static jni.JString get SOC_MODEL => - _get_SOC_MODEL().object(const jni.JStringType()); + _id_SOC_MODEL.get(_class, const jni.JStringType()); - static final _get_SUPPORTED_32_BIT_ABIS = - jniLookup>( - "get_Build__SUPPORTED_32_BIT_ABIS") - .asFunction(); + static final _id_SUPPORTED_32_BIT_ABIS = _class.staticFieldId( + r"SUPPORTED_32_BIT_ABIS", + r"[Ljava/lang/String;", + ); /// from: static public final java.lang.String[] SUPPORTED_32_BIT_ABIS /// The returned object must be released after use, by calling the [release] method. static jni.JArray get SUPPORTED_32_BIT_ABIS => - _get_SUPPORTED_32_BIT_ABIS() - .object(const jni.JArrayType(jni.JStringType())); + _id_SUPPORTED_32_BIT_ABIS.get( + _class, const jni.JArrayType(jni.JStringType())); - static final _get_SUPPORTED_64_BIT_ABIS = - jniLookup>( - "get_Build__SUPPORTED_64_BIT_ABIS") - .asFunction(); + static final _id_SUPPORTED_64_BIT_ABIS = _class.staticFieldId( + r"SUPPORTED_64_BIT_ABIS", + r"[Ljava/lang/String;", + ); /// from: static public final java.lang.String[] SUPPORTED_64_BIT_ABIS /// The returned object must be released after use, by calling the [release] method. static jni.JArray get SUPPORTED_64_BIT_ABIS => - _get_SUPPORTED_64_BIT_ABIS() - .object(const jni.JArrayType(jni.JStringType())); + _id_SUPPORTED_64_BIT_ABIS.get( + _class, const jni.JArrayType(jni.JStringType())); - static final _get_SUPPORTED_ABIS = - jniLookup>( - "get_Build__SUPPORTED_ABIS") - .asFunction(); + static final _id_SUPPORTED_ABIS = _class.staticFieldId( + r"SUPPORTED_ABIS", + r"[Ljava/lang/String;", + ); /// from: static public final java.lang.String[] SUPPORTED_ABIS /// The returned object must be released after use, by calling the [release] method. static jni.JArray get SUPPORTED_ABIS => - _get_SUPPORTED_ABIS().object(const jni.JArrayType(jni.JStringType())); + _id_SUPPORTED_ABIS.get(_class, const jni.JArrayType(jni.JStringType())); - static final _get_TAGS = - jniLookup>("get_Build__TAGS") - .asFunction(); + static final _id_TAGS = _class.staticFieldId( + r"TAGS", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String TAGS /// The returned object must be released after use, by calling the [release] method. - static jni.JString get TAGS => _get_TAGS().object(const jni.JStringType()); + static jni.JString get TAGS => _id_TAGS.get(_class, const jni.JStringType()); - static final _get_TIME = - jniLookup>("get_Build__TIME") - .asFunction(); + static final _id_TIME = _class.staticFieldId( + r"TIME", + r"J", + ); /// from: static public final long TIME - static int get TIME => _get_TIME().long; + static int get TIME => _id_TIME.get(_class, const jni.jlongType()); - static final _get_TYPE = - jniLookup>("get_Build__TYPE") - .asFunction(); + static final _id_TYPE = _class.staticFieldId( + r"TYPE", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String TYPE /// The returned object must be released after use, by calling the [release] method. - static jni.JString get TYPE => _get_TYPE().object(const jni.JStringType()); + static jni.JString get TYPE => _id_TYPE.get(_class, const jni.JStringType()); - static final _get_UNKNOWN = - jniLookup>( - "get_Build__UNKNOWN") - .asFunction(); + static final _id_UNKNOWN = _class.staticFieldId( + r"UNKNOWN", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String UNKNOWN /// The returned object must be released after use, by calling the [release] method. static jni.JString get UNKNOWN => - _get_UNKNOWN().object(const jni.JStringType()); + _id_UNKNOWN.get(_class, const jni.JStringType()); - static final _get_USER = - jniLookup>("get_Build__USER") - .asFunction(); + static final _id_USER = _class.staticFieldId( + r"USER", + r"Ljava/lang/String;", + ); /// from: static public final java.lang.String USER /// The returned object must be released after use, by calling the [release] method. - static jni.JString get USER => _get_USER().object(const jni.JStringType()); + static jni.JString get USER => _id_USER.get(_class, const jni.JStringType()); + + static final _id_new0 = _class.constructorId( + r"()V", + ); - static final _new0 = - jniLookup>("Build__new0") - .asFunction(); + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory Build() { - return Build.fromReference(_new0().reference); + return Build.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _getSerial = - jniLookup>( - "Build__getSerial") - .asFunction(); + static final _id_getSerial = _class.staticMethodId( + r"getSerial", + r"()Ljava/lang/String;", + ); + + static final _getSerial = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: static public java.lang.String getSerial() /// The returned object must be released after use, by calling the [release] method. static jni.JString getSerial() { - return _getSerial().object(const jni.JStringType()); + return _getSerial( + _class.reference.pointer, _id_getSerial as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _getFingerprintedPartitions = - jniLookup>( - "Build__getFingerprintedPartitions") - .asFunction(); + static final _id_getFingerprintedPartitions = _class.staticMethodId( + r"getFingerprintedPartitions", + r"()Ljava/util/List;", + ); + + static final _getFingerprintedPartitions = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: static public java.util.List getFingerprintedPartitions() /// The returned object must be released after use, by calling the [release] method. static jni.JList getFingerprintedPartitions() { - return _getFingerprintedPartitions() + return _getFingerprintedPartitions(_class.reference.pointer, + _id_getFingerprintedPartitions as jni.JMethodIDPtr) .object(const jni.JListType($Build_PartitionType())); } - static final _getRadioVersion = - jniLookup>( - "Build__getRadioVersion") - .asFunction(); + static final _id_getRadioVersion = _class.staticMethodId( + r"getRadioVersion", + r"()Ljava/lang/String;", + ); + + static final _getRadioVersion = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: static public java.lang.String getRadioVersion() /// The returned object must be released after use, by calling the [release] method. static jni.JString getRadioVersion() { - return _getRadioVersion().object(const jni.JStringType()); + return _getRadioVersion( + _class.reference.pointer, _id_getRadioVersion as jni.JMethodIDPtr) + .object(const jni.JStringType()); } } @@ -3301,6 +4137,8 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"java/util/HashMap"); + /// The type which includes information such as the signature of this class. static $HashMapType<$K, $V> type<$K extends jni.JObject, $V extends jni.JObject>( @@ -3313,10 +4151,17 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> ); } - static final _new0 = jniLookup< - ffi.NativeFunction>( - "HashMap__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"(IF)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64, ffi.Double)>)>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int, double)>(); /// from: public void (int i, float f) /// The returned object must be released after use, by calling the [release] method. @@ -3326,13 +4171,24 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return HashMap.fromReference(K, V, _new0(i, f).reference); + return HashMap.fromReference( + K, + V, + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr, i, f) + .reference); } - static final _new1 = - jniLookup>( - "HashMap__new1") - .asFunction(); + static final _id_new1 = _class.constructorId( + r"(I)V", + ); + + static final _new1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void (int i) /// The returned object must be released after use, by calling the [release] method. @@ -3341,12 +4197,28 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return HashMap.fromReference(K, V, _new1(i).reference); + return HashMap.fromReference( + K, + V, + _new1(_class.reference.pointer, _id_new1 as jni.JMethodIDPtr, i) + .reference); } - static final _new2 = - jniLookup>("HashMap__new2") - .asFunction(); + static final _id_new2 = _class.constructorId( + r"()V", + ); + + static final _new2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. @@ -3354,13 +4226,27 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return HashMap.fromReference(K, V, _new2().reference); + return HashMap.fromReference( + K, + V, + _new2(_class.reference.pointer, _id_new2 as jni.JMethodIDPtr) + .reference); } - static final _new3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("HashMap__new3") - .asFunction)>(); + static final _id_new3 = _class.constructorId( + r"(Ljava/util/Map;)V", + ); + + static final _new3 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void (java.util.Map map) /// The returned object must be released after use, by calling the [release] method. @@ -3375,79 +4261,127 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> V ??= jni.lowestCommonSuperType([ (map.$type as jni.JMapType).V, ]) as jni.JObjType<$V>; - return HashMap.fromReference(K, V, _new3(map.reference.pointer).reference); + return HashMap.fromReference( + K, + V, + _new3(_class.reference.pointer, _id_new3 as jni.JMethodIDPtr, + map.reference.pointer) + .reference); } - static final _size = jniLookup< + static final _id_size = _class.instanceMethodId( + r"size", + r"()I", + ); + + static final _size = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("HashMap__size") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int size() int size() { - return _size(reference.pointer).integer; + return _size(reference.pointer, _id_size as jni.JMethodIDPtr).integer; } - static final _isEmpty = jniLookup< + static final _id_isEmpty = _class.instanceMethodId( + r"isEmpty", + r"()Z", + ); + + static final _isEmpty = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("HashMap__isEmpty") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean isEmpty() bool isEmpty() { - return _isEmpty(reference.pointer).boolean; + return _isEmpty(reference.pointer, _id_isEmpty as jni.JMethodIDPtr).boolean; } - static final _get0 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__get0") + static final _id_get0 = _class.instanceMethodId( + r"get", + r"(Ljava/lang/Object;)Ljava/lang/Object;", + ); + + static final _get0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public V get(java.lang.Object object) /// The returned object must be released after use, by calling the [release] method. $V get0( jni.JObject object, ) { - return _get0(reference.pointer, object.reference.pointer).object(V); + return _get0(reference.pointer, _id_get0 as jni.JMethodIDPtr, + object.reference.pointer) + .object(V); } - static final _containsKey = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__containsKey") + static final _id_containsKey = _class.instanceMethodId( + r"containsKey", + r"(Ljava/lang/Object;)Z", + ); + + static final _containsKey = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public boolean containsKey(java.lang.Object object) bool containsKey( jni.JObject object, ) { - return _containsKey(reference.pointer, object.reference.pointer).boolean; + return _containsKey(reference.pointer, _id_containsKey as jni.JMethodIDPtr, + object.reference.pointer) + .boolean; } - static final _put = jniLookup< + static final _id_put = _class.instanceMethodId( + r"put", + r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", + ); + + static final _put = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__put") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V put(K object, V object1) /// The returned object must be released after use, by calling the [release] method. @@ -3455,130 +4389,199 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, $V object1, ) { - return _put(reference.pointer, object.reference.pointer, - object1.reference.pointer) + return _put(reference.pointer, _id_put as jni.JMethodIDPtr, + object.reference.pointer, object1.reference.pointer) .object(V); } - static final _putAll = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__putAll") + static final _id_putAll = _class.instanceMethodId( + r"putAll", + r"(Ljava/util/Map;)V", + ); + + static final _putAll = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void putAll(java.util.Map map) void putAll( jni.JMap<$K, $V> map, ) { - _putAll(reference.pointer, map.reference.pointer).check(); + _putAll(reference.pointer, _id_putAll as jni.JMethodIDPtr, + map.reference.pointer) + .check(); } - static final _remove = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__remove") + static final _id_remove = _class.instanceMethodId( + r"remove", + r"(Ljava/lang/Object;)Ljava/lang/Object;", + ); + + static final _remove = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public V remove(java.lang.Object object) /// The returned object must be released after use, by calling the [release] method. $V remove( jni.JObject object, ) { - return _remove(reference.pointer, object.reference.pointer).object(V); + return _remove(reference.pointer, _id_remove as jni.JMethodIDPtr, + object.reference.pointer) + .object(V); } - static final _clear = jniLookup< + static final _id_clear = _class.instanceMethodId( + r"clear", + r"()V", + ); + + static final _clear = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("HashMap__clear") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public void clear() void clear() { - _clear(reference.pointer).check(); + _clear(reference.pointer, _id_clear as jni.JMethodIDPtr).check(); } - static final _containsValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__containsValue") + static final _id_containsValue = _class.instanceMethodId( + r"containsValue", + r"(Ljava/lang/Object;)Z", + ); + + static final _containsValue = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public boolean containsValue(java.lang.Object object) bool containsValue( jni.JObject object, ) { - return _containsValue(reference.pointer, object.reference.pointer).boolean; + return _containsValue(reference.pointer, + _id_containsValue as jni.JMethodIDPtr, object.reference.pointer) + .boolean; } - static final _keySet = jniLookup< + static final _id_keySet = _class.instanceMethodId( + r"keySet", + r"()Ljava/util/Set;", + ); + + static final _keySet = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("HashMap__keySet") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.Set keySet() /// The returned object must be released after use, by calling the [release] method. jni.JSet<$K> keySet() { - return _keySet(reference.pointer).object(jni.JSetType(K)); + return _keySet(reference.pointer, _id_keySet as jni.JMethodIDPtr) + .object(jni.JSetType(K)); } - static final _values = jniLookup< + static final _id_values = _class.instanceMethodId( + r"values", + r"()Ljava/util/Collection;", + ); + + static final _values = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("HashMap__values") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.Collection values() /// The returned object must be released after use, by calling the [release] method. jni.JObject values() { - return _values(reference.pointer).object(const jni.JObjectType()); + return _values(reference.pointer, _id_values as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _entrySet = jniLookup< + static final _id_entrySet = _class.instanceMethodId( + r"entrySet", + r"()Ljava/util/Set;", + ); + + static final _entrySet = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("HashMap__entrySet") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.Set entrySet() /// The returned object must be released after use, by calling the [release] method. jni.JSet entrySet() { - return _entrySet(reference.pointer) + return _entrySet(reference.pointer, _id_entrySet as jni.JMethodIDPtr) .object(const jni.JSetType(jni.JObjectType())); } - static final _getOrDefault = jniLookup< + static final _id_getOrDefault = _class.instanceMethodId( + r"getOrDefault", + r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", + ); + + static final _getOrDefault = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__getOrDefault") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V getOrDefault(java.lang.Object object, V object1) /// The returned object must be released after use, by calling the [release] method. @@ -3586,20 +4589,32 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> jni.JObject object, $V object1, ) { - return _getOrDefault(reference.pointer, object.reference.pointer, + return _getOrDefault( + reference.pointer, + _id_getOrDefault as jni.JMethodIDPtr, + object.reference.pointer, object1.reference.pointer) .object(V); } - static final _putIfAbsent = jniLookup< + static final _id_putIfAbsent = _class.instanceMethodId( + r"putIfAbsent", + r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", + ); + + static final _putIfAbsent = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__putIfAbsent") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V putIfAbsent(K object, V object1) /// The returned object must be released after use, by calling the [release] method. @@ -3607,41 +4622,63 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, $V object1, ) { - return _putIfAbsent(reference.pointer, object.reference.pointer, - object1.reference.pointer) + return _putIfAbsent(reference.pointer, _id_putIfAbsent as jni.JMethodIDPtr, + object.reference.pointer, object1.reference.pointer) .object(V); } - static final _remove1 = jniLookup< + static final _id_remove1 = _class.instanceMethodId( + r"remove", + r"(Ljava/lang/Object;Ljava/lang/Object;)Z", + ); + + static final _remove1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__remove1") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public boolean remove(java.lang.Object object, java.lang.Object object1) bool remove1( jni.JObject object, jni.JObject object1, ) { - return _remove1(reference.pointer, object.reference.pointer, - object1.reference.pointer) + return _remove1(reference.pointer, _id_remove1 as jni.JMethodIDPtr, + object.reference.pointer, object1.reference.pointer) .boolean; } - static final _replace = jniLookup< + static final _id_replace = _class.instanceMethodId( + r"replace", + r"(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z", + ); + + static final _replace = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__replace") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallBooleanMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: public boolean replace(K object, V object1, V object2) bool replace( @@ -3649,20 +4686,33 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $V object1, $V object2, ) { - return _replace(reference.pointer, object.reference.pointer, - object1.reference.pointer, object2.reference.pointer) + return _replace( + reference.pointer, + _id_replace as jni.JMethodIDPtr, + object.reference.pointer, + object1.reference.pointer, + object2.reference.pointer) .boolean; } - static final _replace1 = jniLookup< + static final _id_replace1 = _class.instanceMethodId( + r"replace", + r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", + ); + + static final _replace1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__replace1") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V replace(K object, V object1) /// The returned object must be released after use, by calling the [release] method. @@ -3670,20 +4720,29 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, $V object1, ) { - return _replace1(reference.pointer, object.reference.pointer, - object1.reference.pointer) + return _replace1(reference.pointer, _id_replace1 as jni.JMethodIDPtr, + object.reference.pointer, object1.reference.pointer) .object(V); } - static final _computeIfAbsent = jniLookup< + static final _id_computeIfAbsent = _class.instanceMethodId( + r"computeIfAbsent", + r"(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;", + ); + + static final _computeIfAbsent = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__computeIfAbsent") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V computeIfAbsent(K object, java.util.function.Function function) /// The returned object must be released after use, by calling the [release] method. @@ -3691,20 +4750,32 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, jni.JObject function, ) { - return _computeIfAbsent(reference.pointer, object.reference.pointer, + return _computeIfAbsent( + reference.pointer, + _id_computeIfAbsent as jni.JMethodIDPtr, + object.reference.pointer, function.reference.pointer) .object(V); } - static final _computeIfPresent = jniLookup< + static final _id_computeIfPresent = _class.instanceMethodId( + r"computeIfPresent", + r"(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;", + ); + + static final _computeIfPresent = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__computeIfPresent") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V computeIfPresent(K object, java.util.function.BiFunction biFunction) /// The returned object must be released after use, by calling the [release] method. @@ -3712,20 +4783,32 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, jni.JObject biFunction, ) { - return _computeIfPresent(reference.pointer, object.reference.pointer, + return _computeIfPresent( + reference.pointer, + _id_computeIfPresent as jni.JMethodIDPtr, + object.reference.pointer, biFunction.reference.pointer) .object(V); } - static final _compute = jniLookup< + static final _id_compute = _class.instanceMethodId( + r"compute", + r"(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;", + ); + + static final _compute = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__compute") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public V compute(K object, java.util.function.BiFunction biFunction) /// The returned object must be released after use, by calling the [release] method. @@ -3733,21 +4816,34 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, jni.JObject biFunction, ) { - return _compute(reference.pointer, object.reference.pointer, - biFunction.reference.pointer) + return _compute(reference.pointer, _id_compute as jni.JMethodIDPtr, + object.reference.pointer, biFunction.reference.pointer) .object(V); } - static final _merge = jniLookup< + static final _id_merge = _class.instanceMethodId( + r"merge", + r"(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;", + ); + + static final _merge = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("HashMap__merge") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: public V merge(K object, V object1, java.util.function.BiFunction biFunction) /// The returned object must be released after use, by calling the [release] method. @@ -3756,55 +4852,87 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $V object1, jni.JObject biFunction, ) { - return _merge(reference.pointer, object.reference.pointer, - object1.reference.pointer, biFunction.reference.pointer) + return _merge( + reference.pointer, + _id_merge as jni.JMethodIDPtr, + object.reference.pointer, + object1.reference.pointer, + biFunction.reference.pointer) .object(V); } - static final _forEach = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__forEach") + static final _id_forEach = _class.instanceMethodId( + r"forEach", + r"(Ljava/util/function/BiConsumer;)V", + ); + + static final _forEach = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void forEach(java.util.function.BiConsumer biConsumer) void forEach( jni.JObject biConsumer, ) { - _forEach(reference.pointer, biConsumer.reference.pointer).check(); + _forEach(reference.pointer, _id_forEach as jni.JMethodIDPtr, + biConsumer.reference.pointer) + .check(); } - static final _replaceAll = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("HashMap__replaceAll") + static final _id_replaceAll = _class.instanceMethodId( + r"replaceAll", + r"(Ljava/util/function/BiFunction;)V", + ); + + static final _replaceAll = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void replaceAll(java.util.function.BiFunction biFunction) void replaceAll( jni.JObject biFunction, ) { - _replaceAll(reference.pointer, biFunction.reference.pointer).check(); + _replaceAll(reference.pointer, _id_replaceAll as jni.JMethodIDPtr, + biFunction.reference.pointer) + .check(); } - static final _clone = jniLookup< + static final _id_clone = _class.instanceMethodId( + r"clone", + r"()Ljava/lang/Object;", + ); + + static final _clone = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("HashMap__clone") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.Object clone() /// The returned object must be released after use, by calling the [release] method. jni.JObject clone() { - return _clone(reference.pointer).object(const jni.JObjectType()); + return _clone(reference.pointer, _id_clone as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } } @@ -3852,14 +4980,29 @@ class AndroidUtils extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"com/example/in_app_java/AndroidUtils"); + /// The type which includes information such as the signature of this class. static const type = $AndroidUtilsType(); - static final _showToast = jniLookup< + static final _id_showToast = _class.staticMethodId( + r"showToast", + r"(Landroid/app/Activity;Ljava/lang/CharSequence;I)V", + ); + + static final _showToast = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>("AndroidUtils__showToast") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Int64 + )>)>>("globalEnv_CallStaticVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); /// from: static public void showToast(android.app.Activity mainActivity, java.lang.CharSequence text, int duration) @@ -3868,7 +5011,8 @@ class AndroidUtils extends jni.JObject { jni.JObject text, int duration, ) { - _showToast(mainActivity.reference.pointer, text.reference.pointer, duration) + _showToast(_class.reference.pointer, _id_showToast as jni.JMethodIDPtr, + mainActivity.reference.pointer, text.reference.pointer, duration) .check(); } } diff --git a/pkgs/jnigen/example/in_app_java/src/android_utils/.clang-format b/pkgs/jnigen/example/in_app_java/src/android_utils/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/example/in_app_java/src/android_utils/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/example/in_app_java/src/android_utils/CMakeLists.txt b/pkgs/jnigen/example/in_app_java/src/android_utils/CMakeLists.txt deleted file mode 100644 index 0c47c280c..000000000 --- a/pkgs/jnigen/example/in_app_java/src/android_utils/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(android_utils VERSION 0.0.1 LANGUAGES C) - -add_library(android_utils SHARED - "./android_utils.c" -) - -set_target_properties(android_utils PROPERTIES - OUTPUT_NAME "android_utils" -) - -target_compile_definitions(android_utils PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(android_utils log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(android_utils ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c b/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c deleted file mode 100644 index c9534ec4c..000000000 --- a/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c +++ /dev/null @@ -1,2581 +0,0 @@ -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult -jclass _c_EmojiCompat_CodepointSequenceMatchResult = NULL; - -// androidx.emoji2.text.EmojiCompat$Config -jclass _c_EmojiCompat_Config = NULL; - -jmethodID _m_EmojiCompat_Config__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__new0(jobject metadataLoader) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, &_m_EmojiCompat_Config__new0, "", - "(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;)V"); - if (_m_EmojiCompat_Config__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_Config, - _m_EmojiCompat_Config__new0, metadataLoader); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__registerInitCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__registerInitCallback(jobject self_, - jobject initCallback) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__registerInitCallback, - "registerInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__registerInitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__registerInitCallback, initCallback); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__unregisterInitCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__unregisterInitCallback(jobject self_, - jobject initCallback) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__unregisterInitCallback, - "unregisterInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__unregisterInitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__unregisterInitCallback, - initCallback); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setReplaceAll = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setReplaceAll(jobject self_, uint8_t replaceAll) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, &_m_EmojiCompat_Config__setReplaceAll, - "setReplaceAll", "(Z)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setReplaceAll == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setReplaceAll, replaceAll); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setUseEmojiAsDefaultStyle( - jobject self_, - uint8_t useEmojiAsDefaultStyle) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle, - "setUseEmojiAsDefaultStyle", - "(Z)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle, - useEmojiAsDefaultStyle); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setUseEmojiAsDefaultStyle1( - jobject self_, - uint8_t useEmojiAsDefaultStyle, - jobject emojiAsDefaultStyleExceptions) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1, - "setUseEmojiAsDefaultStyle", - "(ZLjava/util/List;)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1, - useEmojiAsDefaultStyle, emojiAsDefaultStyleExceptions); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setEmojiSpanIndicatorEnabled( - jobject self_, - uint8_t emojiSpanIndicatorEnabled) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled, - "setEmojiSpanIndicatorEnabled", - "(Z)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled, - emojiSpanIndicatorEnabled); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setEmojiSpanIndicatorColor = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setEmojiSpanIndicatorColor(jobject self_, - int32_t color) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__setEmojiSpanIndicatorColor, - "setEmojiSpanIndicatorColor", - "(I)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setEmojiSpanIndicatorColor == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setEmojiSpanIndicatorColor, color); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setMetadataLoadStrategy = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setMetadataLoadStrategy(jobject self_, - int32_t strategy) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__setMetadataLoadStrategy, - "setMetadataLoadStrategy", - "(I)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setMetadataLoadStrategy == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setMetadataLoadStrategy, strategy); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setSpanFactory = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setSpanFactory(jobject self_, jobject factory) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, &_m_EmojiCompat_Config__setSpanFactory, - "setSpanFactory", - "(Landroidx/emoji2/text/EmojiCompat$SpanFactory;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setSpanFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setSpanFactory, factory); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__setGlyphChecker = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setGlyphChecker(jobject self_, - jobject glyphChecker) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, &_m_EmojiCompat_Config__setGlyphChecker, - "setGlyphChecker", - "(Landroidx/emoji2/text/EmojiCompat$GlyphChecker;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setGlyphChecker == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setGlyphChecker, glyphChecker); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_Config__getMetadataRepoLoader = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__getMetadataRepoLoader(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, - &_m_EmojiCompat_Config__getMetadataRepoLoader, - "getMetadataRepoLoader", - "()Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;"); - if (_m_EmojiCompat_Config__getMetadataRepoLoader == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__getMetadataRepoLoader); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.EmojiCompat$DefaultSpanFactory -jclass _c_EmojiCompat_DefaultSpanFactory = NULL; - -jmethodID _m_EmojiCompat_DefaultSpanFactory__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_DefaultSpanFactory__new0() { - load_env(); - load_class_global_ref(&_c_EmojiCompat_DefaultSpanFactory, - "androidx/emoji2/text/EmojiCompat$DefaultSpanFactory"); - if (_c_EmojiCompat_DefaultSpanFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_DefaultSpanFactory, - &_m_EmojiCompat_DefaultSpanFactory__new0, "", "()V"); - if (_m_EmojiCompat_DefaultSpanFactory__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_DefaultSpanFactory, - _m_EmojiCompat_DefaultSpanFactory__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_DefaultSpanFactory__createSpan = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_DefaultSpanFactory__createSpan(jobject self_, - jobject rasterizer) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_DefaultSpanFactory, - "androidx/emoji2/text/EmojiCompat$DefaultSpanFactory"); - if (_c_EmojiCompat_DefaultSpanFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_DefaultSpanFactory, - &_m_EmojiCompat_DefaultSpanFactory__createSpan, "createSpan", - "(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/" - "emoji2/text/EmojiSpan;"); - if (_m_EmojiCompat_DefaultSpanFactory__createSpan == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_DefaultSpanFactory__createSpan, rasterizer); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.EmojiCompat$GlyphChecker -jclass _c_EmojiCompat_GlyphChecker = NULL; - -jmethodID _m_EmojiCompat_GlyphChecker__hasGlyph = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_GlyphChecker__hasGlyph(jobject self_, - jobject charSequence, - int32_t start, - int32_t end, - int32_t sdkAdded) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_GlyphChecker, - "androidx/emoji2/text/EmojiCompat$GlyphChecker"); - if (_c_EmojiCompat_GlyphChecker == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_GlyphChecker, - &_m_EmojiCompat_GlyphChecker__hasGlyph, "hasGlyph", - "(Ljava/lang/CharSequence;III)Z"); - if (_m_EmojiCompat_GlyphChecker__hasGlyph == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_EmojiCompat_GlyphChecker__hasGlyph, charSequence, start, - end, sdkAdded); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -// androidx.emoji2.text.EmojiCompat$InitCallback -jclass _c_EmojiCompat_InitCallback = NULL; - -jmethodID _m_EmojiCompat_InitCallback__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__new0() { - load_env(); - load_class_global_ref(&_c_EmojiCompat_InitCallback, - "androidx/emoji2/text/EmojiCompat$InitCallback"); - if (_c_EmojiCompat_InitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_InitCallback, &_m_EmojiCompat_InitCallback__new0, - "", "()V"); - if (_m_EmojiCompat_InitCallback__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_InitCallback, - _m_EmojiCompat_InitCallback__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_InitCallback__onInitialized = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__onInitialized(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_InitCallback, - "androidx/emoji2/text/EmojiCompat$InitCallback"); - if (_c_EmojiCompat_InitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_InitCallback, - &_m_EmojiCompat_InitCallback__onInitialized, "onInitialized", - "()V"); - if (_m_EmojiCompat_InitCallback__onInitialized == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_InitCallback__onInitialized); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat_InitCallback__onFailed = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__onFailed(jobject self_, jobject throwable) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_InitCallback, - "androidx/emoji2/text/EmojiCompat$InitCallback"); - if (_c_EmojiCompat_InitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_InitCallback, - &_m_EmojiCompat_InitCallback__onFailed, "onFailed", - "(Ljava/lang/Throwable;)V"); - if (_m_EmojiCompat_InitCallback__onFailed == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_InitCallback__onFailed, throwable); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// androidx.emoji2.text.EmojiCompat$LoadStrategy -jclass _c_EmojiCompat_LoadStrategy = NULL; - -// androidx.emoji2.text.EmojiCompat$MetadataRepoLoader -jclass _c_EmojiCompat_MetadataRepoLoader = NULL; - -jmethodID _m_EmojiCompat_MetadataRepoLoader__load = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoader__load(jobject self_, - jobject loaderCallback) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_MetadataRepoLoader, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoader"); - if (_c_EmojiCompat_MetadataRepoLoader == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_EmojiCompat_MetadataRepoLoader, - &_m_EmojiCompat_MetadataRepoLoader__load, "load", - "(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V"); - if (_m_EmojiCompat_MetadataRepoLoader__load == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_EmojiCompat_MetadataRepoLoader__load, loaderCallback); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback -jclass _c_EmojiCompat_MetadataRepoLoaderCallback = NULL; - -jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__new0() { - load_env(); - load_class_global_ref( - &_c_EmojiCompat_MetadataRepoLoaderCallback, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); - if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__new0, "", - "()V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_MetadataRepoLoaderCallback, - _m_EmojiCompat_MetadataRepoLoaderCallback__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__onLoaded( - jobject self_, - jobject metadataRepo) { - load_env(); - load_class_global_ref( - &_c_EmojiCompat_MetadataRepoLoaderCallback, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); - if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded, "onLoaded", - "(Landroidx/emoji2/text/MetadataRepo;)V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded, - metadataRepo); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__onFailed = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__onFailed(jobject self_, - jobject throwable) { - load_env(); - load_class_global_ref( - &_c_EmojiCompat_MetadataRepoLoaderCallback, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); - if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__onFailed, "onFailed", - "(Ljava/lang/Throwable;)V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__onFailed == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_MetadataRepoLoaderCallback__onFailed, - throwable); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// androidx.emoji2.text.EmojiCompat$ReplaceStrategy -jclass _c_EmojiCompat_ReplaceStrategy = NULL; - -// androidx.emoji2.text.EmojiCompat$SpanFactory -jclass _c_EmojiCompat_SpanFactory = NULL; - -jmethodID _m_EmojiCompat_SpanFactory__createSpan = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat_SpanFactory__createSpan(jobject self_, - jobject rasterizer) { - load_env(); - load_class_global_ref(&_c_EmojiCompat_SpanFactory, - "androidx/emoji2/text/EmojiCompat$SpanFactory"); - if (_c_EmojiCompat_SpanFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_SpanFactory, - &_m_EmojiCompat_SpanFactory__createSpan, "createSpan", - "(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/" - "emoji2/text/EmojiSpan;"); - if (_m_EmojiCompat_SpanFactory__createSpan == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_SpanFactory__createSpan, rasterizer); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.EmojiCompat -jclass _c_EmojiCompat = NULL; - -jmethodID _m_EmojiCompat__init = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__init(jobject context) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_EmojiCompat, &_m_EmojiCompat__init, "init", - "(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__init == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__init, context); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__init1 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__init1(jobject context, jobject defaultFactory) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, &_m_EmojiCompat__init1, "init", - "(Landroid/content/Context;Landroidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;" - ")Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__init1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__init1, context, defaultFactory); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__init2 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__init2(jobject config) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, &_m_EmojiCompat__init2, "init", - "(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/" - "emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__init2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__init2, config); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__isConfigured = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__isConfigured() { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, &_m_EmojiCompat__isConfigured, - "isConfigured", "()Z"); - if (_m_EmojiCompat__isConfigured == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallStaticBooleanMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__isConfigured); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__reset = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__reset(jobject config) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, &_m_EmojiCompat__reset, "reset", - "(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/" - "emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__reset == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__reset, config); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__reset1 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__reset1(jobject emojiCompat) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_EmojiCompat, &_m_EmojiCompat__reset1, "reset", - "(Landroidx/emoji2/text/EmojiCompat;)Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__reset1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__reset1, emojiCompat); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__skipDefaultConfigurationLookup = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__skipDefaultConfigurationLookup(uint8_t shouldSkip) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, - &_m_EmojiCompat__skipDefaultConfigurationLookup, - "skipDefaultConfigurationLookup", "(Z)V"); - if (_m_EmojiCompat__skipDefaultConfigurationLookup == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__skipDefaultConfigurationLookup, - shouldSkip); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__get0 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__get0() { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, &_m_EmojiCompat__get0, "get", - "()Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__get0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_EmojiCompat, - _m_EmojiCompat__get0); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__load = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__load(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__load, "load", "()V"); - if (_m_EmojiCompat__load == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__load); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__registerInitCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__registerInitCallback(jobject self_, - jobject initCallback) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__registerInitCallback, - "registerInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V"); - if (_m_EmojiCompat__registerInitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__registerInitCallback, - initCallback); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__unregisterInitCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__unregisterInitCallback(jobject self_, - jobject initCallback) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__unregisterInitCallback, - "unregisterInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V"); - if (_m_EmojiCompat__unregisterInitCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_EmojiCompat__unregisterInitCallback, initCallback); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__getLoadState = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getLoadState(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__getLoadState, "getLoadState", - "()I"); - if (_m_EmojiCompat__getLoadState == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_EmojiCompat__getLoadState); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__isEmojiSpanIndicatorEnabled = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__isEmojiSpanIndicatorEnabled(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__isEmojiSpanIndicatorEnabled, - "isEmojiSpanIndicatorEnabled", "()Z"); - if (_m_EmojiCompat__isEmojiSpanIndicatorEnabled == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_EmojiCompat__isEmojiSpanIndicatorEnabled); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__getEmojiSpanIndicatorColor = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiSpanIndicatorColor(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__getEmojiSpanIndicatorColor, - "getEmojiSpanIndicatorColor", "()I"); - if (_m_EmojiCompat__getEmojiSpanIndicatorColor == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_EmojiCompat__getEmojiSpanIndicatorColor); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__getEmojiStart = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiStart(jobject self_, - jobject charSequence, - int32_t offset) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__getEmojiStart, "getEmojiStart", - "(Ljava/lang/CharSequence;I)I"); - if (_m_EmojiCompat__getEmojiStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_EmojiCompat__getEmojiStart, charSequence, offset); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__getEmojiEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiEnd(jobject self_, - jobject charSequence, - int32_t offset) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__getEmojiEnd, "getEmojiEnd", - "(Ljava/lang/CharSequence;I)I"); - if (_m_EmojiCompat__getEmojiEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_EmojiCompat__getEmojiEnd, charSequence, offset); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__handleOnKeyDown = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__handleOnKeyDown(jobject editable, - int32_t keyCode, - jobject event) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, &_m_EmojiCompat__handleOnKeyDown, - "handleOnKeyDown", - "(Landroid/text/Editable;ILandroid/view/KeyEvent;)Z"); - if (_m_EmojiCompat__handleOnKeyDown == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallStaticBooleanMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__handleOnKeyDown, editable, - keyCode, event); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__handleDeleteSurroundingText = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__handleDeleteSurroundingText(jobject inputConnection, - jobject editable, - int32_t beforeLength, - int32_t afterLength, - uint8_t inCodePoints) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_EmojiCompat, - &_m_EmojiCompat__handleDeleteSurroundingText, - "handleDeleteSurroundingText", - "(Landroid/view/inputmethod/InputConnection;Landroid/text/" - "Editable;IIZ)Z"); - if (_m_EmojiCompat__handleDeleteSurroundingText == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallStaticBooleanMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__handleDeleteSurroundingText, - inputConnection, editable, beforeLength, afterLength, inCodePoints); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__hasEmojiGlyph = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__hasEmojiGlyph(jobject self_, jobject sequence) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__hasEmojiGlyph, "hasEmojiGlyph", - "(Ljava/lang/CharSequence;)Z"); - if (_m_EmojiCompat__hasEmojiGlyph == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_EmojiCompat__hasEmojiGlyph, sequence); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__hasEmojiGlyph1 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__hasEmojiGlyph1(jobject self_, - jobject sequence, - int32_t metadataVersion) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__hasEmojiGlyph1, "hasEmojiGlyph", - "(Ljava/lang/CharSequence;I)Z"); - if (_m_EmojiCompat__hasEmojiGlyph1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_EmojiCompat__hasEmojiGlyph1, sequence, metadataVersion); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__getEmojiMatch = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiMatch(jobject self_, - jobject sequence, - int32_t metadataVersion) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__getEmojiMatch, "getEmojiMatch", - "(Ljava/lang/CharSequence;I)I"); - if (_m_EmojiCompat__getEmojiMatch == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_EmojiCompat__getEmojiMatch, sequence, metadataVersion); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_EmojiCompat__process = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process(jobject self_, jobject charSequence) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__process, "process", - "(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__process, charSequence); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__process1 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process1(jobject self_, - jobject charSequence, - int32_t start, - int32_t end) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__process1, "process", - "(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__process1, charSequence, start, end); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__process2 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process2(jobject self_, - jobject charSequence, - int32_t start, - int32_t end, - int32_t maxEmojiCount) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__process2, "process", - "(Ljava/lang/CharSequence;III)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_EmojiCompat__process2, - charSequence, start, end, maxEmojiCount); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__process3 = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process3(jobject self_, - jobject charSequence, - int32_t start, - int32_t end, - int32_t maxEmojiCount, - int32_t replaceStrategy) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__process3, "process", - "(Ljava/lang/CharSequence;IIII)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__process3, charSequence, start, end, - maxEmojiCount, replaceStrategy); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__getAssetSignature = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getAssetSignature(jobject self_) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__getAssetSignature, - "getAssetSignature", "()Ljava/lang/String;"); - if (_m_EmojiCompat__getAssetSignature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__getAssetSignature); - return to_global_ref_result(_result); -} - -jmethodID _m_EmojiCompat__updateEditorInfo = NULL; -FFI_PLUGIN_EXPORT -JniResult EmojiCompat__updateEditorInfo(jobject self_, jobject outAttrs) { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat, &_m_EmojiCompat__updateEditorInfo, - "updateEditorInfo", "(Landroid/view/inputmethod/EditorInfo;)V"); - if (_m_EmojiCompat__updateEditorInfo == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__updateEditorInfo, - outAttrs); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_EmojiCompat__EDITOR_INFO_METAVERSION_KEY = NULL; -FFI_PLUGIN_EXPORT -JniResult get_EmojiCompat__EDITOR_INFO_METAVERSION_KEY() { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_EmojiCompat, - &_f_EmojiCompat__EDITOR_INFO_METAVERSION_KEY, - "EDITOR_INFO_METAVERSION_KEY", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_EmojiCompat, _f_EmojiCompat__EDITOR_INFO_METAVERSION_KEY); - return to_global_ref_result(_result); -} - -jfieldID _f_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY = NULL; -FFI_PLUGIN_EXPORT -JniResult get_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY() { - load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_EmojiCompat, - &_f_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY, - "EDITOR_INFO_REPLACE_ALL_KEY", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_EmojiCompat, _f_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory -jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory = NULL; - -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0 = - NULL; -FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0( - jobject helper) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0, - "", - "(Landroidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;)V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0, - helper); - return to_global_ref_result(_result); -} - -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create = - NULL; -FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create( - jobject self_, - jobject context) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create, - "create", - "(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create, - context); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper -jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper = NULL; - -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0 = - NULL; -FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0() { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0, - "", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0); - return to_global_ref_result(_result); -} - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures( - jobject self_, - jobject packageManager, - jobject providerPackage) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures, - "getSigningSignatures", - "(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/" - "content/pm/Signature;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures, - packageManager, providerPackage); - return to_global_ref_result(_result); -} - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders( - jobject self_, - jobject packageManager, - jobject intent, - int32_t flags) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders, - "queryIntentContentProviders", - "(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/" - "util/List;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders, - packageManager, intent, flags); - return to_global_ref_result(_result); -} - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo( - jobject self_, - jobject resolveInfo) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo, - "getProviderInfo", - "(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo, - resolveInfo); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 -jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 = NULL; - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0 = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0() { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0, - "", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0 == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0); - return to_global_ref_result(_result); -} - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders( - jobject self_, - jobject packageManager, - jobject intent, - int32_t flags) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders, - "queryIntentContentProviders", - "(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/" - "util/List;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders, - packageManager, intent, flags); - return to_global_ref_result(_result); -} - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo( - jobject self_, - jobject resolveInfo) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo, - "getProviderInfo", - "(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo, - resolveInfo); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 -jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 = NULL; - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0 = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0() { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0, - "", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0 == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0); - return to_global_ref_result(_result); -} - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1 = - NULL; -FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1( - jobject self_, - jobject packageManager, - jobject providerPackage) { - load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1, - "getSigningSignatures", - "(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/" - "content/pm/Signature;"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1 == - NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1, - packageManager, providerPackage); - return to_global_ref_result(_result); -} - -// androidx.emoji2.text.DefaultEmojiCompatConfig -jclass _c_DefaultEmojiCompatConfig = NULL; - -jmethodID _m_DefaultEmojiCompatConfig__create = NULL; -FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig__create(jobject context) { - load_env(); - load_class_global_ref(&_c_DefaultEmojiCompatConfig, - "androidx/emoji2/text/DefaultEmojiCompatConfig"); - if (_c_DefaultEmojiCompatConfig == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_DefaultEmojiCompatConfig, - &_m_DefaultEmojiCompatConfig__create, "create", - "(Landroid/content/Context;)Landroidx/emoji2/text/" - "FontRequestEmojiCompatConfig;"); - if (_m_DefaultEmojiCompatConfig__create == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_DefaultEmojiCompatConfig, _m_DefaultEmojiCompatConfig__create, - context); - return to_global_ref_result(_result); -} - -// android.os.Build$Partition -jclass _c_Build_Partition = NULL; - -jmethodID _m_Build_Partition__getName = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_Partition__getName(jobject self_) { - load_env(); - load_class_global_ref(&_c_Build_Partition, "android/os/Build$Partition"); - if (_c_Build_Partition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_Partition, &_m_Build_Partition__getName, "getName", - "()Ljava/lang/String;"); - if (_m_Build_Partition__getName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Build_Partition__getName); - return to_global_ref_result(_result); -} - -jmethodID _m_Build_Partition__getFingerprint = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_Partition__getFingerprint(jobject self_) { - load_env(); - load_class_global_ref(&_c_Build_Partition, "android/os/Build$Partition"); - if (_c_Build_Partition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_Partition, &_m_Build_Partition__getFingerprint, - "getFingerprint", "()Ljava/lang/String;"); - if (_m_Build_Partition__getFingerprint == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Build_Partition__getFingerprint); - return to_global_ref_result(_result); -} - -jmethodID _m_Build_Partition__getBuildTimeMillis = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_Partition__getBuildTimeMillis(jobject self_) { - load_env(); - load_class_global_ref(&_c_Build_Partition, "android/os/Build$Partition"); - if (_c_Build_Partition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_Partition, &_m_Build_Partition__getBuildTimeMillis, - "getBuildTimeMillis", "()J"); - if (_m_Build_Partition__getBuildTimeMillis == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_Build_Partition__getBuildTimeMillis); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_Build_Partition__equals = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_Partition__equals(jobject self_, jobject object) { - load_env(); - load_class_global_ref(&_c_Build_Partition, "android/os/Build$Partition"); - if (_c_Build_Partition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_Partition, &_m_Build_Partition__equals, "equals", - "(Ljava/lang/Object;)Z"); - if (_m_Build_Partition__equals == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_Build_Partition__equals, object); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_Build_Partition__hashCode1 = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_Partition__hashCode1(jobject self_) { - load_env(); - load_class_global_ref(&_c_Build_Partition, "android/os/Build$Partition"); - if (_c_Build_Partition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_Partition, &_m_Build_Partition__hashCode1, "hashCode", - "()I"); - if (_m_Build_Partition__hashCode1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Build_Partition__hashCode1); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_Build_Partition__PARTITION_NAME_SYSTEM = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_Partition__PARTITION_NAME_SYSTEM() { - load_env(); - load_class_global_ref(&_c_Build_Partition, "android/os/Build$Partition"); - if (_c_Build_Partition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_Partition, - &_f_Build_Partition__PARTITION_NAME_SYSTEM, - "PARTITION_NAME_SYSTEM", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build_Partition, _f_Build_Partition__PARTITION_NAME_SYSTEM); - return to_global_ref_result(_result); -} - -// android.os.Build$VERSION -jclass _c_Build_VERSION = NULL; - -jmethodID _m_Build_VERSION__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_VERSION__new0() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_VERSION, &_m_Build_VERSION__new0, "", "()V"); - if (_m_Build_VERSION__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Build_VERSION, _m_Build_VERSION__new0); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__BASE_OS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__BASE_OS() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__BASE_OS, "BASE_OS", - "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build_VERSION, - _f_Build_VERSION__BASE_OS); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__CODENAME = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__CODENAME() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__CODENAME, "CODENAME", - "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build_VERSION, - _f_Build_VERSION__CODENAME); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__INCREMENTAL = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__INCREMENTAL() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__INCREMENTAL, - "INCREMENTAL", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build_VERSION, _f_Build_VERSION__INCREMENTAL); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__MEDIA_PERFORMANCE_CLASS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__MEDIA_PERFORMANCE_CLASS() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, - &_f_Build_VERSION__MEDIA_PERFORMANCE_CLASS, - "MEDIA_PERFORMANCE_CLASS", "I"); - int32_t _result = (*jniEnv)->GetStaticIntField( - jniEnv, _c_Build_VERSION, _f_Build_VERSION__MEDIA_PERFORMANCE_CLASS); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_Build_VERSION__PREVIEW_SDK_INT = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__PREVIEW_SDK_INT() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__PREVIEW_SDK_INT, - "PREVIEW_SDK_INT", "I"); - int32_t _result = (*jniEnv)->GetStaticIntField( - jniEnv, _c_Build_VERSION, _f_Build_VERSION__PREVIEW_SDK_INT); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_Build_VERSION__RELEASE = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__RELEASE() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__RELEASE, "RELEASE", - "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build_VERSION, - _f_Build_VERSION__RELEASE); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__RELEASE_OR_CODENAME = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__RELEASE_OR_CODENAME() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__RELEASE_OR_CODENAME, - "RELEASE_OR_CODENAME", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build_VERSION, _f_Build_VERSION__RELEASE_OR_CODENAME); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__RELEASE_OR_PREVIEW_DISPLAY = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__RELEASE_OR_PREVIEW_DISPLAY() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, - &_f_Build_VERSION__RELEASE_OR_PREVIEW_DISPLAY, - "RELEASE_OR_PREVIEW_DISPLAY", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build_VERSION, _f_Build_VERSION__RELEASE_OR_PREVIEW_DISPLAY); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__SDK = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__SDK() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__SDK, "SDK", - "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build_VERSION, - _f_Build_VERSION__SDK); - return to_global_ref_result(_result); -} - -jfieldID _f_Build_VERSION__SDK_INT = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__SDK_INT() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__SDK_INT, "SDK_INT", - "I"); - int32_t _result = (*jniEnv)->GetStaticIntField(jniEnv, _c_Build_VERSION, - _f_Build_VERSION__SDK_INT); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_Build_VERSION__SECURITY_PATCH = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build_VERSION__SECURITY_PATCH() { - load_env(); - load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); - if (_c_Build_VERSION == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build_VERSION, &_f_Build_VERSION__SECURITY_PATCH, - "SECURITY_PATCH", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build_VERSION, _f_Build_VERSION__SECURITY_PATCH); - return to_global_ref_result(_result); -} - -// android.os.Build$VERSION_CODES -jclass _c_Build_VERSION_CODES = NULL; - -jmethodID _m_Build_VERSION_CODES__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Build_VERSION_CODES__new0() { - load_env(); - load_class_global_ref(&_c_Build_VERSION_CODES, - "android/os/Build$VERSION_CODES"); - if (_c_Build_VERSION_CODES == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_VERSION_CODES, &_m_Build_VERSION_CODES__new0, "", - "()V"); - if (_m_Build_VERSION_CODES__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Build_VERSION_CODES, - _m_Build_VERSION_CODES__new0); - return to_global_ref_result(_result); -} - -// android.os.Build -jclass _c_Build = NULL; - -jmethodID _m_Build__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Build__new0() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build, &_m_Build__new0, "", "()V"); - if (_m_Build__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Build, _m_Build__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_Build__getSerial = NULL; -FFI_PLUGIN_EXPORT -JniResult Build__getSerial() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Build, &_m_Build__getSerial, "getSerial", - "()Ljava/lang/String;"); - if (_m_Build__getSerial == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_Build, _m_Build__getSerial); - return to_global_ref_result(_result); -} - -jmethodID _m_Build__getFingerprintedPartitions = NULL; -FFI_PLUGIN_EXPORT -JniResult Build__getFingerprintedPartitions() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Build, &_m_Build__getFingerprintedPartitions, - "getFingerprintedPartitions", "()Ljava/util/List;"); - if (_m_Build__getFingerprintedPartitions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_Build, _m_Build__getFingerprintedPartitions); - return to_global_ref_result(_result); -} - -jmethodID _m_Build__getRadioVersion = NULL; -FFI_PLUGIN_EXPORT -JniResult Build__getRadioVersion() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Build, &_m_Build__getRadioVersion, "getRadioVersion", - "()Ljava/lang/String;"); - if (_m_Build__getRadioVersion == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_Build, _m_Build__getRadioVersion); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__BOARD = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__BOARD() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__BOARD, "BOARD", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__BOARD); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__BOOTLOADER = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__BOOTLOADER() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__BOOTLOADER, "BOOTLOADER", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__BOOTLOADER); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__BRAND = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__BRAND() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__BRAND, "BRAND", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__BRAND); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__CPU_ABI = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__CPU_ABI() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__CPU_ABI, "CPU_ABI", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__CPU_ABI); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__CPU_ABI2 = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__CPU_ABI2() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__CPU_ABI2, "CPU_ABI2", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__CPU_ABI2); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__DEVICE = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__DEVICE() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__DEVICE, "DEVICE", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__DEVICE); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__DISPLAY = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__DISPLAY() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__DISPLAY, "DISPLAY", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__DISPLAY); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__FINGERPRINT = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__FINGERPRINT() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__FINGERPRINT, "FINGERPRINT", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__FINGERPRINT); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__HARDWARE = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__HARDWARE() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__HARDWARE, "HARDWARE", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__HARDWARE); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__HOST = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__HOST() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__HOST, "HOST", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__HOST); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__ID = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__ID() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__ID, "ID", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__ID); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__MANUFACTURER = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__MANUFACTURER() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__MANUFACTURER, "MANUFACTURER", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__MANUFACTURER); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__MODEL = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__MODEL() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__MODEL, "MODEL", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__MODEL); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__ODM_SKU = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__ODM_SKU() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__ODM_SKU, "ODM_SKU", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__ODM_SKU); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__PRODUCT = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__PRODUCT() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__PRODUCT, "PRODUCT", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__PRODUCT); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__RADIO = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__RADIO() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__RADIO, "RADIO", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__RADIO); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SERIAL = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SERIAL() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SERIAL, "SERIAL", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__SERIAL); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SKU = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SKU() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SKU, "SKU", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__SKU); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SOC_MANUFACTURER = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SOC_MANUFACTURER() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SOC_MANUFACTURER, "SOC_MANUFACTURER", - "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, - _f_Build__SOC_MANUFACTURER); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SOC_MODEL = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SOC_MODEL() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SOC_MODEL, "SOC_MODEL", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__SOC_MODEL); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SUPPORTED_32_BIT_ABIS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SUPPORTED_32_BIT_ABIS() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SUPPORTED_32_BIT_ABIS, - "SUPPORTED_32_BIT_ABIS", "[Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build, _f_Build__SUPPORTED_32_BIT_ABIS); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SUPPORTED_64_BIT_ABIS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SUPPORTED_64_BIT_ABIS() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SUPPORTED_64_BIT_ABIS, - "SUPPORTED_64_BIT_ABIS", "[Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Build, _f_Build__SUPPORTED_64_BIT_ABIS); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__SUPPORTED_ABIS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__SUPPORTED_ABIS() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__SUPPORTED_ABIS, "SUPPORTED_ABIS", - "[Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, - _f_Build__SUPPORTED_ABIS); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__TAGS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__TAGS() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__TAGS, "TAGS", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__TAGS); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__TIME = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__TIME() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__TIME, "TIME", "J"); - int64_t _result = - (*jniEnv)->GetStaticLongField(jniEnv, _c_Build, _f_Build__TIME); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jfieldID _f_Build__TYPE = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__TYPE() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__TYPE, "TYPE", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__TYPE); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__UNKNOWN = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__UNKNOWN() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__UNKNOWN, "UNKNOWN", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__UNKNOWN); - return to_global_ref_result(_result); -} - -jfieldID _f_Build__USER = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Build__USER() { - load_env(); - load_class_global_ref(&_c_Build, "android/os/Build"); - if (_c_Build == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Build, &_f_Build__USER, "USER", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Build, _f_Build__USER); - return to_global_ref_result(_result); -} - -// java.util.HashMap -jclass _c_HashMap = NULL; - -jmethodID _m_HashMap__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__new0(int32_t i, float f) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__new0, "", "(IF)V"); - if (_m_HashMap__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new0, i, f); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__new1(int32_t i) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__new1, "", "(I)V"); - if (_m_HashMap__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new1, i); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__new2 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__new2() { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__new2, "", "()V"); - if (_m_HashMap__new2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new2); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__new3 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__new3(jobject map) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__new3, "", "(Ljava/util/Map;)V"); - if (_m_HashMap__new3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new3, map); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__size = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__size(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__size, "size", "()I"); - if (_m_HashMap__size == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod(jniEnv, self_, _m_HashMap__size); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__isEmpty = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__isEmpty(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__isEmpty, "isEmpty", "()Z"); - if (_m_HashMap__isEmpty == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_HashMap__isEmpty); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__get0 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__get0(jobject self_, jobject object) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__get0, "get", - "(Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_HashMap__get0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__get0, object); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__containsKey = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__containsKey(jobject self_, jobject object) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__containsKey, "containsKey", - "(Ljava/lang/Object;)Z"); - if (_m_HashMap__containsKey == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_HashMap__containsKey, object); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__put = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__put(jobject self_, jobject object, jobject object1) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__put, "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_HashMap__put == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__put, - object, object1); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__putAll = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__putAll(jobject self_, jobject map) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__putAll, "putAll", "(Ljava/util/Map;)V"); - if (_m_HashMap__putAll == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_HashMap__putAll, map); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__remove = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__remove(jobject self_, jobject object) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__remove, "remove", - "(Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_HashMap__remove == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__remove, object); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__clear = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__clear(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__clear, "clear", "()V"); - if (_m_HashMap__clear == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_HashMap__clear); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__containsValue = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__containsValue(jobject self_, jobject object) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__containsValue, "containsValue", - "(Ljava/lang/Object;)Z"); - if (_m_HashMap__containsValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_HashMap__containsValue, object); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__keySet = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__keySet(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__keySet, "keySet", "()Ljava/util/Set;"); - if (_m_HashMap__keySet == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__keySet); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__values = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__values(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__values, "values", - "()Ljava/util/Collection;"); - if (_m_HashMap__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__values); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__entrySet = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__entrySet(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__entrySet, "entrySet", - "()Ljava/util/Set;"); - if (_m_HashMap__entrySet == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__entrySet); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__getOrDefault = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__getOrDefault(jobject self_, - jobject object, - jobject object1) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__getOrDefault, "getOrDefault", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_HashMap__getOrDefault == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__getOrDefault, object, object1); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__putIfAbsent = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__putIfAbsent(jobject self_, jobject object, jobject object1) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__putIfAbsent, "putIfAbsent", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_HashMap__putIfAbsent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__putIfAbsent, object, object1); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__remove1 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__remove1(jobject self_, jobject object, jobject object1) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__remove1, "remove", - "(Ljava/lang/Object;Ljava/lang/Object;)Z"); - if (_m_HashMap__remove1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_HashMap__remove1, object, object1); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__replace = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__replace(jobject self_, - jobject object, - jobject object1, - jobject object2) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__replace, "replace", - "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z"); - if (_m_HashMap__replace == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_HashMap__replace, object, object1, object2); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__replace1 = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__replace1(jobject self_, jobject object, jobject object1) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__replace1, "replace", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_HashMap__replace1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__replace1, object, object1); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__computeIfAbsent = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__computeIfAbsent(jobject self_, - jobject object, - jobject function) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_HashMap, &_m_HashMap__computeIfAbsent, "computeIfAbsent", - "(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;"); - if (_m_HashMap__computeIfAbsent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__computeIfAbsent, object, function); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__computeIfPresent = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__computeIfPresent(jobject self_, - jobject object, - jobject biFunction) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_HashMap, &_m_HashMap__computeIfPresent, "computeIfPresent", - "(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;"); - if (_m_HashMap__computeIfPresent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__computeIfPresent, object, biFunction); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__compute = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__compute(jobject self_, jobject object, jobject biFunction) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_HashMap, &_m_HashMap__compute, "compute", - "(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;"); - if (_m_HashMap__compute == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__compute, object, biFunction); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__merge = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__merge(jobject self_, - jobject object, - jobject object1, - jobject biFunction) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__merge, "merge", - "(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/" - "BiFunction;)Ljava/lang/Object;"); - if (_m_HashMap__merge == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_HashMap__merge, object, object1, biFunction); - return to_global_ref_result(_result); -} - -jmethodID _m_HashMap__forEach = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__forEach(jobject self_, jobject biConsumer) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__forEach, "forEach", - "(Ljava/util/function/BiConsumer;)V"); - if (_m_HashMap__forEach == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_HashMap__forEach, biConsumer); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__replaceAll = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__replaceAll(jobject self_, jobject biFunction) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__replaceAll, "replaceAll", - "(Ljava/util/function/BiFunction;)V"); - if (_m_HashMap__replaceAll == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_HashMap__replaceAll, biFunction); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_HashMap__clone = NULL; -FFI_PLUGIN_EXPORT -JniResult HashMap__clone(jobject self_) { - load_env(); - load_class_global_ref(&_c_HashMap, "java/util/HashMap"); - if (_c_HashMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__clone, "clone", "()Ljava/lang/Object;"); - if (_m_HashMap__clone == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_HashMap__clone); - return to_global_ref_result(_result); -} - -// com.example.in_app_java.AndroidUtils -jclass _c_AndroidUtils = NULL; - -jmethodID _m_AndroidUtils__showToast = NULL; -FFI_PLUGIN_EXPORT -JniResult AndroidUtils__showToast(jobject mainActivity, - jobject text, - int32_t duration) { - load_env(); - load_class_global_ref(&_c_AndroidUtils, - "com/example/in_app_java/AndroidUtils"); - if (_c_AndroidUtils == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_AndroidUtils, &_m_AndroidUtils__showToast, "showToast", - "(Landroid/app/Activity;Ljava/lang/CharSequence;I)V"); - if (_m_AndroidUtils__showToast == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_AndroidUtils, - _m_AndroidUtils__showToast, mainActivity, - text, duration); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} diff --git a/pkgs/jnigen/example/in_app_java/src/android_utils/dartjni.h b/pkgs/jnigen/example/in_app_java/src/android_utils/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/example/in_app_java/src/android_utils/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/example/kotlin_plugin/android/build.gradle b/pkgs/jnigen/example/kotlin_plugin/android/build.gradle index 6aa0c6272..04bce9b0c 100644 --- a/pkgs/jnigen/example/kotlin_plugin/android/build.gradle +++ b/pkgs/jnigen/example/kotlin_plugin/android/build.gradle @@ -26,21 +26,6 @@ android { main.java.srcDirs += 'src/main/kotlin' } - // Invoke the shared CMake build with the Android Gradle Plugin. - externalNativeBuild { - cmake { - path "../src/CMakeLists.txt" - - // The default CMake version for the Android Gradle Plugin is 3.10.2. - // https://developer.android.com/studio/projects/install-ndk#vanilla_cmake - // - // The Flutter tooling requires that developers have CMake 3.10 or later - // installed. You should not increase this version, as doing so will cause - // the plugin to fail to compile for some customers of the plugin. - // version "3.10.2" - } - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/pkgs/jnigen/example/kotlin_plugin/jnigen.yaml b/pkgs/jnigen/example/kotlin_plugin/jnigen.yaml index 60978f56f..e6f08ecc6 100644 --- a/pkgs/jnigen/example/kotlin_plugin/jnigen.yaml +++ b/pkgs/jnigen/example/kotlin_plugin/jnigen.yaml @@ -5,12 +5,7 @@ android_sdk_config: summarizer: backend: asm -suspend_fun_to_async: true - output: - c: - library_name: kotlin_plugin_bindings - path: src/ dart: path: lib/kotlin_bindings.dart structure: single_file diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index 8e58392c7..0bf5803c8 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart @@ -23,11 +23,6 @@ import "dart:ffi" as ffi; import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("kotlin_plugin_bindings"); - /// from: Example class Example extends jni.JObject { @override @@ -37,25 +32,49 @@ class Example extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = jni.JClass.forName(r"Example"); + /// The type which includes information such as the signature of this class. static const type = $ExampleType(); - static final _new0 = - jniLookup>("Example__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory Example() { - return Example.fromReference(_new0().reference); + return Example.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _thinkBeforeAnswering = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("Example__thinkBeforeAnswering") + static final _id_thinkBeforeAnswering = _class.instanceMethodId( + r"thinkBeforeAnswering", + r"(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", + ); + + static final _thinkBeforeAnswering = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation) /// The returned object must be released after use, by calling the [release] method. @@ -63,7 +82,8 @@ class Example extends jni.JObject { final $p = ReceivePort(); final $c = jni.JObject.fromReference( ProtectedJniExtensions.newPortContinuation($p)); - _thinkBeforeAnswering(reference.pointer, $c.reference.pointer) + _thinkBeforeAnswering(reference.pointer, + _id_thinkBeforeAnswering as jni.JMethodIDPtr, $c.reference.pointer) .object(const jni.JObjectType()); final $o = jni.JGlobalReference(jni.JObjectPtr.fromAddress(await $p.first)); final $k = const jni.JStringType().jClass.reference.pointer; diff --git a/pkgs/jnigen/example/kotlin_plugin/src/.clang-format b/pkgs/jnigen/example/kotlin_plugin/src/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/example/kotlin_plugin/src/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/example/kotlin_plugin/src/CMakeLists.txt b/pkgs/jnigen/example/kotlin_plugin/src/CMakeLists.txt deleted file mode 100644 index 78d9dca2c..000000000 --- a/pkgs/jnigen/example/kotlin_plugin/src/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(kotlin_plugin_bindings VERSION 0.0.1 LANGUAGES C) - -add_library(kotlin_plugin_bindings SHARED - "./kotlin_plugin_bindings.c" -) - -set_target_properties(kotlin_plugin_bindings PROPERTIES - OUTPUT_NAME "kotlin_plugin_bindings" -) - -target_compile_definitions(kotlin_plugin_bindings PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(kotlin_plugin_bindings log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(kotlin_plugin_bindings ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/example/kotlin_plugin/src/dartjni.h b/pkgs/jnigen/example/kotlin_plugin/src/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/example/kotlin_plugin/src/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c b/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c deleted file mode 100644 index 28a2af621..000000000 --- a/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c +++ /dev/null @@ -1,50 +0,0 @@ -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// Example -jclass _c_Example = NULL; - -jmethodID _m_Example__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__new0() { - load_env(); - load_class_global_ref(&_c_Example, "Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__new0, "", "()V"); - if (_m_Example__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__thinkBeforeAnswering = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__thinkBeforeAnswering(jobject self_, jobject continuation) { - load_env(); - load_class_global_ref(&_c_Example, "Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__thinkBeforeAnswering, - "thinkBeforeAnswering", - "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"); - if (_m_Example__thinkBeforeAnswering == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Example__thinkBeforeAnswering, continuation); - return to_global_ref_result(_result); -} diff --git a/pkgs/jnigen/example/notification_plugin/android/build.gradle b/pkgs/jnigen/example/notification_plugin/android/build.gradle index c3dd19340..fd63c0d8a 100644 --- a/pkgs/jnigen/example/notification_plugin/android/build.gradle +++ b/pkgs/jnigen/example/notification_plugin/android/build.gradle @@ -21,21 +21,6 @@ android { // the version in their app and to download a newer version of the NDK. ndkVersion "21.1.6352462" - // Invoke the shared CMake build with the Android Gradle Plugin. - externalNativeBuild { - cmake { - path "../src/CMakeLists.txt" - - // The default CMake version for the Android Gradle Plugin is 3.10.2. - // https://developer.android.com/studio/projects/install-ndk#vanilla_cmake - // - // The Flutter tooling requires that developers have CMake 3.10 or later - // installed. You should not increase this version, as doing so will cause - // the plugin to fail to compile for some customers of the plugin. - // version "3.10.2" - } - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/pkgs/jnigen/example/notification_plugin/jnigen.yaml b/pkgs/jnigen/example/notification_plugin/jnigen.yaml index 21f4106f1..25db43459 100644 --- a/pkgs/jnigen/example/notification_plugin/jnigen.yaml +++ b/pkgs/jnigen/example/notification_plugin/jnigen.yaml @@ -13,9 +13,6 @@ classes: - 'com.example.notification_plugin.Notifications' output: - c: - path: 'src/' - library_name: notification_plugin dart: path: 'lib/notifications.dart' ## Output to single file instead of recreating source's file structure. diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index f74175f85..ef127a052 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart @@ -27,11 +27,6 @@ import "dart:ffi" as ffi; import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("notification_plugin"); - /// from: com.example.notification_plugin.Notifications class Notifications extends jni.JObject { @override @@ -41,28 +36,60 @@ class Notifications extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"com/example/notification_plugin/Notifications"); + /// The type which includes information such as the signature of this class. static const type = $NotificationsType(); - static final _new0 = jniLookup>( - "Notifications__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. factory Notifications() { - return Notifications.fromReference(_new0().reference); + return Notifications.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _showNotification = jniLookup< + static final _id_showNotification = _class.staticMethodId( + r"showNotification", + r"(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V", + ); + + static final _showNotification = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Int32, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer)>>("Notifications__showNotification") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); /// from: static public void showNotification(android.content.Context context, int notificationID, java.lang.String title, java.lang.String text) static void showNotification( @@ -71,8 +98,13 @@ class Notifications extends jni.JObject { jni.JString title, jni.JString text, ) { - _showNotification(context.reference.pointer, notificationID, - title.reference.pointer, text.reference.pointer) + _showNotification( + _class.reference.pointer, + _id_showNotification as jni.JMethodIDPtr, + context.reference.pointer, + notificationID, + title.reference.pointer, + text.reference.pointer) .check(); } } diff --git a/pkgs/jnigen/example/notification_plugin/src/.clang-format b/pkgs/jnigen/example/notification_plugin/src/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/example/notification_plugin/src/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/example/notification_plugin/src/CMakeLists.txt b/pkgs/jnigen/example/notification_plugin/src/CMakeLists.txt deleted file mode 100644 index 39c985034..000000000 --- a/pkgs/jnigen/example/notification_plugin/src/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(notification_plugin VERSION 0.0.1 LANGUAGES C) - -add_library(notification_plugin SHARED - "./notification_plugin.c" -) - -set_target_properties(notification_plugin PROPERTIES - OUTPUT_NAME "notification_plugin" -) - -target_compile_definitions(notification_plugin PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(notification_plugin log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(notification_plugin ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/example/notification_plugin/src/dartjni.h b/pkgs/jnigen/example/notification_plugin/src/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/example/notification_plugin/src/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c b/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c deleted file mode 100644 index 9f1e57745..000000000 --- a/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c +++ /dev/null @@ -1,61 +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. - -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// com.example.notification_plugin.Notifications -jclass _c_Notifications = NULL; - -jmethodID _m_Notifications__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Notifications__new0() { - load_env(); - load_class_global_ref(&_c_Notifications, - "com/example/notification_plugin/Notifications"); - if (_c_Notifications == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Notifications, &_m_Notifications__new0, "", "()V"); - if (_m_Notifications__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Notifications, _m_Notifications__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_Notifications__showNotification = NULL; -FFI_PLUGIN_EXPORT -JniResult Notifications__showNotification(jobject context, - int32_t notificationID, - jobject title, - jobject text) { - load_env(); - load_class_global_ref(&_c_Notifications, - "com/example/notification_plugin/Notifications"); - if (_c_Notifications == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_Notifications, &_m_Notifications__showNotification, "showNotification", - "(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V"); - if (_m_Notifications__showNotification == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Notifications, - _m_Notifications__showNotification, context, - notificationID, title, text); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} diff --git a/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle b/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle index 5042ecef5..6ea97b832 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle +++ b/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle @@ -21,21 +21,6 @@ android { // the version in their app and to download a newer version of the NDK. ndkVersion "21.1.6352462" - // Invoke the shared CMake build with the Android Gradle Plugin. - externalNativeBuild { - cmake { - path "../src/CMakeLists.txt" - - // The default CMake version for the Android Gradle Plugin is 3.10.2. - // https://developer.android.com/studio/projects/install-ndk#vanilla_cmake - // - // The Flutter tooling requires that developers have CMake 3.10 or later - // installed. You should not increase this version, as doing so will cause - // the plugin to fail to compile for some customers of the plugin. - // version "3.10.2" - } - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/pkgs/jnigen/example/pdfbox_plugin/jnigen.yaml b/pkgs/jnigen/example/pdfbox_plugin/jnigen.yaml index fa24d8501..33b3ef87c 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/jnigen.yaml +++ b/pkgs/jnigen/example/pdfbox_plugin/jnigen.yaml @@ -20,18 +20,6 @@ preamble: | ## Output configuration output: - c: - ## Path to write generated C bindings - path: 'src/' - ## C files can be stored in a different sub-directory inside root. - ## - ## We have a guideline to keep all generated code in third_party/ since the - ## original project's license applies to generated code. So we specify - ## third_party/ as c_subdir while keeping generated CMakeLists.txt in src/. - subdir: 'third_party/' - ## Name of the generated library. This is a required parameter, and used - ## for the name of the shared library and CMake configuration. - library_name: 'pdfbox_plugin' dart: ## Generated dart bindings will be written to this path. They will follow ## the same folder hierarchy as the original Java code. diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/_init.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/_init.dart deleted file mode 100644 index 57aea60db..000000000 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/_init.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Generated from Apache PDFBox library which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; - -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("pdfbox_plugin"); 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 e63e4711d..e664b41ac 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 @@ -42,7 +42,6 @@ import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; import "PDDocumentInformation.dart" as pddocumentinformation_; -import "../../../../_init.dart"; /// from: org.apache.pdfbox.pdmodel.PDDocument /// @@ -57,11 +56,26 @@ class PDDocument extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"org/apache/pdfbox/pdmodel/PDDocument"); + /// The type which includes information such as the signature of this class. static const type = $PDDocumentType(); - static final _new0 = jniLookup>( - "PDDocument__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. @@ -69,14 +83,25 @@ class PDDocument extends jni.JObject { /// Creates an empty PDF document. /// You need to add at least one page for the document to be valid. factory PDDocument() { - return PDDocument.fromReference(_new0().reference); + return PDDocument.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _new1 = jniLookup< - ffi - .NativeFunction)>>( - "PDDocument__new1") - .asFunction)>(); + static final _id_new1 = _class.constructorId( + r"(Lorg/apache/pdfbox/io/MemoryUsageSetting;)V", + ); + + static final _new1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void (org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) /// The returned object must be released after use, by calling the [release] method. @@ -87,15 +112,25 @@ class PDDocument extends jni.JObject { factory PDDocument.new1( jni.JObject memUsageSetting, ) { - return PDDocument.fromReference( - _new1(memUsageSetting.reference.pointer).reference); + return PDDocument.fromReference(_new1(_class.reference.pointer, + _id_new1 as jni.JMethodIDPtr, memUsageSetting.reference.pointer) + .reference); } - static final _new2 = jniLookup< - ffi - .NativeFunction)>>( - "PDDocument__new2") - .asFunction)>(); + static final _id_new2 = _class.constructorId( + r"(Lorg/apache/pdfbox/cos/COSDocument;)V", + ); + + static final _new2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void (org.apache.pdfbox.cos.COSDocument doc) /// The returned object must be released after use, by calling the [release] method. @@ -105,15 +140,27 @@ class PDDocument extends jni.JObject { factory PDDocument.new2( jni.JObject doc, ) { - return PDDocument.fromReference(_new2(doc.reference.pointer).reference); + return PDDocument.fromReference(_new2(_class.reference.pointer, + _id_new2 as jni.JMethodIDPtr, doc.reference.pointer) + .reference); } - static final _new3 = jniLookup< + static final _id_new3 = _class.constructorId( + r"(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/RandomAccessRead;)V", + ); + + static final _new3 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__new3") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_NewObject") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: public void (org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source) @@ -126,18 +173,35 @@ class PDDocument extends jni.JObject { jni.JObject doc, jni.JObject source, ) { - return PDDocument.fromReference( - _new3(doc.reference.pointer, source.reference.pointer).reference); + return PDDocument.fromReference(_new3( + _class.reference.pointer, + _id_new3 as jni.JMethodIDPtr, + doc.reference.pointer, + source.reference.pointer) + .reference); } - static final _new4 = jniLookup< + static final _id_new4 = _class.constructorId( + r"(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/RandomAccessRead;Lorg/apache/pdfbox/pdmodel/encryption/AccessPermission;)V", + ); + + static final _new4 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__new4") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_NewObject") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// from: public void (org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source, org.apache.pdfbox.pdmodel.encryption.AccessPermission permission) @@ -152,18 +216,30 @@ class PDDocument extends jni.JObject { jni.JObject source, jni.JObject permission, ) { - return PDDocument.fromReference(_new4(doc.reference.pointer, - source.reference.pointer, permission.reference.pointer) + return PDDocument.fromReference(_new4( + _class.reference.pointer, + _id_new4 as jni.JMethodIDPtr, + doc.reference.pointer, + source.reference.pointer, + permission.reference.pointer) .reference); } - static final _addPage = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__addPage") + static final _id_addPage = _class.instanceMethodId( + r"addPage", + r"(Lorg/apache/pdfbox/pdmodel/PDPage;)V", + ); + + static final _addPage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void addPage(org.apache.pdfbox.pdmodel.PDPage page) /// @@ -173,16 +249,26 @@ class PDDocument extends jni.JObject { void addPage( jni.JObject page, ) { - _addPage(reference.pointer, page.reference.pointer).check(); + _addPage(reference.pointer, _id_addPage as jni.JMethodIDPtr, + page.reference.pointer) + .check(); } - static final _addSignature = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__addSignature") + static final _id_addSignature = _class.instanceMethodId( + r"addSignature", + r"(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;)V", + ); + + static final _addSignature = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject) /// @@ -199,18 +285,29 @@ class PDDocument extends jni.JObject { void addSignature( jni.JObject sigObject, ) { - _addSignature(reference.pointer, sigObject.reference.pointer).check(); + _addSignature(reference.pointer, _id_addSignature as jni.JMethodIDPtr, + sigObject.reference.pointer) + .check(); } - static final _addSignature1 = jniLookup< + static final _id_addSignature1 = _class.instanceMethodId( + r"addSignature", + r"(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V", + ); + + static final _addSignature1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer)>>("PDDocument__addSignature1") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options) /// @@ -229,20 +326,29 @@ class PDDocument extends jni.JObject { jni.JObject sigObject, jni.JObject options, ) { - _addSignature1(reference.pointer, sigObject.reference.pointer, - options.reference.pointer) + _addSignature1(reference.pointer, _id_addSignature1 as jni.JMethodIDPtr, + sigObject.reference.pointer, options.reference.pointer) .check(); } - static final _addSignature2 = jniLookup< + static final _id_addSignature2 = _class.instanceMethodId( + r"addSignature", + r"(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;)V", + ); + + static final _addSignature2 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer)>>("PDDocument__addSignature2") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface) /// @@ -260,21 +366,34 @@ class PDDocument extends jni.JObject { jni.JObject sigObject, jni.JObject signatureInterface, ) { - _addSignature2(reference.pointer, sigObject.reference.pointer, - signatureInterface.reference.pointer) + _addSignature2(reference.pointer, _id_addSignature2 as jni.JMethodIDPtr, + sigObject.reference.pointer, signatureInterface.reference.pointer) .check(); } - static final _addSignature3 = jniLookup< + static final _id_addSignature3 = _class.instanceMethodId( + r"addSignature", + r"(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V", + ); + + static final _addSignature3 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__addSignature3") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options) /// @@ -296,21 +415,38 @@ class PDDocument extends jni.JObject { jni.JObject signatureInterface, jni.JObject options, ) { - _addSignature3(reference.pointer, sigObject.reference.pointer, - signatureInterface.reference.pointer, options.reference.pointer) + _addSignature3( + reference.pointer, + _id_addSignature3 as jni.JMethodIDPtr, + sigObject.reference.pointer, + signatureInterface.reference.pointer, + options.reference.pointer) .check(); } - static final _addSignatureField = jniLookup< + static final _id_addSignatureField = _class.instanceMethodId( + r"addSignatureField", + r"(Ljava/util/List;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V", + ); + + static final _addSignatureField = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__addSignatureField") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: public void addSignatureField(java.util.List sigFields, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options) /// @@ -327,18 +463,30 @@ class PDDocument extends jni.JObject { jni.JObject signatureInterface, jni.JObject options, ) { - _addSignatureField(reference.pointer, sigFields.reference.pointer, - signatureInterface.reference.pointer, options.reference.pointer) + _addSignatureField( + reference.pointer, + _id_addSignatureField as jni.JMethodIDPtr, + sigFields.reference.pointer, + signatureInterface.reference.pointer, + options.reference.pointer) .check(); } - static final _removePage = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__removePage") + static final _id_removePage = _class.instanceMethodId( + r"removePage", + r"(Lorg/apache/pdfbox/pdmodel/PDPage;)V", + ); + + static final _removePage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void removePage(org.apache.pdfbox.pdmodel.PDPage page) /// @@ -347,14 +495,25 @@ class PDDocument extends jni.JObject { void removePage( jni.JObject page, ) { - _removePage(reference.pointer, page.reference.pointer).check(); + _removePage(reference.pointer, _id_removePage as jni.JMethodIDPtr, + page.reference.pointer) + .check(); } - static final _removePage1 = jniLookup< + static final _id_removePage1 = _class.instanceMethodId( + r"removePage", + r"(I)V", + ); + + static final _removePage1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Int32)>>("PDDocument__removePage1") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void removePage(int pageNumber) /// @@ -363,16 +522,26 @@ class PDDocument extends jni.JObject { void removePage1( int pageNumber, ) { - _removePage1(reference.pointer, pageNumber).check(); + _removePage1( + reference.pointer, _id_removePage1 as jni.JMethodIDPtr, pageNumber) + .check(); } - static final _importPage = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__importPage") + static final _id_importPage = _class.instanceMethodId( + r"importPage", + r"(Lorg/apache/pdfbox/pdmodel/PDPage;)Lorg/apache/pdfbox/pdmodel/PDPage;", + ); + + static final _importPage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public org.apache.pdfbox.pdmodel.PDPage importPage(org.apache.pdfbox.pdmodel.PDPage page) /// The returned object must be released after use, by calling the [release] method. @@ -401,18 +570,26 @@ class PDDocument extends jni.JObject { jni.JObject importPage( jni.JObject page, ) { - return _importPage(reference.pointer, page.reference.pointer) + return _importPage(reference.pointer, _id_importPage as jni.JMethodIDPtr, + page.reference.pointer) .object(const jni.JObjectType()); } - static final _getDocument = jniLookup< + static final _id_getDocument = _class.instanceMethodId( + r"getDocument", + r"()Lorg/apache/pdfbox/cos/COSDocument;", + ); + + static final _getDocument = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getDocument") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.cos.COSDocument getDocument() @@ -421,17 +598,25 @@ class PDDocument extends jni.JObject { /// This will get the low level document. ///@return The document that this layer sits on top of. jni.JObject getDocument() { - return _getDocument(reference.pointer).object(const jni.JObjectType()); + return _getDocument(reference.pointer, _id_getDocument as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _getDocumentInformation = jniLookup< + static final _id_getDocumentInformation = _class.instanceMethodId( + r"getDocumentInformation", + r"()Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;", + ); + + static final _getDocumentInformation = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getDocumentInformation") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.PDDocumentInformation getDocumentInformation() @@ -445,17 +630,26 @@ class PDDocument extends jni.JObject { /// PDDocumentCatalog\#getMetadata(). ///@return The documents /Info dictionary, never null. pddocumentinformation_.PDDocumentInformation getDocumentInformation() { - return _getDocumentInformation(reference.pointer) + return _getDocumentInformation( + reference.pointer, _id_getDocumentInformation as jni.JMethodIDPtr) .object(const pddocumentinformation_.$PDDocumentInformationType()); } - static final _setDocumentInformation = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__setDocumentInformation") + static final _id_setDocumentInformation = _class.instanceMethodId( + r"setDocumentInformation", + r"(Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;)V", + ); + + static final _setDocumentInformation = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setDocumentInformation(org.apache.pdfbox.pdmodel.PDDocumentInformation info) /// @@ -468,17 +662,28 @@ class PDDocument extends jni.JObject { void setDocumentInformation( pddocumentinformation_.PDDocumentInformation info, ) { - _setDocumentInformation(reference.pointer, info.reference.pointer).check(); + _setDocumentInformation( + reference.pointer, + _id_setDocumentInformation as jni.JMethodIDPtr, + info.reference.pointer) + .check(); } - static final _getDocumentCatalog = jniLookup< + static final _id_getDocumentCatalog = _class.instanceMethodId( + r"getDocumentCatalog", + r"()Lorg/apache/pdfbox/pdmodel/PDDocumentCatalog;", + ); + + static final _getDocumentCatalog = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getDocumentCatalog") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.PDDocumentCatalog getDocumentCatalog() @@ -487,18 +692,26 @@ class PDDocument extends jni.JObject { /// This will get the document CATALOG. This is guaranteed to not return null. ///@return The documents /Root dictionary jni.JObject getDocumentCatalog() { - return _getDocumentCatalog(reference.pointer) + return _getDocumentCatalog( + reference.pointer, _id_getDocumentCatalog as jni.JMethodIDPtr) .object(const jni.JObjectType()); } - static final _isEncrypted = jniLookup< + static final _id_isEncrypted = _class.instanceMethodId( + r"isEncrypted", + r"()Z", + ); + + static final _isEncrypted = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__isEncrypted") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean isEncrypted() @@ -506,17 +719,25 @@ class PDDocument extends jni.JObject { /// This will tell if this document is encrypted or not. ///@return true If this document is encrypted. bool isEncrypted() { - return _isEncrypted(reference.pointer).boolean; + return _isEncrypted(reference.pointer, _id_isEncrypted as jni.JMethodIDPtr) + .boolean; } - static final _getEncryption = jniLookup< + static final _id_getEncryption = _class.instanceMethodId( + r"getEncryption", + r"()Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;", + ); + + static final _getEncryption = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getEncryption") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.encryption.PDEncryption getEncryption() @@ -528,17 +749,26 @@ class PDDocument extends jni.JObject { /// PDStandardEncryption object. ///@return The encryption dictionary(most likely a PDStandardEncryption object) jni.JObject getEncryption() { - return _getEncryption(reference.pointer).object(const jni.JObjectType()); + return _getEncryption( + reference.pointer, _id_getEncryption as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _setEncryptionDictionary = jniLookup< + static final _id_setEncryptionDictionary = _class.instanceMethodId( + r"setEncryptionDictionary", + r"(Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;)V", + ); + + static final _setEncryptionDictionary = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocument__setEncryptionDictionary") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setEncryptionDictionary(org.apache.pdfbox.pdmodel.encryption.PDEncryption encryption) /// @@ -548,18 +778,28 @@ class PDDocument extends jni.JObject { void setEncryptionDictionary( jni.JObject encryption, ) { - _setEncryptionDictionary(reference.pointer, encryption.reference.pointer) + _setEncryptionDictionary( + reference.pointer, + _id_setEncryptionDictionary as jni.JMethodIDPtr, + encryption.reference.pointer) .check(); } - static final _getLastSignatureDictionary = jniLookup< + static final _id_getLastSignatureDictionary = _class.instanceMethodId( + r"getLastSignatureDictionary", + r"()Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;", + ); + + static final _getLastSignatureDictionary = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getLastSignatureDictionary") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getLastSignatureDictionary() @@ -570,18 +810,26 @@ class PDDocument extends jni.JObject { ///@return the last signature as PDSignatureField. ///@throws IOException if no document catalog can be found. jni.JObject getLastSignatureDictionary() { - return _getLastSignatureDictionary(reference.pointer) + return _getLastSignatureDictionary(reference.pointer, + _id_getLastSignatureDictionary as jni.JMethodIDPtr) .object(const jni.JObjectType()); } - static final _getSignatureFields = jniLookup< + static final _id_getSignatureFields = _class.instanceMethodId( + r"getSignatureFields", + r"()Ljava/util/List;", + ); + + static final _getSignatureFields = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getSignatureFields") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.List getSignatureFields() @@ -591,18 +839,26 @@ class PDDocument extends jni.JObject { ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. jni.JList getSignatureFields() { - return _getSignatureFields(reference.pointer) + return _getSignatureFields( + reference.pointer, _id_getSignatureFields as jni.JMethodIDPtr) .object(const jni.JListType(jni.JObjectType())); } - static final _getSignatureDictionaries = jniLookup< + static final _id_getSignatureDictionaries = _class.instanceMethodId( + r"getSignatureDictionaries", + r"()Ljava/util/List;", + ); + + static final _getSignatureDictionaries = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getSignatureDictionaries") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.List getSignatureDictionaries() @@ -612,18 +868,26 @@ class PDDocument extends jni.JObject { ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. jni.JList getSignatureDictionaries() { - return _getSignatureDictionaries(reference.pointer) + return _getSignatureDictionaries( + reference.pointer, _id_getSignatureDictionaries as jni.JMethodIDPtr) .object(const jni.JListType(jni.JObjectType())); } - static final _registerTrueTypeFontForClosing = jniLookup< + static final _id_registerTrueTypeFontForClosing = _class.instanceMethodId( + r"registerTrueTypeFontForClosing", + r"(Lorg/apache/fontbox/ttf/TrueTypeFont;)V", + ); + + static final _registerTrueTypeFontForClosing = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocument__registerTrueTypeFontForClosing") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void registerTrueTypeFontForClosing(org.apache.fontbox.ttf.TrueTypeFont ttf) /// @@ -634,15 +898,28 @@ class PDDocument extends jni.JObject { void registerTrueTypeFontForClosing( jni.JObject ttf, ) { - _registerTrueTypeFontForClosing(reference.pointer, ttf.reference.pointer) + _registerTrueTypeFontForClosing( + reference.pointer, + _id_registerTrueTypeFontForClosing as jni.JMethodIDPtr, + ttf.reference.pointer) .check(); } - static final _load = jniLookup< - ffi - .NativeFunction)>>( - "PDDocument__load") - .asFunction)>(); + static final _id_load = _class.staticMethodId( + r"load", + r"(Ljava/io/File;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file) /// The returned object must be released after use, by calling the [release] method. @@ -655,15 +932,28 @@ class PDDocument extends jni.JObject { static PDDocument load( jni.JObject file, ) { - return _load(file.reference.pointer).object(const $PDDocumentType()); + return _load(_class.reference.pointer, _id_load as jni.JMethodIDPtr, + file.reference.pointer) + .object(const $PDDocumentType()); } - static final _load1 = jniLookup< + static final _id_load1 = _class.staticMethodId( + r"load", + r"(Ljava/io/File;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__load1") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) @@ -679,16 +969,28 @@ class PDDocument extends jni.JObject { jni.JObject file, jni.JObject memUsageSetting, ) { - return _load1(file.reference.pointer, memUsageSetting.reference.pointer) + return _load1(_class.reference.pointer, _id_load1 as jni.JMethodIDPtr, + file.reference.pointer, memUsageSetting.reference.pointer) .object(const $PDDocumentType()); } - static final _load2 = jniLookup< + static final _id_load2 = _class.staticMethodId( + r"load", + r"(Ljava/io/File;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load2 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__load2") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password) @@ -704,18 +1006,33 @@ class PDDocument extends jni.JObject { jni.JObject file, jni.JString password, ) { - return _load2(file.reference.pointer, password.reference.pointer) + return _load2(_class.reference.pointer, _id_load2 as jni.JMethodIDPtr, + file.reference.pointer, password.reference.pointer) .object(const $PDDocumentType()); } - static final _load3 = jniLookup< + static final _id_load3 = _class.staticMethodId( + r"load", + r"(Ljava/io/File;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load3 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load3") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) @@ -733,21 +1050,40 @@ class PDDocument extends jni.JObject { jni.JString password, jni.JObject memUsageSetting, ) { - return _load3(file.reference.pointer, password.reference.pointer, + return _load3( + _class.reference.pointer, + _id_load3 as jni.JMethodIDPtr, + file.reference.pointer, + password.reference.pointer, memUsageSetting.reference.pointer) .object(const $PDDocumentType()); } - static final _load4 = jniLookup< + static final _id_load4 = _class.staticMethodId( + r"load", + r"(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load4 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load4") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias) /// The returned object must be released after use, by calling the [release] method. @@ -765,21 +1101,38 @@ class PDDocument extends jni.JObject { jni.JObject keyStore, jni.JString alias, ) { - return _load4(file.reference.pointer, password.reference.pointer, - keyStore.reference.pointer, alias.reference.pointer) + return _load4( + _class.reference.pointer, + _id_load4 as jni.JMethodIDPtr, + file.reference.pointer, + password.reference.pointer, + keyStore.reference.pointer, + alias.reference.pointer) .object(const $PDDocumentType()); } - static final _load5 = jniLookup< + static final _id_load5 = _class.staticMethodId( + r"load", + r"(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load5 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load5") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -805,6 +1158,8 @@ class PDDocument extends jni.JObject { jni.JObject memUsageSetting, ) { return _load5( + _class.reference.pointer, + _id_load5 as jni.JMethodIDPtr, file.reference.pointer, password.reference.pointer, keyStore.reference.pointer, @@ -813,11 +1168,21 @@ class PDDocument extends jni.JObject { .object(const $PDDocumentType()); } - static final _load6 = jniLookup< - ffi - .NativeFunction)>>( - "PDDocument__load6") - .asFunction)>(); + static final _id_load6 = _class.staticMethodId( + r"load", + r"(Ljava/io/InputStream;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load6 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input) /// The returned object must be released after use, by calling the [release] method. @@ -831,15 +1196,28 @@ class PDDocument extends jni.JObject { static PDDocument load6( jni.JObject input, ) { - return _load6(input.reference.pointer).object(const $PDDocumentType()); + return _load6(_class.reference.pointer, _id_load6 as jni.JMethodIDPtr, + input.reference.pointer) + .object(const $PDDocumentType()); } - static final _load7 = jniLookup< + static final _id_load7 = _class.staticMethodId( + r"load", + r"(Ljava/io/InputStream;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load7 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__load7") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) @@ -856,16 +1234,28 @@ class PDDocument extends jni.JObject { jni.JObject input, jni.JObject memUsageSetting, ) { - return _load7(input.reference.pointer, memUsageSetting.reference.pointer) + return _load7(_class.reference.pointer, _id_load7 as jni.JMethodIDPtr, + input.reference.pointer, memUsageSetting.reference.pointer) .object(const $PDDocumentType()); } - static final _load8 = jniLookup< + static final _id_load8 = _class.staticMethodId( + r"load", + r"(Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load8 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__load8") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password) @@ -882,20 +1272,36 @@ class PDDocument extends jni.JObject { jni.JObject input, jni.JString password, ) { - return _load8(input.reference.pointer, password.reference.pointer) + return _load8(_class.reference.pointer, _id_load8 as jni.JMethodIDPtr, + input.reference.pointer, password.reference.pointer) .object(const $PDDocumentType()); } - static final _load9 = jniLookup< + static final _id_load9 = _class.staticMethodId( + r"load", + r"(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load9 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load9") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias) /// The returned object must be released after use, by calling the [release] method. @@ -914,19 +1320,38 @@ class PDDocument extends jni.JObject { jni.JObject keyStore, jni.JString alias, ) { - return _load9(input.reference.pointer, password.reference.pointer, - keyStore.reference.pointer, alias.reference.pointer) + return _load9( + _class.reference.pointer, + _id_load9 as jni.JMethodIDPtr, + input.reference.pointer, + password.reference.pointer, + keyStore.reference.pointer, + alias.reference.pointer) .object(const $PDDocumentType()); } - static final _load10 = jniLookup< + static final _id_load10 = _class.staticMethodId( + r"load", + r"(Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load10 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load10") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) @@ -945,21 +1370,37 @@ class PDDocument extends jni.JObject { jni.JString password, jni.JObject memUsageSetting, ) { - return _load10(input.reference.pointer, password.reference.pointer, + return _load10( + _class.reference.pointer, + _id_load10 as jni.JMethodIDPtr, + input.reference.pointer, + password.reference.pointer, memUsageSetting.reference.pointer) .object(const $PDDocumentType()); } - static final _load11 = jniLookup< + static final _id_load11 = _class.staticMethodId( + r"load", + r"(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load11 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load11") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -987,6 +1428,8 @@ class PDDocument extends jni.JObject { jni.JObject memUsageSetting, ) { return _load11( + _class.reference.pointer, + _id_load11 as jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, keyStore.reference.pointer, @@ -995,11 +1438,21 @@ class PDDocument extends jni.JObject { .object(const $PDDocumentType()); } - static final _load12 = jniLookup< - ffi - .NativeFunction)>>( - "PDDocument__load12") - .asFunction)>(); + static final _id_load12 = _class.staticMethodId( + r"load", + r"([B)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load12 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input) /// The returned object must be released after use, by calling the [release] method. @@ -1012,15 +1465,28 @@ class PDDocument extends jni.JObject { static PDDocument load12( jni.JArray input, ) { - return _load12(input.reference.pointer).object(const $PDDocumentType()); + return _load12(_class.reference.pointer, _id_load12 as jni.JMethodIDPtr, + input.reference.pointer) + .object(const $PDDocumentType()); } - static final _load13 = jniLookup< + static final _id_load13 = _class.staticMethodId( + r"load", + r"([BLjava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load13 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__load13") + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function( + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password) @@ -1036,20 +1502,36 @@ class PDDocument extends jni.JObject { jni.JArray input, jni.JString password, ) { - return _load13(input.reference.pointer, password.reference.pointer) + return _load13(_class.reference.pointer, _id_load13 as jni.JMethodIDPtr, + input.reference.pointer, password.reference.pointer) .object(const $PDDocumentType()); } - static final _load14 = jniLookup< + static final _id_load14 = _class.staticMethodId( + r"load", + r"([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load14 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load14") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias) /// The returned object must be released after use, by calling the [release] method. @@ -1068,21 +1550,38 @@ class PDDocument extends jni.JObject { jni.JObject keyStore, jni.JString alias, ) { - return _load14(input.reference.pointer, password.reference.pointer, - keyStore.reference.pointer, alias.reference.pointer) + return _load14( + _class.reference.pointer, + _id_load14 as jni.JMethodIDPtr, + input.reference.pointer, + password.reference.pointer, + keyStore.reference.pointer, + alias.reference.pointer) .object(const $PDDocumentType()); } - static final _load15 = jniLookup< + static final _id_load15 = _class.staticMethodId( + r"load", + r"([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); + + static final _load15 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDDocument__load15") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -1109,6 +1608,8 @@ class PDDocument extends jni.JObject { jni.JObject memUsageSetting, ) { return _load15( + _class.reference.pointer, + _id_load15 as jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, keyStore.reference.pointer, @@ -1117,13 +1618,21 @@ class PDDocument extends jni.JObject { .object(const $PDDocumentType()); } - static final _save = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__save") + static final _id_save = _class.instanceMethodId( + r"save", + r"(Ljava/lang/String;)V", + ); + + static final _save = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void save(java.lang.String fileName) /// @@ -1137,16 +1646,26 @@ class PDDocument extends jni.JObject { void save( jni.JString fileName, ) { - _save(reference.pointer, fileName.reference.pointer).check(); + _save(reference.pointer, _id_save as jni.JMethodIDPtr, + fileName.reference.pointer) + .check(); } - static final _save1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__save1") + static final _id_save1 = _class.instanceMethodId( + r"save", + r"(Ljava/io/File;)V", + ); + + static final _save1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void save(java.io.File file) /// @@ -1160,16 +1679,26 @@ class PDDocument extends jni.JObject { void save1( jni.JObject file, ) { - _save1(reference.pointer, file.reference.pointer).check(); + _save1(reference.pointer, _id_save1 as jni.JMethodIDPtr, + file.reference.pointer) + .check(); } - static final _save2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__save2") + static final _id_save2 = _class.instanceMethodId( + r"save", + r"(Ljava/io/OutputStream;)V", + ); + + static final _save2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void save(java.io.OutputStream output) /// @@ -1184,16 +1713,26 @@ class PDDocument extends jni.JObject { void save2( jni.JObject output, ) { - _save2(reference.pointer, output.reference.pointer).check(); + _save2(reference.pointer, _id_save2 as jni.JMethodIDPtr, + output.reference.pointer) + .check(); } - static final _saveIncremental = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__saveIncremental") + static final _id_saveIncremental = _class.instanceMethodId( + r"saveIncremental", + r"(Ljava/io/OutputStream;)V", + ); + + static final _saveIncremental = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void saveIncremental(java.io.OutputStream output) /// @@ -1213,18 +1752,29 @@ class PDDocument extends jni.JObject { void saveIncremental( jni.JObject output, ) { - _saveIncremental(reference.pointer, output.reference.pointer).check(); + _saveIncremental(reference.pointer, _id_saveIncremental as jni.JMethodIDPtr, + output.reference.pointer) + .check(); } - static final _saveIncremental1 = jniLookup< + static final _id_saveIncremental1 = _class.instanceMethodId( + r"saveIncremental", + r"(Ljava/io/OutputStream;Ljava/util/Set;)V", + ); + + static final _saveIncremental1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer)>>("PDDocument__saveIncremental1") + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public void saveIncremental(java.io.OutputStream output, java.util.Set objectsToWrite) /// @@ -1250,19 +1800,30 @@ class PDDocument extends jni.JObject { jni.JObject output, jni.JSet objectsToWrite, ) { - _saveIncremental1(reference.pointer, output.reference.pointer, + _saveIncremental1( + reference.pointer, + _id_saveIncremental1 as jni.JMethodIDPtr, + output.reference.pointer, objectsToWrite.reference.pointer) .check(); } - static final _saveIncrementalForExternalSigning = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocument__saveIncrementalForExternalSigning") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + static final _id_saveIncrementalForExternalSigning = _class.instanceMethodId( + r"saveIncrementalForExternalSigning", + r"(Ljava/io/OutputStream;)Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/ExternalSigningSupport;", + ); + + static final _saveIncrementalForExternalSigning = + ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public org.apache.pdfbox.pdmodel.interactive.digitalsignature.ExternalSigningSupport saveIncrementalForExternalSigning(java.io.OutputStream output) /// The returned object must be released after use, by calling the [release] method. @@ -1308,15 +1869,24 @@ class PDDocument extends jni.JObject { jni.JObject output, ) { return _saveIncrementalForExternalSigning( - reference.pointer, output.reference.pointer) + reference.pointer, + _id_saveIncrementalForExternalSigning as jni.JMethodIDPtr, + output.reference.pointer) .object(const jni.JObjectType()); } - static final _getPage = jniLookup< + static final _id_getPage = _class.instanceMethodId( + r"getPage", + r"(I)Lorg/apache/pdfbox/pdmodel/PDPage;", + ); + + static final _getPage = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Int32)>>("PDDocument__getPage") - .asFunction, int)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public org.apache.pdfbox.pdmodel.PDPage getPage(int pageIndex) /// The returned object must be released after use, by calling the [release] method. @@ -1331,18 +1901,26 @@ class PDDocument extends jni.JObject { jni.JObject getPage( int pageIndex, ) { - return _getPage(reference.pointer, pageIndex) + return _getPage( + reference.pointer, _id_getPage as jni.JMethodIDPtr, pageIndex) .object(const jni.JObjectType()); } - static final _getPages = jniLookup< + static final _id_getPages = _class.instanceMethodId( + r"getPages", + r"()Lorg/apache/pdfbox/pdmodel/PDPageTree;", + ); + + static final _getPages = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getPages") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.PDPageTree getPages() @@ -1351,17 +1929,25 @@ class PDDocument extends jni.JObject { /// Returns the page tree. ///@return the page tree jni.JObject getPages() { - return _getPages(reference.pointer).object(const jni.JObjectType()); + return _getPages(reference.pointer, _id_getPages as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _getNumberOfPages = jniLookup< + static final _id_getNumberOfPages = _class.instanceMethodId( + r"getNumberOfPages", + r"()I", + ); + + static final _getNumberOfPages = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getNumberOfPages") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int getNumberOfPages() @@ -1369,17 +1955,26 @@ class PDDocument extends jni.JObject { /// This will return the total page count of the PDF document. ///@return The total number of pages in the PDF document. int getNumberOfPages() { - return _getNumberOfPages(reference.pointer).integer; + return _getNumberOfPages( + reference.pointer, _id_getNumberOfPages as jni.JMethodIDPtr) + .integer; } - static final _close = jniLookup< + static final _id_close = _class.instanceMethodId( + r"close", + r"()V", + ); + + static final _close = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDDocument__close") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public void close() @@ -1387,16 +1982,24 @@ class PDDocument extends jni.JObject { /// This will close the underlying COSDocument object. ///@throws IOException If there is an error releasing resources. void close() { - _close(reference.pointer).check(); + _close(reference.pointer, _id_close as jni.JMethodIDPtr).check(); } - static final _protect = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__protect") + static final _id_protect = _class.instanceMethodId( + r"protect", + r"(Lorg/apache/pdfbox/pdmodel/encryption/ProtectionPolicy;)V", + ); + + static final _protect = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void protect(org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy policy) /// @@ -1413,17 +2016,26 @@ class PDDocument extends jni.JObject { void protect( jni.JObject policy, ) { - _protect(reference.pointer, policy.reference.pointer).check(); + _protect(reference.pointer, _id_protect as jni.JMethodIDPtr, + policy.reference.pointer) + .check(); } - static final _getCurrentAccessPermission = jniLookup< + static final _id_getCurrentAccessPermission = _class.instanceMethodId( + r"getCurrentAccessPermission", + r"()Lorg/apache/pdfbox/pdmodel/encryption/AccessPermission;", + ); + + static final _getCurrentAccessPermission = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getCurrentAccessPermission") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.encryption.AccessPermission getCurrentAccessPermission() @@ -1435,18 +2047,26 @@ class PDDocument extends jni.JObject { /// to verify if the current user is allowed to proceed. ///@return the access permissions for the current user on the document. jni.JObject getCurrentAccessPermission() { - return _getCurrentAccessPermission(reference.pointer) + return _getCurrentAccessPermission(reference.pointer, + _id_getCurrentAccessPermission as jni.JMethodIDPtr) .object(const jni.JObjectType()); } - static final _isAllSecurityToBeRemoved = jniLookup< + static final _id_isAllSecurityToBeRemoved = _class.instanceMethodId( + r"isAllSecurityToBeRemoved", + r"()Z", + ); + + static final _isAllSecurityToBeRemoved = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__isAllSecurityToBeRemoved") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean isAllSecurityToBeRemoved() @@ -1454,14 +2074,25 @@ class PDDocument extends jni.JObject { /// Indicates if all security is removed or not when writing the pdf. ///@return returns true if all security shall be removed otherwise false bool isAllSecurityToBeRemoved() { - return _isAllSecurityToBeRemoved(reference.pointer).boolean; + return _isAllSecurityToBeRemoved( + reference.pointer, _id_isAllSecurityToBeRemoved as jni.JMethodIDPtr) + .boolean; } - static final _setAllSecurityToBeRemoved = jniLookup< + static final _id_setAllSecurityToBeRemoved = _class.instanceMethodId( + r"setAllSecurityToBeRemoved", + r"(Z)V", + ); + + static final _setAllSecurityToBeRemoved = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("PDDocument__setAllSecurityToBeRemoved") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setAllSecurityToBeRemoved(boolean removeAllSecurity) /// @@ -1470,18 +2101,28 @@ class PDDocument extends jni.JObject { void setAllSecurityToBeRemoved( bool removeAllSecurity, ) { - _setAllSecurityToBeRemoved(reference.pointer, removeAllSecurity ? 1 : 0) + _setAllSecurityToBeRemoved( + reference.pointer, + _id_setAllSecurityToBeRemoved as jni.JMethodIDPtr, + removeAllSecurity ? 1 : 0) .check(); } - static final _getDocumentId = jniLookup< + static final _id_getDocumentId = _class.instanceMethodId( + r"getDocumentId", + r"()Ljava/lang/Long;", + ); + + static final _getDocumentId = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getDocumentId") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.Long getDocumentId() @@ -1490,16 +2131,26 @@ class PDDocument extends jni.JObject { /// Provides the document ID. ///@return the document ID jni.JLong getDocumentId() { - return _getDocumentId(reference.pointer).object(const jni.JLongType()); + return _getDocumentId( + reference.pointer, _id_getDocumentId as jni.JMethodIDPtr) + .object(const jni.JLongType()); } - static final _setDocumentId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__setDocumentId") + static final _id_setDocumentId = _class.instanceMethodId( + r"setDocumentId", + r"(Ljava/lang/Long;)V", + ); + + static final _setDocumentId = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setDocumentId(java.lang.Long docId) /// @@ -1508,17 +2159,26 @@ class PDDocument extends jni.JObject { void setDocumentId( jni.JLong docId, ) { - _setDocumentId(reference.pointer, docId.reference.pointer).check(); + _setDocumentId(reference.pointer, _id_setDocumentId as jni.JMethodIDPtr, + docId.reference.pointer) + .check(); } - static final _getVersion = jniLookup< + static final _id_getVersion = _class.instanceMethodId( + r"getVersion", + r"()F", + ); + + static final _getVersion = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getVersion") + jni.JMethodIDPtr, + )>>("globalEnv_CallFloatMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public float getVersion() @@ -1526,14 +2186,24 @@ class PDDocument extends jni.JObject { /// Returns the PDF specification version this document conforms to. ///@return the PDF version (e.g. 1.4f) double getVersion() { - return _getVersion(reference.pointer).float; + return _getVersion(reference.pointer, _id_getVersion as jni.JMethodIDPtr) + .float; } - static final _setVersion = jniLookup< + static final _id_setVersion = _class.instanceMethodId( + r"setVersion", + r"(F)V", + ); + + static final _setVersion = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Float)>>("PDDocument__setVersion") - .asFunction, double)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Double,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, double)>(); /// from: public void setVersion(float newVersion) /// @@ -1542,17 +2212,26 @@ class PDDocument extends jni.JObject { void setVersion( double newVersion, ) { - _setVersion(reference.pointer, newVersion).check(); + _setVersion( + reference.pointer, _id_setVersion as jni.JMethodIDPtr, newVersion) + .check(); } - static final _getResourceCache = jniLookup< + static final _id_getResourceCache = _class.instanceMethodId( + r"getResourceCache", + r"()Lorg/apache/pdfbox/pdmodel/ResourceCache;", + ); + + static final _getResourceCache = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocument__getResourceCache") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.ResourceCache getResourceCache() @@ -1561,16 +2240,26 @@ class PDDocument extends jni.JObject { /// Returns the resource cache associated with this document, or null if there is none. ///@return the resource cache or null. jni.JObject getResourceCache() { - return _getResourceCache(reference.pointer).object(const jni.JObjectType()); + return _getResourceCache( + reference.pointer, _id_getResourceCache as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _setResourceCache = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocument__setResourceCache") + static final _id_setResourceCache = _class.instanceMethodId( + r"setResourceCache", + r"(Lorg/apache/pdfbox/pdmodel/ResourceCache;)V", + ); + + static final _setResourceCache = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setResourceCache(org.apache.pdfbox.pdmodel.ResourceCache resourceCache) /// @@ -1579,7 +2268,10 @@ class PDDocument extends jni.JObject { void setResourceCache( jni.JObject resourceCache, ) { - _setResourceCache(reference.pointer, resourceCache.reference.pointer) + _setResourceCache( + reference.pointer, + _id_setResourceCache as jni.JMethodIDPtr, + resourceCache.reference.pointer) .check(); } } 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 37a3a4812..c20f7b183 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 @@ -41,8 +41,6 @@ import "dart:ffi" as ffi; import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; -import "../../../../_init.dart"; - /// from: org.apache.pdfbox.pdmodel.PDDocumentInformation /// /// This is the document metadata. Each getXXX method will return the entry if @@ -58,25 +56,51 @@ class PDDocumentInformation extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"org/apache/pdfbox/pdmodel/PDDocumentInformation"); + /// The type which includes information such as the signature of this class. static const type = $PDDocumentInformationType(); - static final _new0 = jniLookup>( - "PDDocumentInformation__new0") - .asFunction(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. /// /// Default Constructor. factory PDDocumentInformation() { - return PDDocumentInformation.fromReference(_new0().reference); + return PDDocumentInformation.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _new1 = jniLookup< - ffi - .NativeFunction)>>( - "PDDocumentInformation__new1") - .asFunction)>(); + static final _id_new1 = _class.constructorId( + r"(Lorg/apache/pdfbox/cos/COSDictionary;)V", + ); + + static final _new1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void (org.apache.pdfbox.cos.COSDictionary dic) /// The returned object must be released after use, by calling the [release] method. @@ -86,18 +110,26 @@ class PDDocumentInformation extends jni.JObject { factory PDDocumentInformation.new1( jni.JObject dic, ) { - return PDDocumentInformation.fromReference( - _new1(dic.reference.pointer).reference); + return PDDocumentInformation.fromReference(_new1(_class.reference.pointer, + _id_new1 as jni.JMethodIDPtr, dic.reference.pointer) + .reference); } - static final _getCOSObject = jniLookup< + static final _id_getCOSObject = _class.instanceMethodId( + r"getCOSObject", + r"()Lorg/apache/pdfbox/cos/COSDictionary;", + ); + + static final _getCOSObject = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getCOSObject") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.cos.COSDictionary getCOSObject() @@ -106,17 +138,26 @@ class PDDocumentInformation extends jni.JObject { /// This will get the underlying dictionary that this object wraps. ///@return The underlying info dictionary. jni.JObject getCOSObject() { - return _getCOSObject(reference.pointer).object(const jni.JObjectType()); + return _getCOSObject( + reference.pointer, _id_getCOSObject as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _getPropertyStringValue = jniLookup< + static final _id_getPropertyStringValue = _class.instanceMethodId( + r"getPropertyStringValue", + r"(Ljava/lang/String;)Ljava/lang/Object;", + ); + + static final _getPropertyStringValue = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocumentInformation__getPropertyStringValue") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public java.lang.Object getPropertyStringValue(java.lang.String propertyKey) /// The returned object must be released after use, by calling the [release] method. @@ -133,18 +174,27 @@ class PDDocumentInformation extends jni.JObject { jni.JString propertyKey, ) { return _getPropertyStringValue( - reference.pointer, propertyKey.reference.pointer) + reference.pointer, + _id_getPropertyStringValue as jni.JMethodIDPtr, + propertyKey.reference.pointer) .object(const jni.JObjectType()); } - static final _getTitle = jniLookup< + static final _id_getTitle = _class.instanceMethodId( + r"getTitle", + r"()Ljava/lang/String;", + ); + + static final _getTitle = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getTitle") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getTitle() @@ -153,16 +203,25 @@ class PDDocumentInformation extends jni.JObject { /// This will get the title of the document. This will return null if no title exists. ///@return The title of the document. jni.JString getTitle() { - return _getTitle(reference.pointer).object(const jni.JStringType()); + return _getTitle(reference.pointer, _id_getTitle as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setTitle = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setTitle") + static final _id_setTitle = _class.instanceMethodId( + r"setTitle", + r"(Ljava/lang/String;)V", + ); + + static final _setTitle = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setTitle(java.lang.String title) /// @@ -171,17 +230,26 @@ class PDDocumentInformation extends jni.JObject { void setTitle( jni.JString title, ) { - _setTitle(reference.pointer, title.reference.pointer).check(); + _setTitle(reference.pointer, _id_setTitle as jni.JMethodIDPtr, + title.reference.pointer) + .check(); } - static final _getAuthor = jniLookup< + static final _id_getAuthor = _class.instanceMethodId( + r"getAuthor", + r"()Ljava/lang/String;", + ); + + static final _getAuthor = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getAuthor") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getAuthor() @@ -190,16 +258,25 @@ class PDDocumentInformation extends jni.JObject { /// This will get the author of the document. This will return null if no author exists. ///@return The author of the document. jni.JString getAuthor() { - return _getAuthor(reference.pointer).object(const jni.JStringType()); + return _getAuthor(reference.pointer, _id_getAuthor as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setAuthor = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setAuthor") + static final _id_setAuthor = _class.instanceMethodId( + r"setAuthor", + r"(Ljava/lang/String;)V", + ); + + static final _setAuthor = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setAuthor(java.lang.String author) /// @@ -208,17 +285,26 @@ class PDDocumentInformation extends jni.JObject { void setAuthor( jni.JString author, ) { - _setAuthor(reference.pointer, author.reference.pointer).check(); + _setAuthor(reference.pointer, _id_setAuthor as jni.JMethodIDPtr, + author.reference.pointer) + .check(); } - static final _getSubject = jniLookup< + static final _id_getSubject = _class.instanceMethodId( + r"getSubject", + r"()Ljava/lang/String;", + ); + + static final _getSubject = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getSubject") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getSubject() @@ -227,16 +313,25 @@ class PDDocumentInformation extends jni.JObject { /// This will get the subject of the document. This will return null if no subject exists. ///@return The subject of the document. jni.JString getSubject() { - return _getSubject(reference.pointer).object(const jni.JStringType()); + return _getSubject(reference.pointer, _id_getSubject as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setSubject = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setSubject") + static final _id_setSubject = _class.instanceMethodId( + r"setSubject", + r"(Ljava/lang/String;)V", + ); + + static final _setSubject = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setSubject(java.lang.String subject) /// @@ -245,17 +340,26 @@ class PDDocumentInformation extends jni.JObject { void setSubject( jni.JString subject, ) { - _setSubject(reference.pointer, subject.reference.pointer).check(); + _setSubject(reference.pointer, _id_setSubject as jni.JMethodIDPtr, + subject.reference.pointer) + .check(); } - static final _getKeywords = jniLookup< + static final _id_getKeywords = _class.instanceMethodId( + r"getKeywords", + r"()Ljava/lang/String;", + ); + + static final _getKeywords = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getKeywords") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getKeywords() @@ -264,16 +368,25 @@ class PDDocumentInformation extends jni.JObject { /// This will get the keywords of the document. This will return null if no keywords exists. ///@return The keywords of the document. jni.JString getKeywords() { - return _getKeywords(reference.pointer).object(const jni.JStringType()); + return _getKeywords(reference.pointer, _id_getKeywords as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setKeywords = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setKeywords") + static final _id_setKeywords = _class.instanceMethodId( + r"setKeywords", + r"(Ljava/lang/String;)V", + ); + + static final _setKeywords = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setKeywords(java.lang.String keywords) /// @@ -282,17 +395,26 @@ class PDDocumentInformation extends jni.JObject { void setKeywords( jni.JString keywords, ) { - _setKeywords(reference.pointer, keywords.reference.pointer).check(); + _setKeywords(reference.pointer, _id_setKeywords as jni.JMethodIDPtr, + keywords.reference.pointer) + .check(); } - static final _getCreator = jniLookup< + static final _id_getCreator = _class.instanceMethodId( + r"getCreator", + r"()Ljava/lang/String;", + ); + + static final _getCreator = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getCreator") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getCreator() @@ -301,16 +423,25 @@ class PDDocumentInformation extends jni.JObject { /// This will get the creator of the document. This will return null if no creator exists. ///@return The creator of the document. jni.JString getCreator() { - return _getCreator(reference.pointer).object(const jni.JStringType()); + return _getCreator(reference.pointer, _id_getCreator as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setCreator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setCreator") + static final _id_setCreator = _class.instanceMethodId( + r"setCreator", + r"(Ljava/lang/String;)V", + ); + + static final _setCreator = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setCreator(java.lang.String creator) /// @@ -319,17 +450,26 @@ class PDDocumentInformation extends jni.JObject { void setCreator( jni.JString creator, ) { - _setCreator(reference.pointer, creator.reference.pointer).check(); + _setCreator(reference.pointer, _id_setCreator as jni.JMethodIDPtr, + creator.reference.pointer) + .check(); } - static final _getProducer = jniLookup< + static final _id_getProducer = _class.instanceMethodId( + r"getProducer", + r"()Ljava/lang/String;", + ); + + static final _getProducer = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getProducer") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getProducer() @@ -338,16 +478,25 @@ class PDDocumentInformation extends jni.JObject { /// This will get the producer of the document. This will return null if no producer exists. ///@return The producer of the document. jni.JString getProducer() { - return _getProducer(reference.pointer).object(const jni.JStringType()); + return _getProducer(reference.pointer, _id_getProducer as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setProducer = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setProducer") + static final _id_setProducer = _class.instanceMethodId( + r"setProducer", + r"(Ljava/lang/String;)V", + ); + + static final _setProducer = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setProducer(java.lang.String producer) /// @@ -356,17 +505,26 @@ class PDDocumentInformation extends jni.JObject { void setProducer( jni.JString producer, ) { - _setProducer(reference.pointer, producer.reference.pointer).check(); + _setProducer(reference.pointer, _id_setProducer as jni.JMethodIDPtr, + producer.reference.pointer) + .check(); } - static final _getCreationDate = jniLookup< + static final _id_getCreationDate = _class.instanceMethodId( + r"getCreationDate", + r"()Ljava/util/Calendar;", + ); + + static final _getCreationDate = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getCreationDate") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.Calendar getCreationDate() @@ -375,17 +533,26 @@ class PDDocumentInformation extends jni.JObject { /// 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.JObject getCreationDate() { - return _getCreationDate(reference.pointer).object(const jni.JObjectType()); + return _getCreationDate( + reference.pointer, _id_getCreationDate as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _setCreationDate = jniLookup< + static final _id_setCreationDate = _class.instanceMethodId( + r"setCreationDate", + r"(Ljava/util/Calendar;)V", + ); + + static final _setCreationDate = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocumentInformation__setCreationDate") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setCreationDate(java.util.Calendar date) /// @@ -394,17 +561,26 @@ class PDDocumentInformation extends jni.JObject { void setCreationDate( jni.JObject date, ) { - _setCreationDate(reference.pointer, date.reference.pointer).check(); + _setCreationDate(reference.pointer, _id_setCreationDate as jni.JMethodIDPtr, + date.reference.pointer) + .check(); } - static final _getModificationDate = jniLookup< + static final _id_getModificationDate = _class.instanceMethodId( + r"getModificationDate", + r"()Ljava/util/Calendar;", + ); + + static final _getModificationDate = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getModificationDate") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.Calendar getModificationDate() @@ -413,18 +589,26 @@ class PDDocumentInformation extends jni.JObject { /// 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.JObject getModificationDate() { - return _getModificationDate(reference.pointer) + return _getModificationDate( + reference.pointer, _id_getModificationDate as jni.JMethodIDPtr) .object(const jni.JObjectType()); } - static final _setModificationDate = jniLookup< + static final _id_setModificationDate = _class.instanceMethodId( + r"setModificationDate", + r"(Ljava/util/Calendar;)V", + ); + + static final _setModificationDate = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocumentInformation__setModificationDate") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setModificationDate(java.util.Calendar date) /// @@ -433,17 +617,26 @@ class PDDocumentInformation extends jni.JObject { void setModificationDate( jni.JObject date, ) { - _setModificationDate(reference.pointer, date.reference.pointer).check(); + _setModificationDate(reference.pointer, + _id_setModificationDate as jni.JMethodIDPtr, date.reference.pointer) + .check(); } - static final _getTrapped = jniLookup< + static final _id_getTrapped = _class.instanceMethodId( + r"getTrapped", + r"()Ljava/lang/String;", + ); + + static final _getTrapped = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getTrapped") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getTrapped() @@ -453,17 +646,25 @@ class PDDocumentInformation extends jni.JObject { /// This will return null if one is not found. ///@return The trapped value for the document. jni.JString getTrapped() { - return _getTrapped(reference.pointer).object(const jni.JStringType()); + return _getTrapped(reference.pointer, _id_getTrapped as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _getMetadataKeys = jniLookup< + static final _id_getMetadataKeys = _class.instanceMethodId( + r"getMetadataKeys", + r"()Ljava/util/Set;", + ); + + static final _getMetadataKeys = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDDocumentInformation__getMetadataKeys") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.util.Set getMetadataKeys() @@ -473,18 +674,26 @@ class PDDocumentInformation extends jni.JObject { ///@return all metadata key strings. ///@since Apache PDFBox 1.3.0 jni.JSet getMetadataKeys() { - return _getMetadataKeys(reference.pointer) + return _getMetadataKeys( + reference.pointer, _id_getMetadataKeys as jni.JMethodIDPtr) .object(const jni.JSetType(jni.JStringType())); } - static final _getCustomMetadataValue = jniLookup< + static final _id_getCustomMetadataValue = _class.instanceMethodId( + r"getCustomMetadataValue", + r"(Ljava/lang/String;)Ljava/lang/String;", + ); + + static final _getCustomMetadataValue = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDDocumentInformation__getCustomMetadataValue") + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public java.lang.String getCustomMetadataValue(java.lang.String fieldName) /// The returned object must be released after use, by calling the [release] method. @@ -497,18 +706,30 @@ class PDDocumentInformation extends jni.JObject { jni.JString fieldName, ) { return _getCustomMetadataValue( - reference.pointer, fieldName.reference.pointer) + reference.pointer, + _id_getCustomMetadataValue as jni.JMethodIDPtr, + fieldName.reference.pointer) .object(const jni.JStringType()); } - static final _setCustomMetadataValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>( - "PDDocumentInformation__setCustomMetadataValue") + static final _id_setCustomMetadataValue = _class.instanceMethodId( + r"setCustomMetadataValue", + r"(Ljava/lang/String;Ljava/lang/String;)V", + ); + + static final _setCustomMetadataValue = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public void setCustomMetadataValue(java.lang.String fieldName, java.lang.String fieldValue) /// @@ -519,18 +740,29 @@ class PDDocumentInformation extends jni.JObject { jni.JString fieldName, jni.JString fieldValue, ) { - _setCustomMetadataValue(reference.pointer, fieldName.reference.pointer, + _setCustomMetadataValue( + reference.pointer, + _id_setCustomMetadataValue as jni.JMethodIDPtr, + fieldName.reference.pointer, fieldValue.reference.pointer) .check(); } - static final _setTrapped = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDDocumentInformation__setTrapped") + static final _id_setTrapped = _class.instanceMethodId( + r"setTrapped", + r"(Ljava/lang/String;)V", + ); + + static final _setTrapped = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setTrapped(java.lang.String value) /// @@ -541,7 +773,9 @@ class PDDocumentInformation extends jni.JObject { void setTrapped( jni.JString value, ) { - _setTrapped(reference.pointer, value.reference.pointer).check(); + _setTrapped(reference.pointer, _id_setTrapped as jni.JMethodIDPtr, + value.reference.pointer) + .check(); } } 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 a412b0685..82e25c582 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 @@ -42,7 +42,6 @@ import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; import "../pdmodel/PDDocument.dart" as pddocument_; -import "../../../../_init.dart"; /// from: org.apache.pdfbox.text.PDFTextStripper /// @@ -61,42 +60,27 @@ class PDFTextStripper extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); + static final _class = + jni.JClass.forName(r"org/apache/pdfbox/text/PDFTextStripper"); + /// The type which includes information such as the signature of this class. static const type = $PDFTextStripperType(); - static final _get_LINE_SEPARATOR = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_PDFTextStripper__LINE_SEPARATOR") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); + static final _id_LINE_SEPARATOR = _class.instanceFieldId( + r"LINE_SEPARATOR", + r"Ljava/lang/String;", + ); /// from: protected final java.lang.String LINE_SEPARATOR /// The returned object must be released after use, by calling the [release] method. /// /// The platform's line separator. jni.JString get LINE_SEPARATOR => - _get_LINE_SEPARATOR(reference.pointer).object(const jni.JStringType()); - - static final _get_charactersByArticle = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_PDFTextStripper__charactersByArticle") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); + _id_LINE_SEPARATOR.get(this, const jni.JStringType()); - static final _set_charactersByArticle = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_PDFTextStripper__charactersByArticle") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); + static final _id_charactersByArticle = _class.instanceFieldId( + r"charactersByArticle", + r"Ljava/util/ArrayList;", + ); /// from: protected java.util.ArrayList> charactersByArticle /// The returned object must be released after use, by calling the [release] method. @@ -114,8 +98,7 @@ class PDFTextStripper extends jni.JObject { /// /// Most PDFs won't have any beads, so charactersByArticle will contain a single entry. jni.JObject get charactersByArticle => - _get_charactersByArticle(reference.pointer) - .object(const jni.JObjectType()); + _id_charactersByArticle.get(this, const jni.JObjectType()); /// from: protected java.util.ArrayList> charactersByArticle /// The returned object must be released after use, by calling the [release] method. @@ -133,66 +116,52 @@ class PDFTextStripper extends jni.JObject { /// /// Most PDFs won't have any beads, so charactersByArticle will contain a single entry. set charactersByArticle(jni.JObject value) => - _set_charactersByArticle(reference.pointer, value.reference.pointer) - .check(); - - static final _get_document = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_PDFTextStripper__document") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); + _id_charactersByArticle.set(this, const jni.JObjectType(), value); - static final _set_document = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_PDFTextStripper__document") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); + static final _id_document = _class.instanceFieldId( + r"document", + r"Lorg/apache/pdfbox/pdmodel/PDDocument;", + ); /// from: protected org.apache.pdfbox.pdmodel.PDDocument document /// The returned object must be released after use, by calling the [release] method. - pddocument_.PDDocument get document => _get_document(reference.pointer) - .object(const pddocument_.$PDDocumentType()); + pddocument_.PDDocument get document => + _id_document.get(this, const pddocument_.$PDDocumentType()); /// from: protected org.apache.pdfbox.pdmodel.PDDocument document /// The returned object must be released after use, by calling the [release] method. set document(pddocument_.PDDocument value) => - _set_document(reference.pointer, value.reference.pointer).check(); - - static final _get_output = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_PDFTextStripper__output") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); + _id_document.set(this, const pddocument_.$PDDocumentType(), value); - static final _set_output = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_PDFTextStripper__output") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); + static final _id_output = _class.instanceFieldId( + r"output", + r"Ljava/io/Writer;", + ); /// from: protected java.io.Writer output /// The returned object must be released after use, by calling the [release] method. - jni.JObject get output => - _get_output(reference.pointer).object(const jni.JObjectType()); + jni.JObject get output => _id_output.get(this, const jni.JObjectType()); /// from: protected java.io.Writer output /// The returned object must be released after use, by calling the [release] method. set output(jni.JObject value) => - _set_output(reference.pointer, value.reference.pointer).check(); + _id_output.set(this, const jni.JObjectType(), value); + + static final _id_new0 = _class.constructorId( + r"()V", + ); - static final _new0 = jniLookup>( - "PDFTextStripper__new0") - .asFunction(); + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. @@ -200,16 +169,26 @@ class PDFTextStripper extends jni.JObject { /// Instantiate a new PDFTextStripper object. ///@throws IOException If there is an error loading the properties. factory PDFTextStripper() { - return PDFTextStripper.fromReference(_new0().reference); + return PDFTextStripper.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); } - static final _getText = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__getText") + static final _id_getText = _class.instanceMethodId( + r"getText", + r"(Lorg/apache/pdfbox/pdmodel/PDDocument;)Ljava/lang/String;", + ); + + static final _getText = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public java.lang.String getText(org.apache.pdfbox.pdmodel.PDDocument doc) /// The returned object must be released after use, by calling the [release] method. @@ -227,19 +206,29 @@ class PDFTextStripper extends jni.JObject { jni.JString getText( pddocument_.PDDocument doc, ) { - return _getText(reference.pointer, doc.reference.pointer) + return _getText(reference.pointer, _id_getText as jni.JMethodIDPtr, + doc.reference.pointer) .object(const jni.JStringType()); } - static final _writeText = jniLookup< + static final _id_writeText = _class.instanceMethodId( + r"writeText", + r"(Lorg/apache/pdfbox/pdmodel/PDDocument;Ljava/io/Writer;)V", + ); + + static final _writeText = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__writeText") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: public void writeText(org.apache.pdfbox.pdmodel.PDDocument doc, java.io.Writer outputStream) /// @@ -251,18 +240,26 @@ class PDFTextStripper extends jni.JObject { pddocument_.PDDocument doc, jni.JObject outputStream, ) { - _writeText(reference.pointer, doc.reference.pointer, - outputStream.reference.pointer) + _writeText(reference.pointer, _id_writeText as jni.JMethodIDPtr, + doc.reference.pointer, outputStream.reference.pointer) .check(); } - static final _processPages = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__processPages") + static final _id_processPages = _class.instanceMethodId( + r"processPages", + r"(Lorg/apache/pdfbox/pdmodel/PDPageTree;)V", + ); + + static final _processPages = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void processPages(org.apache.pdfbox.pdmodel.PDPageTree pages) /// @@ -272,16 +269,26 @@ class PDFTextStripper extends jni.JObject { void processPages( jni.JObject pages, ) { - _processPages(reference.pointer, pages.reference.pointer).check(); + _processPages(reference.pointer, _id_processPages as jni.JMethodIDPtr, + pages.reference.pointer) + .check(); } - static final _startDocument = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__startDocument") + static final _id_startDocument = _class.instanceMethodId( + r"startDocument", + r"(Lorg/apache/pdfbox/pdmodel/PDDocument;)V", + ); + + static final _startDocument = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void startDocument(org.apache.pdfbox.pdmodel.PDDocument document) /// @@ -291,16 +298,26 @@ class PDFTextStripper extends jni.JObject { void startDocument( pddocument_.PDDocument document, ) { - _startDocument(reference.pointer, document.reference.pointer).check(); + _startDocument(reference.pointer, _id_startDocument as jni.JMethodIDPtr, + document.reference.pointer) + .check(); } - static final _endDocument = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__endDocument") + static final _id_endDocument = _class.instanceMethodId( + r"endDocument", + r"(Lorg/apache/pdfbox/pdmodel/PDDocument;)V", + ); + + static final _endDocument = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void endDocument(org.apache.pdfbox.pdmodel.PDDocument document) /// @@ -311,16 +328,26 @@ class PDFTextStripper extends jni.JObject { void endDocument( pddocument_.PDDocument document, ) { - _endDocument(reference.pointer, document.reference.pointer).check(); + _endDocument(reference.pointer, _id_endDocument as jni.JMethodIDPtr, + document.reference.pointer) + .check(); } - static final _processPage = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__processPage") + static final _id_processPage = _class.instanceMethodId( + r"processPage", + r"(Lorg/apache/pdfbox/pdmodel/PDPage;)V", + ); + + static final _processPage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void processPage(org.apache.pdfbox.pdmodel.PDPage page) /// @@ -330,17 +357,26 @@ class PDFTextStripper extends jni.JObject { void processPage( jni.JObject page, ) { - _processPage(reference.pointer, page.reference.pointer).check(); + _processPage(reference.pointer, _id_processPage as jni.JMethodIDPtr, + page.reference.pointer) + .check(); } - static final _startArticle = jniLookup< + static final _id_startArticle = _class.instanceMethodId( + r"startArticle", + r"()V", + ); + + static final _startArticle = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__startArticle") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void startArticle() @@ -350,14 +386,24 @@ class PDFTextStripper extends jni.JObject { /// may provide additional information. ///@throws IOException If there is any error writing to the stream. void startArticle() { - _startArticle(reference.pointer).check(); + _startArticle(reference.pointer, _id_startArticle as jni.JMethodIDPtr) + .check(); } - static final _startArticle1 = jniLookup< + static final _id_startArticle1 = _class.instanceMethodId( + r"startArticle", + r"(Z)V", + ); + + static final _startArticle1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("PDFTextStripper__startArticle1") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: protected void startArticle(boolean isLTR) /// @@ -368,17 +414,26 @@ class PDFTextStripper extends jni.JObject { void startArticle1( bool isLTR, ) { - _startArticle1(reference.pointer, isLTR ? 1 : 0).check(); + _startArticle1(reference.pointer, _id_startArticle1 as jni.JMethodIDPtr, + isLTR ? 1 : 0) + .check(); } - static final _endArticle = jniLookup< + static final _id_endArticle = _class.instanceMethodId( + r"endArticle", + r"()V", + ); + + static final _endArticle = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__endArticle") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void endArticle() @@ -386,16 +441,24 @@ class PDFTextStripper extends jni.JObject { /// End an article. Default implementation is to do nothing. Subclasses may provide additional information. ///@throws IOException If there is any error writing to the stream. void endArticle() { - _endArticle(reference.pointer).check(); + _endArticle(reference.pointer, _id_endArticle as jni.JMethodIDPtr).check(); } - static final _startPage = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__startPage") + static final _id_startPage = _class.instanceMethodId( + r"startPage", + r"(Lorg/apache/pdfbox/pdmodel/PDPage;)V", + ); + + static final _startPage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void startPage(org.apache.pdfbox.pdmodel.PDPage page) /// @@ -405,16 +468,26 @@ class PDFTextStripper extends jni.JObject { void startPage( jni.JObject page, ) { - _startPage(reference.pointer, page.reference.pointer).check(); + _startPage(reference.pointer, _id_startPage as jni.JMethodIDPtr, + page.reference.pointer) + .check(); } - static final _endPage = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__endPage") + static final _id_endPage = _class.instanceMethodId( + r"endPage", + r"(Lorg/apache/pdfbox/pdmodel/PDPage;)V", + ); + + static final _endPage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void endPage(org.apache.pdfbox.pdmodel.PDPage page) /// @@ -424,17 +497,26 @@ class PDFTextStripper extends jni.JObject { void endPage( jni.JObject page, ) { - _endPage(reference.pointer, page.reference.pointer).check(); + _endPage(reference.pointer, _id_endPage as jni.JMethodIDPtr, + page.reference.pointer) + .check(); } - static final _writePage = jniLookup< + static final _id_writePage = _class.instanceMethodId( + r"writePage", + r"()V", + ); + + static final _writePage = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writePage") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writePage() @@ -444,17 +526,24 @@ class PDFTextStripper extends jni.JObject { /// enabled. ///@throws IOException If there is an error writing the text. void writePage() { - _writePage(reference.pointer).check(); + _writePage(reference.pointer, _id_writePage as jni.JMethodIDPtr).check(); } - static final _writeLineSeparator = jniLookup< + static final _id_writeLineSeparator = _class.instanceMethodId( + r"writeLineSeparator", + r"()V", + ); + + static final _writeLineSeparator = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writeLineSeparator") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writeLineSeparator() @@ -462,17 +551,26 @@ class PDFTextStripper extends jni.JObject { /// Write the line separator value to the output stream. ///@throws IOException If there is a problem writing out the line separator to the document. void writeLineSeparator() { - _writeLineSeparator(reference.pointer).check(); + _writeLineSeparator( + reference.pointer, _id_writeLineSeparator as jni.JMethodIDPtr) + .check(); } - static final _writeWordSeparator = jniLookup< + static final _id_writeWordSeparator = _class.instanceMethodId( + r"writeWordSeparator", + r"()V", + ); + + static final _writeWordSeparator = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writeWordSeparator") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writeWordSeparator() @@ -480,16 +578,26 @@ class PDFTextStripper extends jni.JObject { /// Write the word separator value to the output stream. ///@throws IOException If there is a problem writing out the word separator to the document. void writeWordSeparator() { - _writeWordSeparator(reference.pointer).check(); + _writeWordSeparator( + reference.pointer, _id_writeWordSeparator as jni.JMethodIDPtr) + .check(); } - static final _writeCharacters = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__writeCharacters") + static final _id_writeCharacters = _class.instanceMethodId( + r"writeCharacters", + r"(Lorg/apache/pdfbox/text/TextPosition;)V", + ); + + static final _writeCharacters = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void writeCharacters(org.apache.pdfbox.text.TextPosition text) /// @@ -499,18 +607,29 @@ class PDFTextStripper extends jni.JObject { void writeCharacters( jni.JObject text, ) { - _writeCharacters(reference.pointer, text.reference.pointer).check(); + _writeCharacters(reference.pointer, _id_writeCharacters as jni.JMethodIDPtr, + text.reference.pointer) + .check(); } - static final _writeString = jniLookup< + static final _id_writeString = _class.instanceMethodId( + r"writeString", + r"(Ljava/lang/String;Ljava/util/List;)V", + ); + + static final _writeString = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, + jni.JThrowablePtr Function( ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__writeString") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); /// from: protected void writeString(java.lang.String text, java.util.List textPositions) /// @@ -523,18 +642,26 @@ class PDFTextStripper extends jni.JObject { jni.JString text, jni.JList textPositions, ) { - _writeString(reference.pointer, text.reference.pointer, - textPositions.reference.pointer) + _writeString(reference.pointer, _id_writeString as jni.JMethodIDPtr, + text.reference.pointer, textPositions.reference.pointer) .check(); } - static final _writeString1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__writeString1") + static final _id_writeString1 = _class.instanceMethodId( + r"writeString", + r"(Ljava/lang/String;)V", + ); + + static final _writeString1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void writeString(java.lang.String text) /// @@ -544,17 +671,26 @@ class PDFTextStripper extends jni.JObject { void writeString1( jni.JString text, ) { - _writeString1(reference.pointer, text.reference.pointer).check(); + _writeString1(reference.pointer, _id_writeString1 as jni.JMethodIDPtr, + text.reference.pointer) + .check(); } - static final _processTextPosition = jniLookup< + static final _id_processTextPosition = _class.instanceMethodId( + r"processTextPosition", + r"(Lorg/apache/pdfbox/text/TextPosition;)V", + ); + + static final _processTextPosition = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDFTextStripper__processTextPosition") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void processTextPosition(org.apache.pdfbox.text.TextPosition text) /// @@ -564,17 +700,26 @@ class PDFTextStripper extends jni.JObject { void processTextPosition( jni.JObject text, ) { - _processTextPosition(reference.pointer, text.reference.pointer).check(); + _processTextPosition(reference.pointer, + _id_processTextPosition as jni.JMethodIDPtr, text.reference.pointer) + .check(); } - static final _getStartPage = jniLookup< + static final _id_getStartPage = _class.instanceMethodId( + r"getStartPage", + r"()I", + ); + + static final _getStartPage = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getStartPage") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int getStartPage() @@ -584,14 +729,25 @@ class PDFTextStripper extends jni.JObject { /// be extracted. The default value is 1. ///@return Value of property startPage. int getStartPage() { - return _getStartPage(reference.pointer).integer; + return _getStartPage( + reference.pointer, _id_getStartPage as jni.JMethodIDPtr) + .integer; } - static final _setStartPage = jniLookup< + static final _id_setStartPage = _class.instanceMethodId( + r"setStartPage", + r"(I)V", + ); + + static final _setStartPage = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("PDFTextStripper__setStartPage") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setStartPage(int startPageValue) /// @@ -600,17 +756,26 @@ class PDFTextStripper extends jni.JObject { void setStartPage( int startPageValue, ) { - _setStartPage(reference.pointer, startPageValue).check(); + _setStartPage(reference.pointer, _id_setStartPage as jni.JMethodIDPtr, + startPageValue) + .check(); } - static final _getEndPage = jniLookup< + static final _id_getEndPage = _class.instanceMethodId( + r"getEndPage", + r"()I", + ); + + static final _getEndPage = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getEndPage") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public int getEndPage() @@ -620,14 +785,24 @@ class PDFTextStripper extends jni.JObject { /// Integer.MAX_VALUE such that all pages of the pdf will be extracted. ///@return Value of property endPage. int getEndPage() { - return _getEndPage(reference.pointer).integer; + return _getEndPage(reference.pointer, _id_getEndPage as jni.JMethodIDPtr) + .integer; } - static final _setEndPage = jniLookup< + static final _id_setEndPage = _class.instanceMethodId( + r"setEndPage", + r"(I)V", + ); + + static final _setEndPage = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("PDFTextStripper__setEndPage") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setEndPage(int endPageValue) /// @@ -636,16 +811,26 @@ class PDFTextStripper extends jni.JObject { void setEndPage( int endPageValue, ) { - _setEndPage(reference.pointer, endPageValue).check(); + _setEndPage( + reference.pointer, _id_setEndPage as jni.JMethodIDPtr, endPageValue) + .check(); } - static final _setLineSeparator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setLineSeparator") + static final _id_setLineSeparator = _class.instanceMethodId( + r"setLineSeparator", + r"(Ljava/lang/String;)V", + ); + + static final _setLineSeparator = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setLineSeparator(java.lang.String separator) /// @@ -655,17 +840,28 @@ class PDFTextStripper extends jni.JObject { void setLineSeparator( jni.JString separator, ) { - _setLineSeparator(reference.pointer, separator.reference.pointer).check(); + _setLineSeparator( + reference.pointer, + _id_setLineSeparator as jni.JMethodIDPtr, + separator.reference.pointer) + .check(); } - static final _getLineSeparator = jniLookup< + static final _id_getLineSeparator = _class.instanceMethodId( + r"getLineSeparator", + r"()Ljava/lang/String;", + ); + + static final _getLineSeparator = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getLineSeparator") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getLineSeparator() @@ -674,17 +870,26 @@ class PDFTextStripper extends jni.JObject { /// This will get the line separator. ///@return The desired line separator string. jni.JString getLineSeparator() { - return _getLineSeparator(reference.pointer).object(const jni.JStringType()); + return _getLineSeparator( + reference.pointer, _id_getLineSeparator as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _getWordSeparator = jniLookup< + static final _id_getWordSeparator = _class.instanceMethodId( + r"getWordSeparator", + r"()Ljava/lang/String;", + ); + + static final _getWordSeparator = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getWordSeparator") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getWordSeparator() @@ -693,16 +898,26 @@ class PDFTextStripper extends jni.JObject { /// This will get the word separator. ///@return The desired word separator string. jni.JString getWordSeparator() { - return _getWordSeparator(reference.pointer).object(const jni.JStringType()); + return _getWordSeparator( + reference.pointer, _id_getWordSeparator as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setWordSeparator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setWordSeparator") + static final _id_setWordSeparator = _class.instanceMethodId( + r"setWordSeparator", + r"(Ljava/lang/String;)V", + ); + + static final _setWordSeparator = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setWordSeparator(java.lang.String separator) /// @@ -714,34 +929,56 @@ class PDFTextStripper extends jni.JObject { void setWordSeparator( jni.JString separator, ) { - _setWordSeparator(reference.pointer, separator.reference.pointer).check(); + _setWordSeparator( + reference.pointer, + _id_setWordSeparator as jni.JMethodIDPtr, + separator.reference.pointer) + .check(); } - static final _getSuppressDuplicateOverlappingText = jniLookup< - ffi.NativeFunction< + static final _id_getSuppressDuplicateOverlappingText = + _class.instanceMethodId( + r"getSuppressDuplicateOverlappingText", + r"()Z", + ); + + static final _getSuppressDuplicateOverlappingText = + ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") + .asFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getSuppressDuplicateOverlappingText") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); + jni.JMethodIDPtr, + )>(); /// from: public boolean getSuppressDuplicateOverlappingText() /// /// @return Returns the suppressDuplicateOverlappingText. bool getSuppressDuplicateOverlappingText() { - return _getSuppressDuplicateOverlappingText(reference.pointer).boolean; + return _getSuppressDuplicateOverlappingText(reference.pointer, + _id_getSuppressDuplicateOverlappingText as jni.JMethodIDPtr) + .boolean; } - static final _getCurrentPageNo = jniLookup< + static final _id_getCurrentPageNo = _class.instanceMethodId( + r"getCurrentPageNo", + r"()I", + ); + + static final _getCurrentPageNo = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getCurrentPageNo") + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected int getCurrentPageNo() @@ -749,17 +986,26 @@ class PDFTextStripper extends jni.JObject { /// Get the current page number that is being processed. ///@return A 1 based number representing the current page. int getCurrentPageNo() { - return _getCurrentPageNo(reference.pointer).integer; + return _getCurrentPageNo( + reference.pointer, _id_getCurrentPageNo as jni.JMethodIDPtr) + .integer; } - static final _getOutput = jniLookup< + static final _id_getOutput = _class.instanceMethodId( + r"getOutput", + r"()Ljava/io/Writer;", + ); + + static final _getOutput = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getOutput") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected java.io.Writer getOutput() @@ -768,17 +1014,25 @@ class PDFTextStripper extends jni.JObject { /// The output stream that is being written to. ///@return The stream that output is being written to. jni.JObject getOutput() { - return _getOutput(reference.pointer).object(const jni.JObjectType()); + return _getOutput(reference.pointer, _id_getOutput as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _getCharactersByArticle = jniLookup< + static final _id_getCharactersByArticle = _class.instanceMethodId( + r"getCharactersByArticle", + r"()Ljava/util/List;", + ); + + static final _getCharactersByArticle = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getCharactersByArticle") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected java.util.List> getCharactersByArticle() @@ -788,15 +1042,27 @@ class PDFTextStripper extends jni.JObject { /// 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.JList> getCharactersByArticle() { - return _getCharactersByArticle(reference.pointer) + return _getCharactersByArticle( + reference.pointer, _id_getCharactersByArticle as jni.JMethodIDPtr) .object(const jni.JListType(jni.JListType(jni.JObjectType()))); } - static final _setSuppressDuplicateOverlappingText = jniLookup< + static final _id_setSuppressDuplicateOverlappingText = + _class.instanceMethodId( + r"setSuppressDuplicateOverlappingText", + r"(Z)V", + ); + + static final _setSuppressDuplicateOverlappingText = + ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Uint8)>>( - "PDFTextStripper__setSuppressDuplicateOverlappingText") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setSuppressDuplicateOverlappingText(boolean suppressDuplicateOverlappingTextValue) /// @@ -808,18 +1074,27 @@ class PDFTextStripper extends jni.JObject { bool suppressDuplicateOverlappingTextValue, ) { _setSuppressDuplicateOverlappingText( - reference.pointer, suppressDuplicateOverlappingTextValue ? 1 : 0) + reference.pointer, + _id_setSuppressDuplicateOverlappingText as jni.JMethodIDPtr, + suppressDuplicateOverlappingTextValue ? 1 : 0) .check(); } - static final _getSeparateByBeads = jniLookup< + static final _id_getSeparateByBeads = _class.instanceMethodId( + r"getSeparateByBeads", + r"()Z", + ); + + static final _getSeparateByBeads = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getSeparateByBeads") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean getSeparateByBeads() @@ -827,14 +1102,25 @@ class PDFTextStripper extends jni.JObject { /// This will tell if the text stripper should separate by beads. ///@return If the text will be grouped by beads. bool getSeparateByBeads() { - return _getSeparateByBeads(reference.pointer).boolean; + return _getSeparateByBeads( + reference.pointer, _id_getSeparateByBeads as jni.JMethodIDPtr) + .boolean; } - static final _setShouldSeparateByBeads = jniLookup< + static final _id_setShouldSeparateByBeads = _class.instanceMethodId( + r"setShouldSeparateByBeads", + r"(Z)V", + ); + + static final _setShouldSeparateByBeads = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("PDFTextStripper__setShouldSeparateByBeads") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setShouldSeparateByBeads(boolean aShouldSeparateByBeads) /// @@ -843,18 +1129,28 @@ class PDFTextStripper extends jni.JObject { void setShouldSeparateByBeads( bool aShouldSeparateByBeads, ) { - _setShouldSeparateByBeads(reference.pointer, aShouldSeparateByBeads ? 1 : 0) + _setShouldSeparateByBeads( + reference.pointer, + _id_setShouldSeparateByBeads as jni.JMethodIDPtr, + aShouldSeparateByBeads ? 1 : 0) .check(); } - static final _getEndBookmark = jniLookup< + static final _id_getEndBookmark = _class.instanceMethodId( + r"getEndBookmark", + r"()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;", + ); + + static final _getEndBookmark = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getEndBookmark") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getEndBookmark() @@ -863,16 +1159,26 @@ class PDFTextStripper extends jni.JObject { /// Get the bookmark where text extraction should end, inclusive. Default is null. ///@return The ending bookmark. jni.JObject getEndBookmark() { - return _getEndBookmark(reference.pointer).object(const jni.JObjectType()); + return _getEndBookmark( + reference.pointer, _id_getEndBookmark as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _setEndBookmark = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setEndBookmark") + static final _id_setEndBookmark = _class.instanceMethodId( + r"setEndBookmark", + r"(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;)V", + ); + + static final _setEndBookmark = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setEndBookmark(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem aEndBookmark) /// @@ -881,17 +1187,26 @@ class PDFTextStripper extends jni.JObject { void setEndBookmark( jni.JObject aEndBookmark, ) { - _setEndBookmark(reference.pointer, aEndBookmark.reference.pointer).check(); + _setEndBookmark(reference.pointer, _id_setEndBookmark as jni.JMethodIDPtr, + aEndBookmark.reference.pointer) + .check(); } - static final _getStartBookmark = jniLookup< + static final _id_getStartBookmark = _class.instanceMethodId( + r"getStartBookmark", + r"()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;", + ); + + static final _getStartBookmark = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getStartBookmark") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getStartBookmark() @@ -900,16 +1215,26 @@ class PDFTextStripper extends jni.JObject { /// Get the bookmark where text extraction should start, inclusive. Default is null. ///@return The starting bookmark. jni.JObject getStartBookmark() { - return _getStartBookmark(reference.pointer).object(const jni.JObjectType()); + return _getStartBookmark( + reference.pointer, _id_getStartBookmark as jni.JMethodIDPtr) + .object(const jni.JObjectType()); } - static final _setStartBookmark = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setStartBookmark") + static final _id_setStartBookmark = _class.instanceMethodId( + r"setStartBookmark", + r"(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;)V", + ); + + static final _setStartBookmark = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setStartBookmark(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem aStartBookmark) /// @@ -918,18 +1243,28 @@ class PDFTextStripper extends jni.JObject { void setStartBookmark( jni.JObject aStartBookmark, ) { - _setStartBookmark(reference.pointer, aStartBookmark.reference.pointer) + _setStartBookmark( + reference.pointer, + _id_setStartBookmark as jni.JMethodIDPtr, + aStartBookmark.reference.pointer) .check(); } - static final _getAddMoreFormatting = jniLookup< + static final _id_getAddMoreFormatting = _class.instanceMethodId( + r"getAddMoreFormatting", + r"()Z", + ); + + static final _getAddMoreFormatting = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getAddMoreFormatting") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean getAddMoreFormatting() @@ -937,14 +1272,25 @@ class PDFTextStripper extends jni.JObject { /// This will tell if the text stripper should add some more text formatting. ///@return true if some more text formatting will be added bool getAddMoreFormatting() { - return _getAddMoreFormatting(reference.pointer).boolean; + return _getAddMoreFormatting( + reference.pointer, _id_getAddMoreFormatting as jni.JMethodIDPtr) + .boolean; } - static final _setAddMoreFormatting = jniLookup< + static final _id_setAddMoreFormatting = _class.instanceMethodId( + r"setAddMoreFormatting", + r"(Z)V", + ); + + static final _setAddMoreFormatting = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("PDFTextStripper__setAddMoreFormatting") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setAddMoreFormatting(boolean newAddMoreFormatting) /// @@ -953,18 +1299,28 @@ class PDFTextStripper extends jni.JObject { void setAddMoreFormatting( bool newAddMoreFormatting, ) { - _setAddMoreFormatting(reference.pointer, newAddMoreFormatting ? 1 : 0) + _setAddMoreFormatting( + reference.pointer, + _id_setAddMoreFormatting as jni.JMethodIDPtr, + newAddMoreFormatting ? 1 : 0) .check(); } - static final _getSortByPosition = jniLookup< + static final _id_getSortByPosition = _class.instanceMethodId( + r"getSortByPosition", + r"()Z", + ); + + static final _getSortByPosition = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getSortByPosition") + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public boolean getSortByPosition() @@ -972,14 +1328,25 @@ class PDFTextStripper extends jni.JObject { /// This will tell if the text stripper should sort the text tokens before writing to the stream. ///@return true If the text tokens will be sorted before being written. bool getSortByPosition() { - return _getSortByPosition(reference.pointer).boolean; + return _getSortByPosition( + reference.pointer, _id_getSortByPosition as jni.JMethodIDPtr) + .boolean; } - static final _setSortByPosition = jniLookup< + static final _id_setSortByPosition = _class.instanceMethodId( + r"setSortByPosition", + r"(Z)V", + ); + + static final _setSortByPosition = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("PDFTextStripper__setSortByPosition") - .asFunction, int)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); /// from: public void setSortByPosition(boolean newSortByPosition) /// @@ -994,17 +1361,28 @@ class PDFTextStripper extends jni.JObject { void setSortByPosition( bool newSortByPosition, ) { - _setSortByPosition(reference.pointer, newSortByPosition ? 1 : 0).check(); + _setSortByPosition( + reference.pointer, + _id_setSortByPosition as jni.JMethodIDPtr, + newSortByPosition ? 1 : 0) + .check(); } - static final _getSpacingTolerance = jniLookup< + static final _id_getSpacingTolerance = _class.instanceMethodId( + r"getSpacingTolerance", + r"()F", + ); + + static final _getSpacingTolerance = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getSpacingTolerance") + jni.JMethodIDPtr, + )>>("globalEnv_CallFloatMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public float getSpacingTolerance() @@ -1013,14 +1391,25 @@ class PDFTextStripper extends jni.JObject { /// added. Note that the default value for this has been determined from trial and error. ///@return The current tolerance / scaling factor double getSpacingTolerance() { - return _getSpacingTolerance(reference.pointer).float; + return _getSpacingTolerance( + reference.pointer, _id_getSpacingTolerance as jni.JMethodIDPtr) + .float; } - static final _setSpacingTolerance = jniLookup< + static final _id_setSpacingTolerance = _class.instanceMethodId( + r"setSpacingTolerance", + r"(F)V", + ); + + static final _setSpacingTolerance = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Float)>>("PDFTextStripper__setSpacingTolerance") - .asFunction, double)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Double,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, double)>(); /// from: public void setSpacingTolerance(float spacingToleranceValue) /// @@ -1031,17 +1420,26 @@ class PDFTextStripper extends jni.JObject { void setSpacingTolerance( double spacingToleranceValue, ) { - _setSpacingTolerance(reference.pointer, spacingToleranceValue).check(); + _setSpacingTolerance(reference.pointer, + _id_setSpacingTolerance as jni.JMethodIDPtr, spacingToleranceValue) + .check(); } - static final _getAverageCharTolerance = jniLookup< + static final _id_getAverageCharTolerance = _class.instanceMethodId( + r"getAverageCharTolerance", + r"()F", + ); + + static final _getAverageCharTolerance = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getAverageCharTolerance") + jni.JMethodIDPtr, + )>>("globalEnv_CallFloatMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public float getAverageCharTolerance() @@ -1050,14 +1448,25 @@ class PDFTextStripper extends jni.JObject { /// be added. Note that the default value for this has been determined from trial and error. ///@return The current tolerance / scaling factor double getAverageCharTolerance() { - return _getAverageCharTolerance(reference.pointer).float; + return _getAverageCharTolerance( + reference.pointer, _id_getAverageCharTolerance as jni.JMethodIDPtr) + .float; } - static final _setAverageCharTolerance = jniLookup< + static final _id_setAverageCharTolerance = _class.instanceMethodId( + r"setAverageCharTolerance", + r"(F)V", + ); + + static final _setAverageCharTolerance = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Float)>>("PDFTextStripper__setAverageCharTolerance") - .asFunction, double)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Double,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, double)>(); /// from: public void setAverageCharTolerance(float averageCharToleranceValue) /// @@ -1068,18 +1477,28 @@ class PDFTextStripper extends jni.JObject { void setAverageCharTolerance( double averageCharToleranceValue, ) { - _setAverageCharTolerance(reference.pointer, averageCharToleranceValue) + _setAverageCharTolerance( + reference.pointer, + _id_setAverageCharTolerance as jni.JMethodIDPtr, + averageCharToleranceValue) .check(); } - static final _getIndentThreshold = jniLookup< + static final _id_getIndentThreshold = _class.instanceMethodId( + r"getIndentThreshold", + r"()F", + ); + + static final _getIndentThreshold = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getIndentThreshold") + jni.JMethodIDPtr, + )>>("globalEnv_CallFloatMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public float getIndentThreshold() @@ -1088,14 +1507,25 @@ class PDFTextStripper extends jni.JObject { /// indented from the previous line start beyond which the current line start is considered to be a paragraph start. ///@return the number of whitespace character widths to use when detecting paragraph indents. double getIndentThreshold() { - return _getIndentThreshold(reference.pointer).float; + return _getIndentThreshold( + reference.pointer, _id_getIndentThreshold as jni.JMethodIDPtr) + .float; } - static final _setIndentThreshold = jniLookup< + static final _id_setIndentThreshold = _class.instanceMethodId( + r"setIndentThreshold", + r"(F)V", + ); + + static final _setIndentThreshold = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Float)>>("PDFTextStripper__setIndentThreshold") - .asFunction, double)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Double,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, double)>(); /// from: public void setIndentThreshold(float indentThresholdValue) /// @@ -1106,17 +1536,26 @@ class PDFTextStripper extends jni.JObject { void setIndentThreshold( double indentThresholdValue, ) { - _setIndentThreshold(reference.pointer, indentThresholdValue).check(); + _setIndentThreshold(reference.pointer, + _id_setIndentThreshold as jni.JMethodIDPtr, indentThresholdValue) + .check(); } - static final _getDropThreshold = jniLookup< + static final _id_getDropThreshold = _class.instanceMethodId( + r"getDropThreshold", + r"()F", + ); + + static final _getDropThreshold = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getDropThreshold") + jni.JMethodIDPtr, + )>>("globalEnv_CallFloatMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public float getDropThreshold() @@ -1125,14 +1564,25 @@ class PDFTextStripper extends jni.JObject { /// start is considered to be a paragraph start. ///@return the character height multiple for max allowed whitespace between lines in the same paragraph. double getDropThreshold() { - return _getDropThreshold(reference.pointer).float; + return _getDropThreshold( + reference.pointer, _id_getDropThreshold as jni.JMethodIDPtr) + .float; } - static final _setDropThreshold = jniLookup< + static final _id_setDropThreshold = _class.instanceMethodId( + r"setDropThreshold", + r"(F)V", + ); + + static final _setDropThreshold = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Float)>>("PDFTextStripper__setDropThreshold") - .asFunction, double)>(); + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Double,)>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, jni.JMethodIDPtr, double)>(); /// from: public void setDropThreshold(float dropThresholdValue) /// @@ -1143,17 +1593,26 @@ class PDFTextStripper extends jni.JObject { void setDropThreshold( double dropThresholdValue, ) { - _setDropThreshold(reference.pointer, dropThresholdValue).check(); + _setDropThreshold(reference.pointer, + _id_setDropThreshold as jni.JMethodIDPtr, dropThresholdValue) + .check(); } - static final _getParagraphStart = jniLookup< + static final _id_getParagraphStart = _class.instanceMethodId( + r"getParagraphStart", + r"()Ljava/lang/String;", + ); + + static final _getParagraphStart = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getParagraphStart") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getParagraphStart() @@ -1162,17 +1621,26 @@ class PDFTextStripper extends jni.JObject { /// Returns the string which will be used at the beginning of a paragraph. ///@return the paragraph start string jni.JString getParagraphStart() { - return _getParagraphStart(reference.pointer) + return _getParagraphStart( + reference.pointer, _id_getParagraphStart as jni.JMethodIDPtr) .object(const jni.JStringType()); } - static final _setParagraphStart = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setParagraphStart") + static final _id_setParagraphStart = _class.instanceMethodId( + r"setParagraphStart", + r"(Ljava/lang/String;)V", + ); + + static final _setParagraphStart = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setParagraphStart(java.lang.String s) /// @@ -1181,17 +1649,26 @@ class PDFTextStripper extends jni.JObject { void setParagraphStart( jni.JString s, ) { - _setParagraphStart(reference.pointer, s.reference.pointer).check(); + _setParagraphStart(reference.pointer, + _id_setParagraphStart as jni.JMethodIDPtr, s.reference.pointer) + .check(); } - static final _getParagraphEnd = jniLookup< + static final _id_getParagraphEnd = _class.instanceMethodId( + r"getParagraphEnd", + r"()Ljava/lang/String;", + ); + + static final _getParagraphEnd = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getParagraphEnd") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getParagraphEnd() @@ -1200,16 +1677,26 @@ class PDFTextStripper extends jni.JObject { /// Returns the string which will be used at the end of a paragraph. ///@return the paragraph end string jni.JString getParagraphEnd() { - return _getParagraphEnd(reference.pointer).object(const jni.JStringType()); + return _getParagraphEnd( + reference.pointer, _id_getParagraphEnd as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setParagraphEnd = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setParagraphEnd") + static final _id_setParagraphEnd = _class.instanceMethodId( + r"setParagraphEnd", + r"(Ljava/lang/String;)V", + ); + + static final _setParagraphEnd = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setParagraphEnd(java.lang.String s) /// @@ -1218,17 +1705,26 @@ class PDFTextStripper extends jni.JObject { void setParagraphEnd( jni.JString s, ) { - _setParagraphEnd(reference.pointer, s.reference.pointer).check(); + _setParagraphEnd(reference.pointer, _id_setParagraphEnd as jni.JMethodIDPtr, + s.reference.pointer) + .check(); } - static final _getPageStart = jniLookup< + static final _id_getPageStart = _class.instanceMethodId( + r"getPageStart", + r"()Ljava/lang/String;", + ); + + static final _getPageStart = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getPageStart") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getPageStart() @@ -1237,16 +1733,26 @@ class PDFTextStripper extends jni.JObject { /// Returns the string which will be used at the beginning of a page. ///@return the page start string jni.JString getPageStart() { - return _getPageStart(reference.pointer).object(const jni.JStringType()); + return _getPageStart( + reference.pointer, _id_getPageStart as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setPageStart = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setPageStart") + static final _id_setPageStart = _class.instanceMethodId( + r"setPageStart", + r"(Ljava/lang/String;)V", + ); + + static final _setPageStart = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setPageStart(java.lang.String pageStartValue) /// @@ -1255,17 +1761,26 @@ class PDFTextStripper extends jni.JObject { void setPageStart( jni.JString pageStartValue, ) { - _setPageStart(reference.pointer, pageStartValue.reference.pointer).check(); + _setPageStart(reference.pointer, _id_setPageStart as jni.JMethodIDPtr, + pageStartValue.reference.pointer) + .check(); } - static final _getPageEnd = jniLookup< + static final _id_getPageEnd = _class.instanceMethodId( + r"getPageEnd", + r"()Ljava/lang/String;", + ); + + static final _getPageEnd = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getPageEnd") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getPageEnd() @@ -1274,16 +1789,25 @@ class PDFTextStripper extends jni.JObject { /// Returns the string which will be used at the end of a page. ///@return the page end string jni.JString getPageEnd() { - return _getPageEnd(reference.pointer).object(const jni.JStringType()); + return _getPageEnd(reference.pointer, _id_getPageEnd as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setPageEnd = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setPageEnd") + static final _id_setPageEnd = _class.instanceMethodId( + r"setPageEnd", + r"(Ljava/lang/String;)V", + ); + + static final _setPageEnd = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setPageEnd(java.lang.String pageEndValue) /// @@ -1292,17 +1816,26 @@ class PDFTextStripper extends jni.JObject { void setPageEnd( jni.JString pageEndValue, ) { - _setPageEnd(reference.pointer, pageEndValue.reference.pointer).check(); + _setPageEnd(reference.pointer, _id_setPageEnd as jni.JMethodIDPtr, + pageEndValue.reference.pointer) + .check(); } - static final _getArticleStart = jniLookup< + static final _id_getArticleStart = _class.instanceMethodId( + r"getArticleStart", + r"()Ljava/lang/String;", + ); + + static final _getArticleStart = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getArticleStart") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getArticleStart() @@ -1311,16 +1844,26 @@ class PDFTextStripper extends jni.JObject { /// Returns the string which will be used at the beginning of an article. ///@return the article start string jni.JString getArticleStart() { - return _getArticleStart(reference.pointer).object(const jni.JStringType()); + return _getArticleStart( + reference.pointer, _id_getArticleStart as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setArticleStart = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setArticleStart") + static final _id_setArticleStart = _class.instanceMethodId( + r"setArticleStart", + r"(Ljava/lang/String;)V", + ); + + static final _setArticleStart = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setArticleStart(java.lang.String articleStartValue) /// @@ -1329,18 +1872,26 @@ class PDFTextStripper extends jni.JObject { void setArticleStart( jni.JString articleStartValue, ) { - _setArticleStart(reference.pointer, articleStartValue.reference.pointer) + _setArticleStart(reference.pointer, _id_setArticleStart as jni.JMethodIDPtr, + articleStartValue.reference.pointer) .check(); } - static final _getArticleEnd = jniLookup< + static final _id_getArticleEnd = _class.instanceMethodId( + r"getArticleEnd", + r"()Ljava/lang/String;", + ); + + static final _getArticleEnd = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getArticleEnd") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: public java.lang.String getArticleEnd() @@ -1349,16 +1900,26 @@ class PDFTextStripper extends jni.JObject { /// Returns the string which will be used at the end of an article. ///@return the article end string jni.JString getArticleEnd() { - return _getArticleEnd(reference.pointer).object(const jni.JStringType()); + return _getArticleEnd( + reference.pointer, _id_getArticleEnd as jni.JMethodIDPtr) + .object(const jni.JStringType()); } - static final _setArticleEnd = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__setArticleEnd") + static final _id_setArticleEnd = _class.instanceMethodId( + r"setArticleEnd", + r"(Ljava/lang/String;)V", + ); + + static final _setArticleEnd = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: public void setArticleEnd(java.lang.String articleEndValue) /// @@ -1367,18 +1928,26 @@ class PDFTextStripper extends jni.JObject { void setArticleEnd( jni.JString articleEndValue, ) { - _setArticleEnd(reference.pointer, articleEndValue.reference.pointer) + _setArticleEnd(reference.pointer, _id_setArticleEnd as jni.JMethodIDPtr, + articleEndValue.reference.pointer) .check(); } - static final _writeParagraphSeparator = jniLookup< + static final _id_writeParagraphSeparator = _class.instanceMethodId( + r"writeParagraphSeparator", + r"()V", + ); + + static final _writeParagraphSeparator = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writeParagraphSeparator") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writeParagraphSeparator() @@ -1386,17 +1955,26 @@ class PDFTextStripper extends jni.JObject { /// writes the paragraph separator string to the output. ///@throws IOException if something went wrong void writeParagraphSeparator() { - _writeParagraphSeparator(reference.pointer).check(); + _writeParagraphSeparator( + reference.pointer, _id_writeParagraphSeparator as jni.JMethodIDPtr) + .check(); } - static final _writeParagraphStart = jniLookup< + static final _id_writeParagraphStart = _class.instanceMethodId( + r"writeParagraphStart", + r"()V", + ); + + static final _writeParagraphStart = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writeParagraphStart") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writeParagraphStart() @@ -1404,17 +1982,26 @@ class PDFTextStripper extends jni.JObject { /// Write something (if defined) at the start of a paragraph. ///@throws IOException if something went wrong void writeParagraphStart() { - _writeParagraphStart(reference.pointer).check(); + _writeParagraphStart( + reference.pointer, _id_writeParagraphStart as jni.JMethodIDPtr) + .check(); } - static final _writeParagraphEnd = jniLookup< + static final _id_writeParagraphEnd = _class.instanceMethodId( + r"writeParagraphEnd", + r"()V", + ); + + static final _writeParagraphEnd = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writeParagraphEnd") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writeParagraphEnd() @@ -1422,17 +2009,26 @@ class PDFTextStripper extends jni.JObject { /// Write something (if defined) at the end of a paragraph. ///@throws IOException if something went wrong void writeParagraphEnd() { - _writeParagraphEnd(reference.pointer).check(); + _writeParagraphEnd( + reference.pointer, _id_writeParagraphEnd as jni.JMethodIDPtr) + .check(); } - static final _writePageStart = jniLookup< + static final _id_writePageStart = _class.instanceMethodId( + r"writePageStart", + r"()V", + ); + + static final _writePageStart = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writePageStart") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writePageStart() @@ -1440,17 +2036,25 @@ class PDFTextStripper extends jni.JObject { /// Write something (if defined) at the start of a page. ///@throws IOException if something went wrong void writePageStart() { - _writePageStart(reference.pointer).check(); + _writePageStart(reference.pointer, _id_writePageStart as jni.JMethodIDPtr) + .check(); } - static final _writePageEnd = jniLookup< + static final _id_writePageEnd = _class.instanceMethodId( + r"writePageEnd", + r"()V", + ); + + static final _writePageEnd = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, - )>>("PDFTextStripper__writePageEnd") + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( + jni.JThrowablePtr Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected void writePageEnd() @@ -1458,17 +2062,25 @@ class PDFTextStripper extends jni.JObject { /// Write something (if defined) at the end of a page. ///@throws IOException if something went wrong void writePageEnd() { - _writePageEnd(reference.pointer).check(); + _writePageEnd(reference.pointer, _id_writePageEnd as jni.JMethodIDPtr) + .check(); } - static final _setListItemPatterns = jniLookup< + static final _id_setListItemPatterns = _class.instanceMethodId( + r"setListItemPatterns", + r"(Ljava/util/List;)V", + ); + + static final _setListItemPatterns = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "PDFTextStripper__setListItemPatterns") + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); /// from: protected void setListItemPatterns(java.util.List patterns) /// @@ -1477,17 +2089,28 @@ class PDFTextStripper extends jni.JObject { void setListItemPatterns( jni.JList patterns, ) { - _setListItemPatterns(reference.pointer, patterns.reference.pointer).check(); + _setListItemPatterns( + reference.pointer, + _id_setListItemPatterns as jni.JMethodIDPtr, + patterns.reference.pointer) + .check(); } - static final _getListItemPatterns = jniLookup< + static final _id_getListItemPatterns = _class.instanceMethodId( + r"getListItemPatterns", + r"()Ljava/util/List;", + ); + + static final _getListItemPatterns = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - )>>("PDFTextStripper__getListItemPatterns") + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, + jni.JMethodIDPtr, )>(); /// from: protected java.util.List getListItemPatterns() @@ -1510,16 +2133,28 @@ class PDFTextStripper extends jni.JObject { /// This method returns a list of such regular expression Patterns. ///@return a list of Pattern objects. jni.JList getListItemPatterns() { - return _getListItemPatterns(reference.pointer) + return _getListItemPatterns( + reference.pointer, _id_getListItemPatterns as jni.JMethodIDPtr) .object(const jni.JListType(jni.JObjectType())); } - static final _matchPattern = jniLookup< + static final _id_matchPattern = _class.staticMethodId( + r"matchPattern", + r"(Ljava/lang/String;Ljava/util/List;)Ljava/util/regex/Pattern;", + ); + + static final _matchPattern = ProtectedJniExtensions.lookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("PDFTextStripper__matchPattern") - .asFunction< - jni.JniResult Function( + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); /// from: static protected java.util.regex.Pattern matchPattern(java.lang.String string, java.util.List patterns) @@ -1539,7 +2174,11 @@ class PDFTextStripper extends jni.JObject { jni.JString string, jni.JList patterns, ) { - return _matchPattern(string.reference.pointer, patterns.reference.pointer) + return _matchPattern( + _class.reference.pointer, + _id_matchPattern as jni.JMethodIDPtr, + string.reference.pointer, + patterns.reference.pointer) .object(const jni.JObjectType()); } } diff --git a/pkgs/jnigen/example/pdfbox_plugin/linux/CMakeLists.txt b/pkgs/jnigen/example/pdfbox_plugin/linux/CMakeLists.txt index 986e388aa..ccfca4de7 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/linux/CMakeLists.txt +++ b/pkgs/jnigen/example/pdfbox_plugin/linux/CMakeLists.txt @@ -6,17 +6,3 @@ cmake_minimum_required(VERSION 3.10) # Project-level configuration. set(PROJECT_NAME "pdfbox_plugin") project(${PROJECT_NAME} LANGUAGES CXX) - -# Invoke the build for native code shared with the other target platforms. -# This can be changed to accomodate different builds. -add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared") - -# List of absolute paths to libraries that should be bundled with the plugin. -# This list could contain prebuilt libraries, or libraries created by an -# external build triggered from this build file. -set(pdfbox_plugin_bundled_libraries - # Defined in ../src/CMakeLists.txt. - # This can be changed to accomodate different builds. - $ - PARENT_SCOPE -) diff --git a/pkgs/jnigen/example/pdfbox_plugin/src/CMakeLists.txt b/pkgs/jnigen/example/pdfbox_plugin/src/CMakeLists.txt deleted file mode 100644 index f35376568..000000000 --- a/pkgs/jnigen/example/pdfbox_plugin/src/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(pdfbox_plugin VERSION 0.0.1 LANGUAGES C) - -add_library(pdfbox_plugin SHARED - "third_party//pdfbox_plugin.c" -) - -set_target_properties(pdfbox_plugin PROPERTIES - OUTPUT_NAME "pdfbox_plugin" -) - -target_compile_definitions(pdfbox_plugin PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(pdfbox_plugin log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(pdfbox_plugin ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/.clang-format b/pkgs/jnigen/example/pdfbox_plugin/src/third_party/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/dartjni.h b/pkgs/jnigen/example/pdfbox_plugin/src/third_party/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c b/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c deleted file mode 100644 index 6b111335c..000000000 --- a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c +++ /dev/null @@ -1,2872 +0,0 @@ -// Generated from Apache PDFBox library which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// org.apache.pdfbox.pdmodel.PDDocument -jclass _c_PDDocument = NULL; - -jmethodID _m_PDDocument__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__new0() { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__new0, "", "()V"); - if (_m_PDDocument__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_PDDocument, _m_PDDocument__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__new1(jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__new1, "", - "(Lorg/apache/pdfbox/io/MemoryUsageSetting;)V"); - if (_m_PDDocument__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocument, - _m_PDDocument__new1, memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__new2 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__new2(jobject doc) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__new2, "", - "(Lorg/apache/pdfbox/cos/COSDocument;)V"); - if (_m_PDDocument__new2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_PDDocument, _m_PDDocument__new2, doc); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__new3 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__new3(jobject doc, jobject source) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__new3, "", - "(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/" - "RandomAccessRead;)V"); - if (_m_PDDocument__new3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocument, - _m_PDDocument__new3, doc, source); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__new4 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__new4(jobject doc, jobject source, jobject permission) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__new4, "", - "(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/" - "RandomAccessRead;Lorg/apache/pdfbox/pdmodel/encryption/" - "AccessPermission;)V"); - if (_m_PDDocument__new4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_PDDocument, _m_PDDocument__new4, doc, source, permission); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__addPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__addPage(jobject self_, jobject page) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__addPage, "addPage", - "(Lorg/apache/pdfbox/pdmodel/PDPage;)V"); - if (_m_PDDocument__addPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__addPage, page); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__addSignature = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__addSignature(jobject self_, jobject sigObject) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__addSignature, "addSignature", - "(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/" - "PDSignature;)V"); - if (_m_PDDocument__addSignature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__addSignature, - sigObject); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__addSignature1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__addSignature1(jobject self_, - jobject sigObject, - jobject options) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__addSignature1, "addSignature", - "(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/" - "PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/" - "digitalsignature/SignatureOptions;)V"); - if (_m_PDDocument__addSignature1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__addSignature1, - sigObject, options); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__addSignature2 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__addSignature2(jobject self_, - jobject sigObject, - jobject signatureInterface) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__addSignature2, "addSignature", - "(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/" - "PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/" - "digitalsignature/SignatureInterface;)V"); - if (_m_PDDocument__addSignature2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__addSignature2, - sigObject, signatureInterface); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__addSignature3 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__addSignature3(jobject self_, - jobject sigObject, - jobject signatureInterface, - jobject options) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__addSignature3, "addSignature", - "(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/" - "PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/" - "digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/" - "interactive/digitalsignature/SignatureOptions;)V"); - if (_m_PDDocument__addSignature3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__addSignature3, - sigObject, signatureInterface, options); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__addSignatureField = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__addSignatureField(jobject self_, - jobject sigFields, - jobject signatureInterface, - jobject options) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__addSignatureField, - "addSignatureField", - "(Ljava/util/List;Lorg/apache/pdfbox/pdmodel/interactive/" - "digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/" - "interactive/digitalsignature/SignatureOptions;)V"); - if (_m_PDDocument__addSignatureField == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__addSignatureField, - sigFields, signatureInterface, options); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__removePage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__removePage(jobject self_, jobject page) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__removePage, "removePage", - "(Lorg/apache/pdfbox/pdmodel/PDPage;)V"); - if (_m_PDDocument__removePage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__removePage, page); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__removePage1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__removePage1(jobject self_, int32_t pageNumber) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__removePage1, "removePage", "(I)V"); - if (_m_PDDocument__removePage1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__removePage1, - pageNumber); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__importPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__importPage(jobject self_, jobject page) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_PDDocument, &_m_PDDocument__importPage, "importPage", - "(Lorg/apache/pdfbox/pdmodel/PDPage;)Lorg/apache/pdfbox/pdmodel/PDPage;"); - if (_m_PDDocument__importPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__importPage, page); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getDocument = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getDocument(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getDocument, "getDocument", - "()Lorg/apache/pdfbox/cos/COSDocument;"); - if (_m_PDDocument__getDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_PDDocument__getDocument); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getDocumentInformation = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getDocumentInformation(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getDocumentInformation, - "getDocumentInformation", - "()Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;"); - if (_m_PDDocument__getDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getDocumentInformation); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__setDocumentInformation = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__setDocumentInformation(jobject self_, jobject info) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__setDocumentInformation, - "setDocumentInformation", - "(Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;)V"); - if (_m_PDDocument__setDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocument__setDocumentInformation, info); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getDocumentCatalog = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getDocumentCatalog(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getDocumentCatalog, - "getDocumentCatalog", - "()Lorg/apache/pdfbox/pdmodel/PDDocumentCatalog;"); - if (_m_PDDocument__getDocumentCatalog == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getDocumentCatalog); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__isEncrypted = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__isEncrypted(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__isEncrypted, "isEncrypted", "()Z"); - if (_m_PDDocument__isEncrypted == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_PDDocument__isEncrypted); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getEncryption = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getEncryption(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getEncryption, "getEncryption", - "()Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;"); - if (_m_PDDocument__getEncryption == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_PDDocument__getEncryption); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__setEncryptionDictionary = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__setEncryptionDictionary(jobject self_, - jobject encryption) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__setEncryptionDictionary, - "setEncryptionDictionary", - "(Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;)V"); - if (_m_PDDocument__setEncryptionDictionary == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocument__setEncryptionDictionary, encryption); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getLastSignatureDictionary = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getLastSignatureDictionary(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_PDDocument, &_m_PDDocument__getLastSignatureDictionary, - "getLastSignatureDictionary", - "()Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;"); - if (_m_PDDocument__getLastSignatureDictionary == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getLastSignatureDictionary); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getSignatureFields = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getSignatureFields(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getSignatureFields, - "getSignatureFields", "()Ljava/util/List;"); - if (_m_PDDocument__getSignatureFields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getSignatureFields); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getSignatureDictionaries = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getSignatureDictionaries(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getSignatureDictionaries, - "getSignatureDictionaries", "()Ljava/util/List;"); - if (_m_PDDocument__getSignatureDictionaries == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getSignatureDictionaries); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__registerTrueTypeFontForClosing = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__registerTrueTypeFontForClosing(jobject self_, - jobject ttf) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__registerTrueTypeFontForClosing, - "registerTrueTypeFontForClosing", - "(Lorg/apache/fontbox/ttf/TrueTypeFont;)V"); - if (_m_PDDocument__registerTrueTypeFontForClosing == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocument__registerTrueTypeFontForClosing, ttf); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__load = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load(jobject file) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_PDDocument, &_m_PDDocument__load, "load", - "(Ljava/io/File;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load, file); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load1(jobject file, jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load1, "load", - "(Ljava/io/File;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/" - "pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load1, file, memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load2 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load2(jobject file, jobject password) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_PDDocument, &_m_PDDocument__load2, "load", - "(Ljava/io/File;Ljava/lang/String;)Lorg/apache/pdfbox/" - "pdmodel/PDDocument;"); - if (_m_PDDocument__load2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load2, file, password); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load3 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load3(jobject file, - jobject password, - jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load3, "load", - "(Ljava/io/File;Ljava/lang/String;Lorg/apache/pdfbox/io/" - "MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load3, file, password, - memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load4 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load4(jobject file, - jobject password, - jobject keyStore, - jobject alias) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load4, "load", - "(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/" - "String;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load4, file, password, keyStore, - alias); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load5 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load5(jobject file, - jobject password, - jobject keyStore, - jobject alias, - jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load5, "load", - "(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/" - "String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/" - "pdmodel/PDDocument;"); - if (_m_PDDocument__load5 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load5, file, password, keyStore, - alias, memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load6 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load6(jobject input) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load6, "load", - "(Ljava/io/InputStream;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load6 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load6, input); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load7 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load7(jobject input, jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load7, "load", - "(Ljava/io/InputStream;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/" - "apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load7 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load7, input, memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load8 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load8(jobject input, jobject password) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_PDDocument, &_m_PDDocument__load8, "load", - "(Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/" - "pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load8 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load8, input, password); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load9 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load9(jobject input, - jobject password, - jobject keyStore, - jobject alias) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load9, "load", - "(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/" - "String;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load9 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load9, input, password, keyStore, - alias); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load10 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load10(jobject input, - jobject password, - jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load10, "load", - "(Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/" - "MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load10 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load10, input, password, - memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load11 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load11(jobject input, - jobject password, - jobject keyStore, - jobject alias, - jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load11, "load", - "(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/" - "String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/" - "pdmodel/PDDocument;"); - if (_m_PDDocument__load11 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load11, input, password, keyStore, - alias, memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load12 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load12(jobject input) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_PDDocument, &_m_PDDocument__load12, "load", - "([B)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load12 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load12, input); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load13 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load13(jobject input, jobject password) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load13, "load", - "([BLjava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load13 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load13, input, password); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load14 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load14(jobject input, - jobject password, - jobject keyStore, - jobject alias) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_PDDocument, &_m_PDDocument__load14, "load", - "([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/" - "String;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load14 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load14, input, password, keyStore, - alias); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__load15 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__load15(jobject input, - jobject password, - jobject keyStore, - jobject alias, - jobject memUsageSetting) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDDocument, &_m_PDDocument__load15, "load", - "([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/" - "pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;"); - if (_m_PDDocument__load15 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDDocument, _m_PDDocument__load15, input, password, keyStore, - alias, memUsageSetting); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__save = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__save(jobject self_, jobject fileName) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__save, "save", - "(Ljava/lang/String;)V"); - if (_m_PDDocument__save == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__save, fileName); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__save1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__save1(jobject self_, jobject file) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__save1, "save", - "(Ljava/io/File;)V"); - if (_m_PDDocument__save1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__save1, file); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__save2 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__save2(jobject self_, jobject output) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__save2, "save", - "(Ljava/io/OutputStream;)V"); - if (_m_PDDocument__save2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__save2, output); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__saveIncremental = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__saveIncremental(jobject self_, jobject output) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__saveIncremental, "saveIncremental", - "(Ljava/io/OutputStream;)V"); - if (_m_PDDocument__saveIncremental == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__saveIncremental, - output); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__saveIncremental1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__saveIncremental1(jobject self_, - jobject output, - jobject objectsToWrite) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__saveIncremental1, - "saveIncremental", "(Ljava/io/OutputStream;Ljava/util/Set;)V"); - if (_m_PDDocument__saveIncremental1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__saveIncremental1, - output, objectsToWrite); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__saveIncrementalForExternalSigning = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__saveIncrementalForExternalSigning(jobject self_, - jobject output) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__saveIncrementalForExternalSigning, - "saveIncrementalForExternalSigning", - "(Ljava/io/OutputStream;)Lorg/apache/pdfbox/pdmodel/interactive/" - "digitalsignature/ExternalSigningSupport;"); - if (_m_PDDocument__saveIncrementalForExternalSigning == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__saveIncrementalForExternalSigning, output); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getPage(jobject self_, int32_t pageIndex) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getPage, "getPage", - "(I)Lorg/apache/pdfbox/pdmodel/PDPage;"); - if (_m_PDDocument__getPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getPage, pageIndex); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getPages = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getPages(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getPages, "getPages", - "()Lorg/apache/pdfbox/pdmodel/PDPageTree;"); - if (_m_PDDocument__getPages == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_PDDocument__getPages); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__getNumberOfPages = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getNumberOfPages(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getNumberOfPages, - "getNumberOfPages", "()I"); - if (_m_PDDocument__getNumberOfPages == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_PDDocument__getNumberOfPages); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__close = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__close(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__close, "close", "()V"); - if (_m_PDDocument__close == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__close); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__protect = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__protect(jobject self_, jobject policy) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__protect, "protect", - "(Lorg/apache/pdfbox/pdmodel/encryption/ProtectionPolicy;)V"); - if (_m_PDDocument__protect == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__protect, policy); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getCurrentAccessPermission = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getCurrentAccessPermission(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getCurrentAccessPermission, - "getCurrentAccessPermission", - "()Lorg/apache/pdfbox/pdmodel/encryption/AccessPermission;"); - if (_m_PDDocument__getCurrentAccessPermission == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getCurrentAccessPermission); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__isAllSecurityToBeRemoved = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__isAllSecurityToBeRemoved(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__isAllSecurityToBeRemoved, - "isAllSecurityToBeRemoved", "()Z"); - if (_m_PDDocument__isAllSecurityToBeRemoved == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_PDDocument__isAllSecurityToBeRemoved); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__setAllSecurityToBeRemoved = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__setAllSecurityToBeRemoved(jobject self_, - uint8_t removeAllSecurity) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__setAllSecurityToBeRemoved, - "setAllSecurityToBeRemoved", "(Z)V"); - if (_m_PDDocument__setAllSecurityToBeRemoved == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocument__setAllSecurityToBeRemoved, - removeAllSecurity); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getDocumentId = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getDocumentId(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getDocumentId, "getDocumentId", - "()Ljava/lang/Long;"); - if (_m_PDDocument__getDocumentId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_PDDocument__getDocumentId); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__setDocumentId = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__setDocumentId(jobject self_, jobject docId) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__setDocumentId, "setDocumentId", - "(Ljava/lang/Long;)V"); - if (_m_PDDocument__setDocumentId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__setDocumentId, docId); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getVersion = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getVersion(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getVersion, "getVersion", "()F"); - if (_m_PDDocument__getVersion == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - float _result = - (*jniEnv)->CallFloatMethod(jniEnv, self_, _m_PDDocument__getVersion); - return (JniResult){.value = {.f = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__setVersion = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__setVersion(jobject self_, float newVersion) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__setVersion, "setVersion", "(F)V"); - if (_m_PDDocument__setVersion == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__setVersion, - newVersion); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocument__getResourceCache = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__getResourceCache(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__getResourceCache, - "getResourceCache", - "()Lorg/apache/pdfbox/pdmodel/ResourceCache;"); - if (_m_PDDocument__getResourceCache == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocument__getResourceCache); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocument__setResourceCache = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocument__setResourceCache(jobject self_, jobject resourceCache) { - load_env(); - load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); - if (_c_PDDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__setResourceCache, - "setResourceCache", - "(Lorg/apache/pdfbox/pdmodel/ResourceCache;)V"); - if (_m_PDDocument__setResourceCache == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocument__setResourceCache, - resourceCache); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// org.apache.pdfbox.pdmodel.PDDocumentInformation -jclass _c_PDDocumentInformation = NULL; - -jmethodID _m_PDDocumentInformation__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__new0() { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__new0, - "", "()V"); - if (_m_PDDocumentInformation__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocumentInformation, - _m_PDDocumentInformation__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__new1(jobject dic) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__new1, - "", "(Lorg/apache/pdfbox/cos/COSDictionary;)V"); - if (_m_PDDocumentInformation__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocumentInformation, - _m_PDDocumentInformation__new1, dic); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__getCOSObject = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getCOSObject(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getCOSObject, - "getCOSObject", "()Lorg/apache/pdfbox/cos/COSDictionary;"); - if (_m_PDDocumentInformation__getCOSObject == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getCOSObject); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__getPropertyStringValue = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getPropertyStringValue(jobject self_, - jobject propertyKey) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__getPropertyStringValue, - "getPropertyStringValue", - "(Ljava/lang/String;)Ljava/lang/Object;"); - if (_m_PDDocumentInformation__getPropertyStringValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getPropertyStringValue, - propertyKey); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__getTitle = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getTitle(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getTitle, - "getTitle", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getTitle == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getTitle); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setTitle = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setTitle(jobject self_, jobject title) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setTitle, - "setTitle", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setTitle == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocumentInformation__setTitle, - title); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getAuthor = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getAuthor(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getAuthor, - "getAuthor", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getAuthor == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getAuthor); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setAuthor = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setAuthor(jobject self_, jobject author) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setAuthor, - "setAuthor", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setAuthor == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocumentInformation__setAuthor, - author); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getSubject = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getSubject(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getSubject, - "getSubject", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getSubject == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getSubject); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setSubject = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setSubject(jobject self_, jobject subject) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setSubject, - "setSubject", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setSubject == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocumentInformation__setSubject, - subject); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getKeywords = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getKeywords(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getKeywords, - "getKeywords", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getKeywords == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getKeywords); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setKeywords = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setKeywords(jobject self_, jobject keywords) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setKeywords, - "setKeywords", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setKeywords == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocumentInformation__setKeywords, keywords); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getCreator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getCreator(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getCreator, - "getCreator", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getCreator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getCreator); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setCreator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setCreator(jobject self_, jobject creator) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setCreator, - "setCreator", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setCreator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocumentInformation__setCreator, - creator); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getProducer = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getProducer(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getProducer, - "getProducer", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getProducer == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getProducer); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setProducer = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setProducer(jobject self_, jobject producer) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setProducer, - "setProducer", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setProducer == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocumentInformation__setProducer, producer); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getCreationDate = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getCreationDate(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__getCreationDate, "getCreationDate", - "()Ljava/util/Calendar;"); - if (_m_PDDocumentInformation__getCreationDate == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getCreationDate); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setCreationDate = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setCreationDate(jobject self_, jobject date) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__setCreationDate, "setCreationDate", - "(Ljava/util/Calendar;)V"); - if (_m_PDDocumentInformation__setCreationDate == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocumentInformation__setCreationDate, date); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getModificationDate = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getModificationDate(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__getModificationDate, - "getModificationDate", "()Ljava/util/Calendar;"); - if (_m_PDDocumentInformation__getModificationDate == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getModificationDate); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setModificationDate = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setModificationDate(jobject self_, - jobject date) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__setModificationDate, - "setModificationDate", "(Ljava/util/Calendar;)V"); - if (_m_PDDocumentInformation__setModificationDate == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_PDDocumentInformation__setModificationDate, date); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__getTrapped = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getTrapped(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__getTrapped, - "getTrapped", "()Ljava/lang/String;"); - if (_m_PDDocumentInformation__getTrapped == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getTrapped); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__getMetadataKeys = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getMetadataKeys(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__getMetadataKeys, "getMetadataKeys", - "()Ljava/util/Set;"); - if (_m_PDDocumentInformation__getMetadataKeys == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getMetadataKeys); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__getCustomMetadataValue = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__getCustomMetadataValue(jobject self_, - jobject fieldName) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__getCustomMetadataValue, - "getCustomMetadataValue", - "(Ljava/lang/String;)Ljava/lang/String;"); - if (_m_PDDocumentInformation__getCustomMetadataValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDDocumentInformation__getCustomMetadataValue, - fieldName); - return to_global_ref_result(_result); -} - -jmethodID _m_PDDocumentInformation__setCustomMetadataValue = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setCustomMetadataValue(jobject self_, - jobject fieldName, - jobject fieldValue) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, - &_m_PDDocumentInformation__setCustomMetadataValue, - "setCustomMetadataValue", - "(Ljava/lang/String;Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setCustomMetadataValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDDocumentInformation__setCustomMetadataValue, - fieldName, fieldValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDDocumentInformation__setTrapped = NULL; -FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__setTrapped(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_PDDocumentInformation, - "org/apache/pdfbox/pdmodel/PDDocumentInformation"); - if (_c_PDDocumentInformation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__setTrapped, - "setTrapped", "(Ljava/lang/String;)V"); - if (_m_PDDocumentInformation__setTrapped == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDDocumentInformation__setTrapped, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// org.apache.pdfbox.text.PDFTextStripper -jclass _c_PDFTextStripper = NULL; - -jmethodID _m_PDFTextStripper__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__new0() { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__new0, "", "()V"); - if (_m_PDFTextStripper__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDFTextStripper, - _m_PDFTextStripper__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__getText = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getText(jobject self_, jobject doc) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getText, "getText", - "(Lorg/apache/pdfbox/pdmodel/PDDocument;)Ljava/lang/String;"); - if (_m_PDFTextStripper__getText == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getText, doc); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__writeText = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeText(jobject self_, - jobject doc, - jobject outputStream) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeText, "writeText", - "(Lorg/apache/pdfbox/pdmodel/PDDocument;Ljava/io/Writer;)V"); - if (_m_PDFTextStripper__writeText == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writeText, doc, - outputStream); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__processPages = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__processPages(jobject self_, jobject pages) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__processPages, - "processPages", "(Lorg/apache/pdfbox/pdmodel/PDPageTree;)V"); - if (_m_PDFTextStripper__processPages == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__processPages, - pages); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__startDocument = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__startDocument(jobject self_, jobject document) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__startDocument, - "startDocument", "(Lorg/apache/pdfbox/pdmodel/PDDocument;)V"); - if (_m_PDFTextStripper__startDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__startDocument, - document); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__endDocument = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__endDocument(jobject self_, jobject document) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__endDocument, - "endDocument", "(Lorg/apache/pdfbox/pdmodel/PDDocument;)V"); - if (_m_PDFTextStripper__endDocument == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__endDocument, - document); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__processPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__processPage(jobject self_, jobject page) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__processPage, - "processPage", "(Lorg/apache/pdfbox/pdmodel/PDPage;)V"); - if (_m_PDFTextStripper__processPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__processPage, - page); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__startArticle = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__startArticle(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__startArticle, - "startArticle", "()V"); - if (_m_PDFTextStripper__startArticle == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__startArticle); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__startArticle1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__startArticle1(jobject self_, uint8_t isLTR) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__startArticle1, - "startArticle", "(Z)V"); - if (_m_PDFTextStripper__startArticle1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__startArticle1, - isLTR); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__endArticle = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__endArticle(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__endArticle, "endArticle", - "()V"); - if (_m_PDFTextStripper__endArticle == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__endArticle); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__startPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__startPage(jobject self_, jobject page) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__startPage, "startPage", - "(Lorg/apache/pdfbox/pdmodel/PDPage;)V"); - if (_m_PDFTextStripper__startPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__startPage, page); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__endPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__endPage(jobject self_, jobject page) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__endPage, "endPage", - "(Lorg/apache/pdfbox/pdmodel/PDPage;)V"); - if (_m_PDFTextStripper__endPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__endPage, page); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writePage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writePage(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writePage, "writePage", - "()V"); - if (_m_PDFTextStripper__writePage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writePage); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeLineSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeLineSeparator(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeLineSeparator, - "writeLineSeparator", "()V"); - if (_m_PDFTextStripper__writeLineSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__writeLineSeparator); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeWordSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeWordSeparator(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeWordSeparator, - "writeWordSeparator", "()V"); - if (_m_PDFTextStripper__writeWordSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__writeWordSeparator); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeCharacters = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeCharacters(jobject self_, jobject text) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeCharacters, - "writeCharacters", "(Lorg/apache/pdfbox/text/TextPosition;)V"); - if (_m_PDFTextStripper__writeCharacters == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writeCharacters, - text); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeString = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeString(jobject self_, - jobject text, - jobject textPositions) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeString, - "writeString", "(Ljava/lang/String;Ljava/util/List;)V"); - if (_m_PDFTextStripper__writeString == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writeString, - text, textPositions); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeString1 = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeString1(jobject self_, jobject text) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeString1, - "writeString", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__writeString1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writeString1, - text); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__processTextPosition = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__processTextPosition(jobject self_, jobject text) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__processTextPosition, - "processTextPosition", - "(Lorg/apache/pdfbox/text/TextPosition;)V"); - if (_m_PDFTextStripper__processTextPosition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__processTextPosition, text); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getStartPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getStartPage(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getStartPage, - "getStartPage", "()I"); - if (_m_PDFTextStripper__getStartPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_PDFTextStripper__getStartPage); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setStartPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setStartPage(jobject self_, int32_t startPageValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setStartPage, - "setStartPage", "(I)V"); - if (_m_PDFTextStripper__setStartPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setStartPage, - startPageValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getEndPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getEndPage(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getEndPage, "getEndPage", - "()I"); - if (_m_PDFTextStripper__getEndPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_PDFTextStripper__getEndPage); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setEndPage = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setEndPage(jobject self_, int32_t endPageValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setEndPage, "setEndPage", - "(I)V"); - if (_m_PDFTextStripper__setEndPage == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setEndPage, - endPageValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setLineSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setLineSeparator(jobject self_, jobject separator) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setLineSeparator, - "setLineSeparator", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setLineSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setLineSeparator, - separator); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getLineSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getLineSeparator(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getLineSeparator, - "getLineSeparator", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getLineSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getLineSeparator); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__getWordSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getWordSeparator(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getWordSeparator, - "getWordSeparator", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getWordSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getWordSeparator); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setWordSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setWordSeparator(jobject self_, jobject separator) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setWordSeparator, - "setWordSeparator", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setWordSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setWordSeparator, - separator); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getSuppressDuplicateOverlappingText = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getSuppressDuplicateOverlappingText(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, - &_m_PDFTextStripper__getSuppressDuplicateOverlappingText, - "getSuppressDuplicateOverlappingText", "()Z"); - if (_m_PDFTextStripper__getSuppressDuplicateOverlappingText == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_PDFTextStripper__getSuppressDuplicateOverlappingText); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getCurrentPageNo = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getCurrentPageNo(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getCurrentPageNo, - "getCurrentPageNo", "()I"); - if (_m_PDFTextStripper__getCurrentPageNo == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_PDFTextStripper__getCurrentPageNo); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getOutput = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getOutput(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getOutput, "getOutput", - "()Ljava/io/Writer;"); - if (_m_PDFTextStripper__getOutput == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_PDFTextStripper__getOutput); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__getCharactersByArticle = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getCharactersByArticle(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getCharactersByArticle, - "getCharactersByArticle", "()Ljava/util/List;"); - if (_m_PDFTextStripper__getCharactersByArticle == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getCharactersByArticle); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setSuppressDuplicateOverlappingText = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setSuppressDuplicateOverlappingText( - jobject self_, - uint8_t suppressDuplicateOverlappingTextValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, - &_m_PDFTextStripper__setSuppressDuplicateOverlappingText, - "setSuppressDuplicateOverlappingText", "(Z)V"); - if (_m_PDFTextStripper__setSuppressDuplicateOverlappingText == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_PDFTextStripper__setSuppressDuplicateOverlappingText, - suppressDuplicateOverlappingTextValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getSeparateByBeads = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getSeparateByBeads(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getSeparateByBeads, - "getSeparateByBeads", "()Z"); - if (_m_PDFTextStripper__getSeparateByBeads == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_PDFTextStripper__getSeparateByBeads); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setShouldSeparateByBeads = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setShouldSeparateByBeads( - jobject self_, - uint8_t aShouldSeparateByBeads) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setShouldSeparateByBeads, - "setShouldSeparateByBeads", "(Z)V"); - if (_m_PDFTextStripper__setShouldSeparateByBeads == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setShouldSeparateByBeads, - aShouldSeparateByBeads); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getEndBookmark = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getEndBookmark(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getEndBookmark, - "getEndBookmark", - "()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/" - "outline/PDOutlineItem;"); - if (_m_PDFTextStripper__getEndBookmark == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getEndBookmark); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setEndBookmark = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setEndBookmark(jobject self_, jobject aEndBookmark) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setEndBookmark, - "setEndBookmark", - "(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/" - "outline/PDOutlineItem;)V"); - if (_m_PDFTextStripper__setEndBookmark == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setEndBookmark, - aEndBookmark); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getStartBookmark = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getStartBookmark(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getStartBookmark, - "getStartBookmark", - "()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/" - "outline/PDOutlineItem;"); - if (_m_PDFTextStripper__getStartBookmark == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getStartBookmark); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setStartBookmark = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setStartBookmark(jobject self_, - jobject aStartBookmark) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setStartBookmark, - "setStartBookmark", - "(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/" - "outline/PDOutlineItem;)V"); - if (_m_PDFTextStripper__setStartBookmark == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setStartBookmark, - aStartBookmark); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getAddMoreFormatting = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getAddMoreFormatting(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getAddMoreFormatting, - "getAddMoreFormatting", "()Z"); - if (_m_PDFTextStripper__getAddMoreFormatting == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_PDFTextStripper__getAddMoreFormatting); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setAddMoreFormatting = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setAddMoreFormatting(jobject self_, - uint8_t newAddMoreFormatting) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setAddMoreFormatting, - "setAddMoreFormatting", "(Z)V"); - if (_m_PDFTextStripper__setAddMoreFormatting == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setAddMoreFormatting, - newAddMoreFormatting); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getSortByPosition = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getSortByPosition(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getSortByPosition, - "getSortByPosition", "()Z"); - if (_m_PDFTextStripper__getSortByPosition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_PDFTextStripper__getSortByPosition); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setSortByPosition = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setSortByPosition(jobject self_, - uint8_t newSortByPosition) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setSortByPosition, - "setSortByPosition", "(Z)V"); - if (_m_PDFTextStripper__setSortByPosition == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_PDFTextStripper__setSortByPosition, newSortByPosition); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getSpacingTolerance = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getSpacingTolerance(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getSpacingTolerance, - "getSpacingTolerance", "()F"); - if (_m_PDFTextStripper__getSpacingTolerance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - float _result = (*jniEnv)->CallFloatMethod( - jniEnv, self_, _m_PDFTextStripper__getSpacingTolerance); - return (JniResult){.value = {.f = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setSpacingTolerance = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setSpacingTolerance(jobject self_, - float spacingToleranceValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setSpacingTolerance, - "setSpacingTolerance", "(F)V"); - if (_m_PDFTextStripper__setSpacingTolerance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setSpacingTolerance, - spacingToleranceValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getAverageCharTolerance = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getAverageCharTolerance(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getAverageCharTolerance, - "getAverageCharTolerance", "()F"); - if (_m_PDFTextStripper__getAverageCharTolerance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - float _result = (*jniEnv)->CallFloatMethod( - jniEnv, self_, _m_PDFTextStripper__getAverageCharTolerance); - return (JniResult){.value = {.f = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setAverageCharTolerance = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setAverageCharTolerance( - jobject self_, - float averageCharToleranceValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setAverageCharTolerance, - "setAverageCharTolerance", "(F)V"); - if (_m_PDFTextStripper__setAverageCharTolerance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setAverageCharTolerance, - averageCharToleranceValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getIndentThreshold = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getIndentThreshold(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getIndentThreshold, - "getIndentThreshold", "()F"); - if (_m_PDFTextStripper__getIndentThreshold == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - float _result = (*jniEnv)->CallFloatMethod( - jniEnv, self_, _m_PDFTextStripper__getIndentThreshold); - return (JniResult){.value = {.f = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setIndentThreshold = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setIndentThreshold(jobject self_, - float indentThresholdValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setIndentThreshold, - "setIndentThreshold", "(F)V"); - if (_m_PDFTextStripper__setIndentThreshold == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setIndentThreshold, - indentThresholdValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getDropThreshold = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getDropThreshold(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getDropThreshold, - "getDropThreshold", "()F"); - if (_m_PDFTextStripper__getDropThreshold == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - float _result = (*jniEnv)->CallFloatMethod( - jniEnv, self_, _m_PDFTextStripper__getDropThreshold); - return (JniResult){.value = {.f = _result}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setDropThreshold = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setDropThreshold(jobject self_, - float dropThresholdValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setDropThreshold, - "setDropThreshold", "(F)V"); - if (_m_PDFTextStripper__setDropThreshold == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setDropThreshold, - dropThresholdValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getParagraphStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getParagraphStart(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getParagraphStart, - "getParagraphStart", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getParagraphStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getParagraphStart); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setParagraphStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setParagraphStart(jobject self_, jobject s) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setParagraphStart, - "setParagraphStart", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setParagraphStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setParagraphStart, s); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getParagraphEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getParagraphEnd(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getParagraphEnd, - "getParagraphEnd", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getParagraphEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getParagraphEnd); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setParagraphEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setParagraphEnd(jobject self_, jobject s) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setParagraphEnd, - "setParagraphEnd", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setParagraphEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setParagraphEnd, - s); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getPageStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getPageStart(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getPageStart, - "getPageStart", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getPageStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getPageStart); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setPageStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setPageStart(jobject self_, jobject pageStartValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setPageStart, - "setPageStart", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setPageStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setPageStart, - pageStartValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getPageEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getPageEnd(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getPageEnd, "getPageEnd", - "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getPageEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_PDFTextStripper__getPageEnd); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setPageEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setPageEnd(jobject self_, jobject pageEndValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setPageEnd, "setPageEnd", - "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setPageEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setPageEnd, - pageEndValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getArticleStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getArticleStart(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getArticleStart, - "getArticleStart", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getArticleStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getArticleStart); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setArticleStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setArticleStart(jobject self_, - jobject articleStartValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setArticleStart, - "setArticleStart", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setArticleStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setArticleStart, - articleStartValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getArticleEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getArticleEnd(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getArticleEnd, - "getArticleEnd", "()Ljava/lang/String;"); - if (_m_PDFTextStripper__getArticleEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getArticleEnd); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__setArticleEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setArticleEnd(jobject self_, - jobject articleEndValue) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setArticleEnd, - "setArticleEnd", "(Ljava/lang/String;)V"); - if (_m_PDFTextStripper__setArticleEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__setArticleEnd, - articleEndValue); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeParagraphSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeParagraphSeparator(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeParagraphSeparator, - "writeParagraphSeparator", "()V"); - if (_m_PDFTextStripper__writeParagraphSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__writeParagraphSeparator); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeParagraphStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeParagraphStart(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeParagraphStart, - "writeParagraphStart", "()V"); - if (_m_PDFTextStripper__writeParagraphStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__writeParagraphStart); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writeParagraphEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writeParagraphEnd(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writeParagraphEnd, - "writeParagraphEnd", "()V"); - if (_m_PDFTextStripper__writeParagraphEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__writeParagraphEnd); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writePageStart = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writePageStart(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writePageStart, - "writePageStart", "()V"); - if (_m_PDFTextStripper__writePageStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writePageStart); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__writePageEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__writePageEnd(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__writePageEnd, - "writePageEnd", "()V"); - if (_m_PDFTextStripper__writePageEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_PDFTextStripper__writePageEnd); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__setListItemPatterns = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__setListItemPatterns(jobject self_, - jobject patterns) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__setListItemPatterns, - "setListItemPatterns", "(Ljava/util/List;)V"); - if (_m_PDFTextStripper__setListItemPatterns == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_PDFTextStripper__setListItemPatterns, patterns); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_PDFTextStripper__getListItemPatterns = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__getListItemPatterns(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__getListItemPatterns, - "getListItemPatterns", "()Ljava/util/List;"); - if (_m_PDFTextStripper__getListItemPatterns == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_PDFTextStripper__getListItemPatterns); - return to_global_ref_result(_result); -} - -jmethodID _m_PDFTextStripper__matchPattern = NULL; -FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__matchPattern(jobject string, jobject patterns) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_PDFTextStripper, &_m_PDFTextStripper__matchPattern, "matchPattern", - "(Ljava/lang/String;Ljava/util/List;)Ljava/util/regex/Pattern;"); - if (_m_PDFTextStripper__matchPattern == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PDFTextStripper, _m_PDFTextStripper__matchPattern, string, - patterns); - return to_global_ref_result(_result); -} - -jfieldID _f_PDFTextStripper__LINE_SEPARATOR = NULL; -FFI_PLUGIN_EXPORT -JniResult get_PDFTextStripper__LINE_SEPARATOR(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__LINE_SEPARATOR, - "LINE_SEPARATOR", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_PDFTextStripper__LINE_SEPARATOR); - return to_global_ref_result(_result); -} - -jfieldID _f_PDFTextStripper__charactersByArticle = NULL; -FFI_PLUGIN_EXPORT -JniResult get_PDFTextStripper__charactersByArticle(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__charactersByArticle, - "charactersByArticle", "Ljava/util/ArrayList;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_PDFTextStripper__charactersByArticle); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_PDFTextStripper__charactersByArticle(jobject self_, - jobject value) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__charactersByArticle, - "charactersByArticle", "Ljava/util/ArrayList;"); - (*jniEnv)->SetObjectField(jniEnv, self_, - _f_PDFTextStripper__charactersByArticle, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_PDFTextStripper__document = NULL; -FFI_PLUGIN_EXPORT -JniResult get_PDFTextStripper__document(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__document, "document", - "Lorg/apache/pdfbox/pdmodel/PDDocument;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_PDFTextStripper__document); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_PDFTextStripper__document(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__document, "document", - "Lorg/apache/pdfbox/pdmodel/PDDocument;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_PDFTextStripper__document, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_PDFTextStripper__output = NULL; -FFI_PLUGIN_EXPORT -JniResult get_PDFTextStripper__output(jobject self_) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__output, "output", - "Ljava/io/Writer;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_PDFTextStripper__output); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_PDFTextStripper__output(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_PDFTextStripper, - "org/apache/pdfbox/text/PDFTextStripper"); - if (_c_PDFTextStripper == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_PDFTextStripper, &_f_PDFTextStripper__output, "output", - "Ljava/io/Writer;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_PDFTextStripper__output, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} diff --git a/pkgs/jnigen/example/pdfbox_plugin/windows/CMakeLists.txt b/pkgs/jnigen/example/pdfbox_plugin/windows/CMakeLists.txt index 3d9bd5c70..0413ac97a 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/windows/CMakeLists.txt +++ b/pkgs/jnigen/example/pdfbox_plugin/windows/CMakeLists.txt @@ -7,17 +7,3 @@ cmake_minimum_required(VERSION 3.14) # Project-level configuration. set(PROJECT_NAME "pdfbox_plugin") project(${PROJECT_NAME} LANGUAGES CXX) - -# Invoke the build for native code shared with the other target platforms. -# This can be changed to accomodate different builds. -add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared") - -# List of absolute paths to libraries that should be bundled with the plugin. -# This list could contain prebuilt libraries, or libraries created by an -# external build triggered from this build file. -set(pdfbox_plugin_bundled_libraries - # Defined in ../src/CMakeLists.txt. - # This can be changed to accomodate different builds. - $ - PARENT_SCOPE -) diff --git a/pkgs/jnigen/lib/src/bindings/c_generator.dart b/pkgs/jnigen/lib/src/bindings/c_generator.dart deleted file mode 100644 index b99e7136a..000000000 --- a/pkgs/jnigen/lib/src/bindings/c_generator.dart +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) 2023, 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 '../config/config.dart'; -import '../elements/elements.dart'; -import '../logging/logging.dart'; -import '../util/find_package.dart'; -import '../util/string_util.dart'; -import 'visitor.dart'; - -class CFieldName extends Visitor { - const CFieldName(); - - @override - String visit(Field node) { - final className = node.classDecl.uniqueName; - final fieldName = node.finalName; - return '${className}__$fieldName'; - } -} - -class CMethodName extends Visitor { - const CMethodName(); - - @override - String visit(Method node) { - final className = node.classDecl.uniqueName; - final methodName = node.finalName; - return '${className}__$methodName'; - } -} - -class CGenerator extends Visitor> { - static const _prelude = '''// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "jni.h" -#include "dartjni.h" - -thread_local JNIEnv *jniEnv; -JniContext *jni; - -JniContext *(*context_getter)(void); -JNIEnv *(*env_getter)(void); - -void setJniGetters(JniContext *(*cg)(void), - JNIEnv *(*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -'''; - - final Config config; - - CGenerator(this.config); - - Future _copyFileFromPackage(String package, String relPath, Uri target, - {String Function(String)? transform}) async { - final packagePath = await findPackageRoot(package); - if (packagePath != null) { - final sourceFile = File.fromUri(packagePath.resolve(relPath)); - final targetFile = await File.fromUri(target).create(recursive: true); - var source = await sourceFile.readAsString(); - if (transform != null) { - source = transform(source); - } - await targetFile.writeAsString(source); - } else { - log.warning('package $package not found! ' - 'skipped copying ${target.toFilePath()}'); - } - } - - @override - Future visit(Classes node) async { - // Write C file and init file. - final cConfig = config.outputConfig.cConfig!; - final cRoot = cConfig.path; - final preamble = config.preamble; - log.info("Using c root = $cRoot"); - final libraryName = cConfig.libraryName; - log.info('Creating dart init file ...'); - // Create C file. - final subdir = cConfig.subdir ?? '.'; - final cFileRelativePath = '$subdir/$libraryName.c'; - final cFile = await File.fromUri(cRoot.resolve(cFileRelativePath)) - .create(recursive: true); - final cFileStream = cFile.openWrite(); - // Write C Bindings. - if (preamble != null) { - cFileStream.writeln(preamble); - } - cFileStream.write(_prelude); - final classGenerator = _CClassGenerator(config, cFileStream); - for (final classDecl in node.decls.values) { - classDecl.accept(classGenerator); - } - await cFileStream.close(); - log.info('Copying auxiliary files...'); - for (final file in ['dartjni.h', '.clang-format']) { - await _copyFileFromPackage( - 'jni', 'src/$file', cRoot.resolve('$subdir/$file')); - } - await _copyFileFromPackage( - 'jnigen', 'cmake/CMakeLists.txt.tmpl', cRoot.resolve('CMakeLists.txt'), - transform: (s) { - return s - .replaceAll('{{LIBRARY_NAME}}', libraryName) - .replaceAll('{{SUBDIR}}', subdir); - }); - log.info('Running clang-format on C bindings'); - try { - final clangFormat = Process.runSync('clang-format', ['-i', cFile.path]); - if (clangFormat.exitCode != 0) { - printError(clangFormat.stderr); - log.warning('clang-format exited with ${clangFormat.exitCode}'); - } - } on ProcessException catch (e) { - log.warning('cannot run clang-format: $e'); - } - } -} - -const _classVarPrefix = '_c_'; -const _jniResultType = 'JniResult'; -const _loadEnvCall = 'load_env();'; -const _ifError = - '(JniResult){.value = {.j = 0}, .exception = check_exception()}'; - -class _CClassGenerator extends Visitor { - final Config config; - final StringSink s; - - _CClassGenerator(this.config, this.s); - - @override - void visit(ClassDecl node) { - final classNameInC = node.uniqueName; - final classVar = '$_classVarPrefix$classNameInC'; - // Global variable in C that holds the reference to class. - s.write('''// ${node.binaryName} -jclass $classVar = NULL; - -'''); - - final methodGenerator = _CMethodGenerator(config, s); - for (final method in node.methods) { - method.accept(methodGenerator); - } - - final fieldGenerator = _CFieldGenerator(config, s); - for (final field in node.fields) { - field.accept(fieldGenerator); - } - } -} - -class _CLoadClassGenerator extends Visitor { - _CLoadClassGenerator(); - - @override - String visit(ClassDecl node) { - final classVar = '$_classVarPrefix${node.uniqueName}'; - return ''' load_class_global_ref(&$classVar, "${node.internalName}"); - if ($classVar == NULL) return $_ifError;'''; - } -} - -class _CMethodGenerator extends Visitor { - static const _methodVarPrefix = '_m_'; - - final Config config; - final StringSink s; - - _CMethodGenerator(this.config, this.s); - - @override - void visit(Method node) { - final classNameInC = node.classDecl.uniqueName; - - final cMethodName = node.accept(const CMethodName()); - final classRef = '$_classVarPrefix$classNameInC'; - final methodId = '$_methodVarPrefix$cMethodName'; - final cMethodParams = [ - if (!node.isCtor && !node.isStatic) 'jobject self_', - ...node.params.accept(const _CParamGenerator(addReturnType: true)), - ].join(','); - final jniSignature = node.descriptor; - final ifStaticMethodID = node.isStatic ? 'static_' : ''; - - var javaReturnType = node.returnType.type; - if (node.isCtor) { - javaReturnType = DeclaredType( - binaryName: node.classDecl.binaryName, - ); - } - final callType = node.returnType.accept(const _CTypeCallSite()); - final callArgs = [ - 'jniEnv', - if (!node.isCtor && !node.isStatic) 'self_' else classRef, - methodId, - ...node.params.accept(const _CParamGenerator(addReturnType: false)) - ].join(', '); - - var ifAssignResult = ''; - if (javaReturnType.name != 'void') { - ifAssignResult = - '${javaReturnType.accept(const _CReturnType())} _result = '; - } - - final ifStaticCall = node.isStatic ? 'Static' : ''; - final envMethod = - node.isCtor ? 'NewObject' : 'Call$ifStaticCall${callType}Method'; - final returnResultIfAny = javaReturnType.accept(const _CResult()); - s.write(''' -jmethodID $methodId = NULL; -FFI_PLUGIN_EXPORT -$_jniResultType $cMethodName($cMethodParams) { - $_loadEnvCall - ${node.classDecl.accept(_CLoadClassGenerator())} - load_${ifStaticMethodID}method($classRef, - &$methodId, "${node.name}", "$jniSignature"); - if ($methodId == NULL) return $_ifError; - $ifAssignResult(*jniEnv)->$envMethod($callArgs); - $returnResultIfAny -} - -'''); - } -} - -class _CFieldGenerator extends Visitor { - static const _fieldVarPrefix = '_f_'; - - final Config config; - final StringSink s; - - _CFieldGenerator(this.config, this.s); - - @override - void visit(Field node) { - final cClassName = node.classDecl.uniqueName; - - final fieldName = node.finalName; - final fieldNameInC = node.accept(const CFieldName()); - final fieldVar = "$_fieldVarPrefix$fieldNameInC"; - - // If the field is final and default is assigned, then no need to wrap - // this field. It should then be a constant in dart code. - if (node.isStatic && - node.isFinal && - node.defaultValue != null && - (node.defaultValue is num || node.defaultValue is bool)) { - return; - } - - s.write('jfieldID $fieldVar = NULL;\n'); - - final classVar = '$_classVarPrefix$cClassName'; - void writeAccessor({bool isSetter = false}) { - const cReturnType = _jniResultType; - final cMethodPrefix = isSetter ? 'set' : 'get'; - final formalArgs = [ - if (!node.isStatic) 'jobject self_', - if (isSetter) '${node.type.accept(const _CReturnType())} value', - ].join(', '); - final ifStaticField = node.isStatic ? 'static_' : ''; - final ifStaticCall = node.isStatic ? 'Static' : ''; - final callType = node.type.accept(const _CTypeCallSite()); - final objectArgument = node.isStatic ? classVar : 'self_'; - - String accessorStatements; - if (isSetter) { - accessorStatements = - ' (*jniEnv)->Set$ifStaticCall${callType}Field(jniEnv, ' - '$objectArgument, $fieldVar, value);\n' - ' return $_ifError;'; - } else { - final getterExpr = - '(*jniEnv)->Get$ifStaticCall${callType}Field(jniEnv, ' - '$objectArgument, $fieldVar)'; - final cResultType = node.type.accept(const _CReturnType()); - final result = node.type.accept(const _CResult()); - accessorStatements = ''' $cResultType _result = $getterExpr; - $result'''; - } - s.write(''' -FFI_PLUGIN_EXPORT -$cReturnType ${cMethodPrefix}_$fieldNameInC($formalArgs) { - $_loadEnvCall - ${node.classDecl.accept(_CLoadClassGenerator())} - load_${ifStaticField}field($classVar, &$fieldVar, "$fieldName", - "${node.type.descriptor}"); -$accessorStatements -} - -'''); - } - - writeAccessor(isSetter: false); - if (node.isFinal) { - return; - } - writeAccessor(isSetter: true); - } -} - -class _CParamGenerator extends Visitor { - /// These should be avoided in parameter names. - static const _cTypeKeywords = { - 'short', - 'char', - 'int', - 'long', - 'float', - 'double', - }; - - const _CParamGenerator({required this.addReturnType}); - - final bool addReturnType; - - @override - String visit(Param node) { - final paramName = - (_cTypeKeywords.contains(node.name) ? '${node.name}0' : node.name) - .replaceAll('\$', '_'); - if (addReturnType) { - final type = node.type.accept(const _CReturnType()); - return '$type $paramName'; - } - return paramName; - } -} - -class _CReturnType extends TypeVisitor { - const _CReturnType(); - - @override - String visitNonPrimitiveType(ReferredType node) { - return 'jobject'; - } - - @override - String visitPrimitiveType(PrimitiveType node) { - return node.cType; - } -} - -class _CTypeCallSite extends TypeVisitor { - const _CTypeCallSite(); - - @override - String visitNonPrimitiveType(ReferredType node) { - return 'Object'; - } - - @override - String visitPrimitiveType(PrimitiveType node) { - return node.name.capitalize(); - } -} - -class _CResult extends TypeVisitor { - const _CResult(); - - @override - String visitNonPrimitiveType(ReferredType node) { - return 'return to_global_ref_result(_result);'; - } - - @override - String visitPrimitiveType(PrimitiveType node) { - if (node.name == 'void') { - return 'return $_ifError;'; - } - // The union field is the same as the type's signature, but in lowercase. - final unionField = node.signature.toLowerCase(); - return 'return (JniResult){.value = {.$unionField = _result}, ' - '.exception = check_exception()};'; - } -} diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index eeac075a8..987eaa719 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart @@ -2,7 +2,6 @@ // 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 'dart:io'; import 'package:meta/meta.dart'; @@ -12,7 +11,6 @@ import '../config/experiments.dart'; import '../elements/elements.dart'; import '../logging/logging.dart'; import '../util/string_util.dart'; -import 'c_generator.dart'; import 'resolver.dart'; import 'visitor.dart'; @@ -39,7 +37,6 @@ const _typeParamPrefix = '\$'; // Misc. const _protectedExtension = 'ProtectedJniExtensions'; const _classRef = '_class'; -const _lookup = 'jniLookup'; /// Used for C bindings. const _selfPointer = 'reference.pointer'; @@ -125,22 +122,6 @@ class DartGenerator extends Visitor> { DartGenerator(this.config); - static const cInitImport = 'import "dart:ffi" as ffi;\n' - 'import "package:jni/internal_helpers_for_jnigen.dart";\n'; - - /// Initialization code for C based bindings. - /// - /// Should be called once in a package. In package-structured bindings - /// this is placed in _init.dart in package root. - String get cInitCode => ''' -// Auto-generated initialization code. - -final $_ffi.Pointer Function(String sym) $_lookup = - $_protectedExtension.initGeneratedLibrary("${config.outputConfig.cConfig!.libraryName}"); - - -'''; - static const autoGeneratedNotice = '// Autogenerated by jnigen. ' 'DO NOT EDIT!\n\n'; static const defaultImports = ''' @@ -190,22 +171,18 @@ import "package:jni/jni.dart" as jni; @override Future visit(Classes node) async { - final cBased = config.outputConfig.bindingsType == BindingsType.cBased; final root = config.outputConfig.dartConfig.path; final preamble = config.preamble ?? ''; if (config.outputConfig.dartConfig.structure == OutputStructure.singleFile) { final file = File.fromUri(root); await file.create(recursive: true); - log.info("Generating ${cBased ? "C + Dart" : "Pure Dart"} Bindings"); + log.info("Generating bindings"); final s = file.openWrite(); s.writeln(preamble); s.writeln(autoGeneratedNotice); s.writeln(defaultLintSuppressions); s.writeln(defaultImports); - if (cBased) { - s.writeln(cInitCode); - } final resolver = Resolver( importedClasses: config.importedClasses, currentClass: null, // Single file mode. @@ -232,17 +209,6 @@ import "package:jni/jni.dart" as jni; } log.info("Using dart root = $root"); - const initFileName = '_init.dart'; - if (cBased) { - final initFileUri = root.resolve(initFileName); - final initFile = File.fromUri(initFileUri); - await initFile.create(recursive: true); - final initStream = initFile.openWrite(); - initStream.writeln(preamble); - initStream.writeln(cInitImport); - initStream.writeln(cInitCode); - await initStream.close(); - } for (var fileClassName in files.keys) { final relativeFileName = '${fileClassName.replaceAll('.', '/')}.dart'; final dartFileUri = root.resolve(relativeFileName); @@ -256,14 +222,6 @@ import "package:jni/jni.dart" as jni; dartFileStream.writeln(defaultLintSuppressions); dartFileStream.writeln(defaultImports); final s = StringBuffer(); - if (cBased) { - final initFilePath = ('../' * - relativeFileName.codeUnits - .where((cu) => cu == '/'.codeUnitAt(0)) - .length) + - initFileName; - s.write('import "$initFilePath";'); - } final resolver = Resolver( importedClasses: config.importedClasses, currentClass: fileClassName, @@ -310,9 +268,6 @@ class _ClassGenerator extends Visitor { @override void visit(ClassDecl node) { - final isDartOnly = - config.outputConfig.bindingsType == BindingsType.dartOnly; - // Docs. s.write('/// from: ${node.binaryName}\n'); node.javadoc?.accept(_DocGenerator(s, depth: 0)); @@ -371,13 +326,11 @@ class $name$typeParamsDef extends $superName { '''); - if (isDartOnly) { - final internalName = node.internalName; - s.write(''' + final internalName = node.internalName; + s.write(''' static final $_classRef = $_jni.JClass.forName(r"$internalName"); '''); - } // Static TypeClass getter. s.writeln( @@ -905,13 +858,12 @@ class _JniResultGetter extends TypeVisitor { /// ``` class _TypeSig extends TypeVisitor { final bool isFfi; - final bool isCBased; - const _TypeSig({required this.isFfi, required this.isCBased}); + const _TypeSig({required this.isFfi}); @override String visitPrimitiveType(PrimitiveType node) { - if (!isCBased && isFfi) { + if (isFfi) { // TODO(https://github.com/dart-lang/sdk/issues/55471): Once this lands in // the stable, use the actual types instead. if (node.name == 'float' || node.name == 'double') { @@ -955,48 +907,6 @@ class _FieldGenerator extends Visitor { const _FieldGenerator(this.config, this.resolver, this.s); - void writeCAccessor(Field node) { - final name = node.finalName; - final cName = node.accept(const CFieldName()); - final ifRef = node.isStatic ? '' : '$_jPointer, '; - - s.write(''' - static final _get_$name = - $_lookup<$_ffi.NativeFunction<$_jResult Function($ifRef)>>( - "get_$cName") - .asFunction<$_jResult Function($ifRef)>(); - -'''); - - if (!node.isFinal) { - final ffiSig = - node.type.accept(const _TypeSig(isFfi: true, isCBased: true)); - final dartSig = - node.type.accept(const _TypeSig(isFfi: false, isCBased: true)); - s.write(''' - static final _set_$name = - $_lookup<$_ffi.NativeFunction<$_jResult Function($ifRef$ffiSig)>>( - "set_$cName") - .asFunction<$_jResult Function($ifRef$dartSig)>(); - -'''); - } - } - - String cGetter(Field node) { - final name = node.finalName; - final getter = node.type.accept(_JniResultGetter(resolver)); - final self = node.isStatic ? '' : _selfPointer; - return '_get_$name($self).$getter'; - } - - String cSetter(Field node) { - final name = node.finalName; - final self = node.isStatic ? '' : '$_selfPointer, '; - final toNativeSuffix = node.type.accept(const _ToNativeSuffix()); - return '_set_$name(${self}value$toNativeSuffix).check()'; - } - void writeDartOnlyAccessor(Field node) { final name = node.finalName; final staticOrInstance = node.isStatic ? 'static' : 'instance'; @@ -1035,8 +945,6 @@ class _FieldGenerator extends Visitor { @override void visit(Field node) { - final isCBased = config.outputConfig.bindingsType == BindingsType.cBased; - // Check if it should be a `static const` getter. if (node.isFinal && node.isStatic && node.defaultValue != null) { final name = node.finalName; @@ -1049,7 +957,7 @@ class _FieldGenerator extends Visitor { } // Accessors. - (isCBased ? writeCAccessor : writeDartOnlyAccessor)(node); + writeDartOnlyAccessor(node); // Getter docs. writeDocs(node, writeReleaseInstructions: true); @@ -1058,14 +966,14 @@ class _FieldGenerator extends Visitor { final ifStatic = node.isStatic ? 'static ' : ''; final type = node.type.accept(_TypeGenerator(resolver)); s.write('$ifStatic$type get $name => '); - s.write((isCBased ? cGetter : dartOnlyGetter)(node)); + s.write(dartOnlyGetter(node)); s.writeln(';\n'); if (!node.isFinal) { // Setter docs. writeDocs(node, writeReleaseInstructions: true); s.write('${ifStatic}set $name($type value) => '); - s.write((isCBased ? cSetter : dartOnlySetter)(node)); + s.write(dartOnlySetter(node)); s.writeln(';\n'); } } @@ -1073,26 +981,25 @@ class _FieldGenerator extends Visitor { class _MethodTypeSig extends Visitor { final bool isFfi; - final bool isCBased; - const _MethodTypeSig({required this.isFfi, required this.isCBased}); + const _MethodTypeSig({required this.isFfi}); @override String visit(Method node) { final callParams = node.params .map((param) => param.type) - .accept(_TypeSig(isFfi: isFfi, isCBased: isCBased)) + .accept(_TypeSig(isFfi: isFfi)) .join(', '); final args = [ - if ((!node.isCtor && !node.isStatic) || !isCBased) _voidPointer, - if (!isCBased) '$_jni.JMethodIDPtr', - !isCBased && isFfi && callParams.isNotEmpty + _voidPointer, + '$_jni.JMethodIDPtr', + isFfi && callParams.isNotEmpty ? '$_ffi.VarArgs<($callParams${node.params.length == 1 ? ',' : ''})>' : callParams ].join(', '); final isCtor = node.isCtor; final isVoid = node.returnType.name == 'void'; - final returnType = !isCBased && !isCtor && isVoid ? _jThrowable : _jResult; + final returnType = !isCtor && isVoid ? _jThrowable : _jResult; return '$returnType Function($args)'; } } @@ -1105,21 +1012,6 @@ class _MethodGenerator extends Visitor { const _MethodGenerator(this.config, this.resolver, this.s); - void writeCAccessor(Method node) { - final name = node.finalName; - final cName = node.accept(const CMethodName()); - final ffiSig = - node.accept(const _MethodTypeSig(isFfi: true, isCBased: true)); - final dartSig = - node.accept(const _MethodTypeSig(isFfi: false, isCBased: true)); - s.write(''' - static final _$name = - $_lookup<$_ffi.NativeFunction<$ffiSig>>("$cName") - .asFunction<$dartSig>(); - -'''); - } - void writeDartOnlyAccessor(Method node) { final name = node.finalName; final kind = node.isCtor @@ -1136,10 +1028,8 @@ class _MethodGenerator extends Visitor { r"$descriptor", ); '''); - final ffiSig = - node.accept(const _MethodTypeSig(isFfi: true, isCBased: false)); - final dartSig = - node.accept(const _MethodTypeSig(isFfi: false, isCBased: false)); + final ffiSig = node.accept(const _MethodTypeSig(isFfi: true)); + final dartSig = node.accept(const _MethodTypeSig(isFfi: false)); final methodName = node.accept(const _CallMethodName()); s.write(''' @@ -1192,10 +1082,8 @@ class _MethodGenerator extends Visitor { @override void visit(Method node) { - final isCBased = config.outputConfig.bindingsType == BindingsType.cBased; - // Accessors - (isCBased ? writeCAccessor : writeDartOnlyAccessor)(node); + writeDartOnlyAccessor(node); // Docs s.write(' /// from: '); @@ -1251,7 +1139,7 @@ class _MethodGenerator extends Visitor { typeParam.accept(const _TypeParamGenerator(withExtends: false))) .delimited(', '); - final ctorExpr = (isCBased ? cCtor : dartOnlyCtor)(node); + final ctorExpr = dartOnlyCtor(node); s.write(''' factory $ctorName($paramsDef$typeClassDef) { $typeInference @@ -1295,7 +1183,7 @@ class _MethodGenerator extends Visitor { } final params = defArgs.delimited(', '); s.write(' $ifStatic$returnType $name$typeParamsDef($params$typeClassDef)'); - final callExpr = (isCBased ? cMethodCall : dartOnlyMethodCall)(node); + final callExpr = dartOnlyMethodCall(node); if (isSuspendFun(node)) { final returningType = node.asyncReturnType!.accept(_TypeClassGenerator(resolver)).name; diff --git a/pkgs/jnigen/lib/src/config/config_types.dart b/pkgs/jnigen/lib/src/config/config_types.dart index 02dcbc2ea..e00717f88 100644 --- a/pkgs/jnigen/lib/src/config/config_types.dart +++ b/pkgs/jnigen/lib/src/config/config_types.dart @@ -190,51 +190,6 @@ OutputStructure getOutputStructure(String? name, OutputStructure defaultVal) { ); } -enum BindingsType { cBased, dartOnly } - -extension GetConfigString on BindingsType { - String getConfigString() { - return name.toSnakeCase(); - } -} - -BindingsType getBindingsType(String? name, BindingsType defaultVal) { - return _getEnumValueFromString( - BindingsType.values.valuesMap(), - name, - defaultVal, - ); -} - -class CCodeOutputConfig { - CCodeOutputConfig({ - required this.path, - required this.libraryName, - this.subdir, - }) { - _ensureIsDirectory('C output path', path); - if (subdir != null) { - _ensureIsDirectory('C subdirectory', path.resolve(subdir!)); - } - } - - /// Directory to write JNI C Bindings, in C+Dart mode. - /// - /// Strictly speaking, this is the root to place the `CMakeLists.txt` file - /// for the generated C bindings. It may be desirable to use the [subdir] - /// options to write C files to a subdirectory of [path]. For instance, - /// when generated code is required to be in `third_party` directory. - Uri path; - - /// Name of generated library in CMakeLists.txt configuration. - /// - /// This will also determine the name of shared object file. - String libraryName; - - /// Subfolder relative to [path] to write generated C code. - String? subdir; -} - class DartCodeOutputConfig { DartCodeOutputConfig({ required this.path, @@ -271,17 +226,10 @@ class SymbolsOutputConfig { class OutputConfig { OutputConfig({ required this.dartConfig, - this.bindingsType = BindingsType.cBased, - this.cConfig, this.symbolsConfig, - }) { - if (bindingsType == BindingsType.cBased && cConfig == null) { - throw ConfigException('C output config must be provided!'); - } - } - BindingsType bindingsType; + }); + DartCodeOutputConfig dartConfig; - CCodeOutputConfig? cConfig; SymbolsOutputConfig? symbolsConfig; } @@ -578,17 +526,6 @@ class Config { fields: regexFilter(_Props.excludeFields), ), outputConfig: OutputConfig( - bindingsType: getBindingsType( - prov.getString(_Props.bindingsType), - BindingsType.cBased, - ), - cConfig: prov.hasValue(_Props.cCodeOutputConfig) - ? CCodeOutputConfig( - libraryName: must(prov.getString, '', _Props.libraryName), - path: must(prov.getPath, Uri.parse('.'), _Props.cRoot), - subdir: prov.getString(_Props.cSubdir), - ) - : null, dartConfig: DartCodeOutputConfig( path: must(prov.getPath, Uri.parse('.'), _Props.dartRoot), structure: getOutputStructure( @@ -676,15 +613,10 @@ class _Props { static const experiments = 'enable_experiment'; static const import = 'import'; static const outputConfig = 'output'; - static const bindingsType = '$outputConfig.bindings_type'; - static const cCodeOutputConfig = '$outputConfig.c'; static const dartCodeOutputConfig = '$outputConfig.dart'; static const symbolsOutputConfig = '$outputConfig.symbols'; - static const cRoot = '$cCodeOutputConfig.path'; - static const cSubdir = '$cCodeOutputConfig.subdir'; static const dartRoot = '$dartCodeOutputConfig.path'; static const outputStructure = '$dartCodeOutputConfig.structure'; - static const libraryName = '$cCodeOutputConfig.library_name'; static const preamble = 'preamble'; static const logLevel = 'log_level'; diff --git a/pkgs/jnigen/lib/src/generate_bindings.dart b/pkgs/jnigen/lib/src/generate_bindings.dart index 883ca8575..e0027f87d 100644 --- a/pkgs/jnigen/lib/src/generate_bindings.dart +++ b/pkgs/jnigen/lib/src/generate_bindings.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'dart:convert'; -import 'bindings/c_generator.dart'; import 'bindings/dart_generator.dart'; import 'bindings/descriptor.dart'; import 'bindings/excluder.dart'; @@ -44,11 +43,6 @@ Future generateJniBindings(Config config) async { classes.accept(const Descriptor()); classes.accept(Renamer(config)); - final cBased = config.outputConfig.bindingsType == BindingsType.cBased; - if (cBased) { - await classes.accept(CGenerator(config)); - } - try { await classes.accept(DartGenerator(config)); log.info('Completed'); diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index 159f83843..2859e0acb 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml @@ -4,7 +4,7 @@ name: jnigen description: A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. -version: 0.8.1-wip +version: 0.9.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/jnigen environment: diff --git a/pkgs/jnigen/test/.gitignore b/pkgs/jnigen/test/.gitignore index 36f1ec5bc..3bde18030 100644 --- a/pkgs/jnigen/test/.gitignore +++ b/pkgs/jnigen/test/.gitignore @@ -1,4 +1,2 @@ # TODO(#166): Remove this. !jni.jar -runtime_test_registrant_dartonly_generated.dart -generated_runtime_test.dart \ No newline at end of file diff --git a/pkgs/jnigen/test/config_test.dart b/pkgs/jnigen/test/config_test.dart index ae2f9871e..53d432703 100644 --- a/pkgs/jnigen/test/config_test.dart +++ b/pkgs/jnigen/test/config_test.dart @@ -15,20 +15,13 @@ import 'test_util/test_util.dart'; const packageTests = 'test'; final jacksonCoreTests = absolute(packageTests, 'jackson_core_test'); final thirdParty = absolute(jacksonCoreTests, 'third_party'); -final lib = absolute(thirdParty, 'c_based', 'dart_bindings'); -final src = absolute(thirdParty, 'c_based', 'c_bindings'); -final testLib = absolute(thirdParty, 'test_', 'c_based', 'dart_bindings'); -final testSrc = absolute(thirdParty, 'test_', 'c_based', 'c_bindings'); +final lib = absolute(thirdParty, 'bindings'); +final testLib = absolute(thirdParty, 'test_', 'bindings'); /// Compares 2 [Config] objects using [expect] to give useful errors when /// two fields are not equal. void expectConfigsAreEqual(Config a, Config b) { expect(a.classes, equals(b.classes), reason: "classes"); - expect(a.outputConfig.cConfig?.libraryName, - equals(b.outputConfig.cConfig?.libraryName), - reason: "libraryName"); - expect(a.outputConfig.cConfig?.path, equals(b.outputConfig.cConfig?.path), - reason: "cRoot"); expect(a.outputConfig.dartConfig.path, equals(b.outputConfig.dartConfig.path), reason: "dartRoot"); expect(a.outputConfig.symbolsConfig?.path, @@ -102,7 +95,6 @@ void main() async { final config = Config.parseArgs([ '--config', jnigenYaml, - '-Doutput.c.path=$testSrc${Platform.pathSeparator}', '-Doutput.dart.path=$testLib${Platform.pathSeparator}', ]); @@ -111,16 +103,11 @@ void main() async { config, getConfig( root: join(thirdParty, 'test_'), - bindingsType: BindingsType.cBased, ), ); }); group('Test for config error checking', () { - testForErrorChecking( - name: 'Invalid bindings type', - overrides: ['-Doutput.bindings_type=c_base'], - ); testForErrorChecking( name: 'Invalid output structure', overrides: ['-Doutput.dart.structure=singl_file'], diff --git a/pkgs/jnigen/test/jackson_core_test/generate.dart b/pkgs/jnigen/test/jackson_core_test/generate.dart index 796a760ca..2e6009d4b 100644 --- a/pkgs/jnigen/test/jackson_core_test/generate.dart +++ b/pkgs/jnigen/test/jackson_core_test/generate.dart @@ -33,10 +33,8 @@ Config getConfig({ String? root, bool generateFullVersion = false, bool useAsm = false, - BindingsType bindingsType = BindingsType.dartOnly, }) { final rootDir = root ?? thirdPartyDir; - final bindingTypeDir = bindingsType.getConfigString(); final config = Config( mavenDownloads: MavenDownloads( sourceDeps: deps, @@ -48,17 +46,8 @@ Config getConfig({ ), preamble: jacksonPreamble, outputConfig: OutputConfig( - bindingsType: bindingsType, - // Have to be judicious here, and ensure null when bindings type is - // dart-only, because config-test is also using this. - cConfig: bindingsType == BindingsType.cBased - ? CCodeOutputConfig( - libraryName: 'jackson_core', - path: Uri.directory(join(rootDir, bindingTypeDir, 'c_bindings')), - ) - : null, dartConfig: DartCodeOutputConfig( - path: Uri.directory(join(rootDir, bindingTypeDir, 'dart_bindings')), + path: Uri.directory(join(rootDir, 'bindings')), ), ), classes: (generateFullVersion) @@ -88,6 +77,5 @@ Config getConfig({ } void main() async { - await generateJniBindings(getConfig(bindingsType: BindingsType.cBased)); - await generateJniBindings(getConfig(bindingsType: BindingsType.dartOnly)); + await generateJniBindings(getConfig()); } diff --git a/pkgs/jnigen/test/jackson_core_test/generated_files_test.dart b/pkgs/jnigen/test/jackson_core_test/generated_files_test.dart index cc53c8cf8..273232f7c 100644 --- a/pkgs/jnigen/test/jackson_core_test/generated_files_test.dart +++ b/pkgs/jnigen/test/jackson_core_test/generated_files_test.dart @@ -4,18 +4,15 @@ import 'package:test/test.dart'; -import 'package:jnigen/jnigen.dart'; - import '../test_util/test_util.dart'; import 'generate.dart'; void main() async { await checkLocallyBuiltDependencies(); - generateAndCompareBothModes( + generateAndCompare( 'Generate and compare bindings for jackson_core library', - getConfig(bindingsType: BindingsType.cBased), - getConfig(bindingsType: BindingsType.dartOnly), + getConfig(), ); test( 'generate and analyze bindings for complete library, ' @@ -28,10 +25,4 @@ void main() async { final config = getConfig(generateFullVersion: true, useAsm: true); await generateAndAnalyzeBindings(config); }, timeout: const Timeout(Duration(minutes: 2)), tags: largeTestTag); - - test('Generate and analyze pure dart bindings', () async { - final config = getConfig(generateFullVersion: true); - config.outputConfig.bindingsType = BindingsType.dartOnly; - await generateAndAnalyzeBindings(config); - }, timeout: const Timeout(Duration(minutes: 2)), tags: largeTestTag); } diff --git a/pkgs/jnigen/test/jackson_core_test/jnigen.yaml b/pkgs/jnigen/test/jackson_core_test/jnigen.yaml index cf3b4db15..66bd515ee 100644 --- a/pkgs/jnigen/test/jackson_core_test/jnigen.yaml +++ b/pkgs/jnigen/test/jackson_core_test/jnigen.yaml @@ -5,12 +5,8 @@ maven_downloads: jar_dir: third_party/jar/ output: - bindings_type: c_based - c: - library_name: jackson_core - path: third_party/c_based/c_bindings/ dart: - path: third_party/c_based/dart_bindings/ + path: third_party/bindings/ classes: - 'com.fasterxml.jackson.core.JsonFactory' diff --git a/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart b/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart index 28e6c2b6c..bfb09c1db 100644 --- a/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart @@ -7,7 +7,7 @@ import 'package:jni/jni.dart'; import '../test_util/callback_types.dart'; -import 'third_party/c_based/dart_bindings/com/fasterxml/jackson/core/_package.dart'; +import 'third_party/bindings/com/fasterxml/jackson/core/_package.dart'; // This file doesn't define main, because only one JVM has to be spawned with // all classpaths, it's managed at a different file which calls these tests. diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart similarity index 100% rename from pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart rename to pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart similarity index 100% rename from pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart rename to pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart similarity index 100% rename from pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart rename to pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/_package.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/_package.dart similarity index 100% rename from pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/_package.dart rename to pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/_package.dart diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/.clang-format b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/CMakeLists.txt b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/CMakeLists.txt deleted file mode 100644 index db216f524..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(jackson_core VERSION 0.0.1 LANGUAGES C) - -add_library(jackson_core SHARED - "./jackson_core.c" -) - -set_target_properties(jackson_core PROPERTIES - OUTPUT_NAME "jackson_core" -) - -target_compile_definitions(jackson_core PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(jackson_core log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(jackson_core ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/dartjni.h b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c deleted file mode 100644 index 5989a3f69..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c +++ /dev/null @@ -1,3744 +0,0 @@ -// Generated from jackson-core which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// See https://github.com/FasterXML/jackson-core/blob/2.14/LICENSE -// -// Copyright (c) 2007 - The Jackson Project Authors -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// com.fasterxml.jackson.core.JsonFactory$Feature -jclass _c_JsonFactory_Feature = NULL; - -jmethodID _m_JsonFactory_Feature__values = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__values() { - load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonFactory_Feature, &_m_JsonFactory_Feature__values, - "values", - "()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); - if (_m_JsonFactory_Feature__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonFactory_Feature, _m_JsonFactory_Feature__values); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory_Feature__valueOf = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__valueOf(jobject name) { - load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_JsonFactory_Feature, &_m_JsonFactory_Feature__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); - if (_m_JsonFactory_Feature__valueOf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonFactory_Feature, _m_JsonFactory_Feature__valueOf, name); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory_Feature__collectDefaults = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__collectDefaults() { - load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonFactory_Feature, - &_m_JsonFactory_Feature__collectDefaults, - "collectDefaults", "()I"); - if (_m_JsonFactory_Feature__collectDefaults == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod( - jniEnv, _c_JsonFactory_Feature, _m_JsonFactory_Feature__collectDefaults); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory_Feature__enabledByDefault = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__enabledByDefault(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory_Feature, &_m_JsonFactory_Feature__enabledByDefault, - "enabledByDefault", "()Z"); - if (_m_JsonFactory_Feature__enabledByDefault == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory_Feature__enabledByDefault); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory_Feature__enabledIn = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__enabledIn(jobject self_, int32_t flags) { - load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory_Feature, &_m_JsonFactory_Feature__enabledIn, - "enabledIn", "(I)Z"); - if (_m_JsonFactory_Feature__enabledIn == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory_Feature__enabledIn, flags); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory_Feature__getMask = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__getMask(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory_Feature, &_m_JsonFactory_Feature__getMask, - "getMask", "()I"); - if (_m_JsonFactory_Feature__getMask == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonFactory_Feature__getMask); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -// com.fasterxml.jackson.core.JsonFactory -jclass _c_JsonFactory = NULL; - -jmethodID _m_JsonFactory__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__new0() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__new0, "", "()V"); - if (_m_JsonFactory__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__new1(jobject oc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__new1, "", - "(Lcom/fasterxml/jackson/core/ObjectCodec;)V"); - if (_m_JsonFactory__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__new1, oc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__new2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__new2(jobject src, jobject codec) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__new2, "", - "(Lcom/fasterxml/jackson/core/JsonFactory;Lcom/fasterxml/jackson/" - "core/ObjectCodec;)V"); - if (_m_JsonFactory__new2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, - _m_JsonFactory__new2, src, codec); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__new3 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__new3(jobject b) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__new3, "", - "(Lcom/fasterxml/jackson/core/JsonFactoryBuilder;)V"); - if (_m_JsonFactory__new3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__new3, b); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__new4 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__new4(jobject b, uint8_t bogus) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__new4, "", - "(Lcom/fasterxml/jackson/core/TSFBuilder;Z)V"); - if (_m_JsonFactory__new4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, - _m_JsonFactory__new4, b, bogus); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__rebuild = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__rebuild(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__rebuild, "rebuild", - "()Lcom/fasterxml/jackson/core/TSFBuilder;"); - if (_m_JsonFactory__rebuild == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__rebuild); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__builder = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__builder() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonFactory, &_m_JsonFactory__builder, "builder", - "()Lcom/fasterxml/jackson/core/TSFBuilder;"); - if (_m_JsonFactory__builder == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_JsonFactory, - _m_JsonFactory__builder); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__copy = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__copy(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__copy, "copy", - "()Lcom/fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__copy == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__copy); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__readResolve = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__readResolve(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__readResolve, "readResolve", - "()Ljava/lang/Object;"); - if (_m_JsonFactory__readResolve == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__readResolve); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__requiresPropertyOrdering = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__requiresPropertyOrdering(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__requiresPropertyOrdering, - "requiresPropertyOrdering", "()Z"); - if (_m_JsonFactory__requiresPropertyOrdering == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory__requiresPropertyOrdering); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__canHandleBinaryNatively = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__canHandleBinaryNatively(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__canHandleBinaryNatively, - "canHandleBinaryNatively", "()Z"); - if (_m_JsonFactory__canHandleBinaryNatively == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory__canHandleBinaryNatively); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__canUseCharArrays = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__canUseCharArrays(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__canUseCharArrays, - "canUseCharArrays", "()Z"); - if (_m_JsonFactory__canUseCharArrays == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory__canUseCharArrays); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__canParseAsync = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__canParseAsync(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__canParseAsync, "canParseAsync", - "()Z"); - if (_m_JsonFactory__canParseAsync == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod(jniEnv, self_, - _m_JsonFactory__canParseAsync); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getFormatReadFeatureType = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getFormatReadFeatureType(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getFormatReadFeatureType, - "getFormatReadFeatureType", "()Ljava/lang/Class;"); - if (_m_JsonFactory__getFormatReadFeatureType == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__getFormatReadFeatureType); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__getFormatWriteFeatureType = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getFormatWriteFeatureType(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getFormatWriteFeatureType, - "getFormatWriteFeatureType", "()Ljava/lang/Class;"); - if (_m_JsonFactory__getFormatWriteFeatureType == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__getFormatWriteFeatureType); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__canUseSchema = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__canUseSchema(jobject self_, jobject schema) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__canUseSchema, "canUseSchema", - "(Lcom/fasterxml/jackson/core/FormatSchema;)Z"); - if (_m_JsonFactory__canUseSchema == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory__canUseSchema, schema); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getFormatName = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getFormatName(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getFormatName, "getFormatName", - "()Ljava/lang/String;"); - if (_m_JsonFactory__getFormatName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__getFormatName); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__hasFormat = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__hasFormat(jobject self_, jobject acc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__hasFormat, "hasFormat", - "(Lcom/fasterxml/jackson/core/format/InputAccessor;)Lcom/" - "fasterxml/jackson/core/format/MatchStrength;"); - if (_m_JsonFactory__hasFormat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonFactory__hasFormat, acc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__requiresCustomCodec = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__requiresCustomCodec(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__requiresCustomCodec, - "requiresCustomCodec", "()Z"); - if (_m_JsonFactory__requiresCustomCodec == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory__requiresCustomCodec); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__hasJSONFormat = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__hasJSONFormat(jobject self_, jobject acc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__hasJSONFormat, "hasJSONFormat", - "(Lcom/fasterxml/jackson/core/format/InputAccessor;)Lcom/" - "fasterxml/jackson/core/format/MatchStrength;"); - if (_m_JsonFactory__hasJSONFormat == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__hasJSONFormat, acc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__version = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__version(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__version, "version", - "()Lcom/fasterxml/jackson/core/Version;"); - if (_m_JsonFactory__version == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__version); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__configure = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__configure(jobject self_, jobject f, uint8_t state) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__configure, "configure", - "(Lcom/fasterxml/jackson/core/JsonFactory$Feature;Z)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__configure == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__configure, f, state); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__enable = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__enable(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__enable, "enable", - "(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__enable == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__enable, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__disable = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__disable(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__disable, "disable", - "(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__disable == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__disable, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__isEnabled = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__isEnabled(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__isEnabled, "isEnabled", - "(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Z"); - if (_m_JsonFactory__isEnabled == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonFactory__isEnabled, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getParserFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getParserFeatures(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getParserFeatures, - "getParserFeatures", "()I"); - if (_m_JsonFactory__getParserFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod(jniEnv, self_, - _m_JsonFactory__getParserFeatures); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getGeneratorFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getGeneratorFeatures(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getGeneratorFeatures, - "getGeneratorFeatures", "()I"); - if (_m_JsonFactory__getGeneratorFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonFactory__getGeneratorFeatures); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getFormatParserFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getFormatParserFeatures(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getFormatParserFeatures, - "getFormatParserFeatures", "()I"); - if (_m_JsonFactory__getFormatParserFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonFactory__getFormatParserFeatures); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getFormatGeneratorFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getFormatGeneratorFeatures(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getFormatGeneratorFeatures, - "getFormatGeneratorFeatures", "()I"); - if (_m_JsonFactory__getFormatGeneratorFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonFactory__getFormatGeneratorFeatures); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__configure1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__configure1(jobject self_, jobject f, uint8_t state) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__configure1, "configure", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__configure1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__configure1, f, state); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__enable1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__enable1(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__enable1, "enable", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/" - "jackson/core/JsonFactory;"); - if (_m_JsonFactory__enable1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__enable1, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__disable1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__disable1(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__disable1, "disable", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/" - "jackson/core/JsonFactory;"); - if (_m_JsonFactory__disable1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__disable1, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__isEnabled1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__isEnabled1(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__isEnabled1, "isEnabled", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Z"); - if (_m_JsonFactory__isEnabled1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod(jniEnv, self_, - _m_JsonFactory__isEnabled1, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__isEnabled2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__isEnabled2(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__isEnabled2, "isEnabled", - "(Lcom/fasterxml/jackson/core/StreamReadFeature;)Z"); - if (_m_JsonFactory__isEnabled2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod(jniEnv, self_, - _m_JsonFactory__isEnabled2, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getInputDecorator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getInputDecorator(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getInputDecorator, - "getInputDecorator", - "()Lcom/fasterxml/jackson/core/io/InputDecorator;"); - if (_m_JsonFactory__getInputDecorator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__getInputDecorator); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__setInputDecorator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__setInputDecorator(jobject self_, jobject d) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__setInputDecorator, - "setInputDecorator", - "(Lcom/fasterxml/jackson/core/io/InputDecorator;)Lcom/fasterxml/" - "jackson/core/JsonFactory;"); - if (_m_JsonFactory__setInputDecorator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__setInputDecorator, d); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__configure2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__configure2(jobject self_, jobject f, uint8_t state) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__configure2, "configure", - "(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;Z)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__configure2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__configure2, f, state); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__enable2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__enable2(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__enable2, "enable", - "(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__enable2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__enable2, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__disable2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__disable2(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__disable2, "disable", - "(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__disable2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__disable2, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__isEnabled3 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__isEnabled3(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__isEnabled3, "isEnabled", - "(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Z"); - if (_m_JsonFactory__isEnabled3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod(jniEnv, self_, - _m_JsonFactory__isEnabled3, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__isEnabled4 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__isEnabled4(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__isEnabled4, "isEnabled", - "(Lcom/fasterxml/jackson/core/StreamWriteFeature;)Z"); - if (_m_JsonFactory__isEnabled4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod(jniEnv, self_, - _m_JsonFactory__isEnabled4, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonFactory__getCharacterEscapes = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getCharacterEscapes(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getCharacterEscapes, - "getCharacterEscapes", - "()Lcom/fasterxml/jackson/core/io/CharacterEscapes;"); - if (_m_JsonFactory__getCharacterEscapes == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__getCharacterEscapes); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__setCharacterEscapes = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__setCharacterEscapes(jobject self_, jobject esc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__setCharacterEscapes, - "setCharacterEscapes", - "(Lcom/fasterxml/jackson/core/io/CharacterEscapes;)Lcom/" - "fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__setCharacterEscapes == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__setCharacterEscapes, esc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__getOutputDecorator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getOutputDecorator(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getOutputDecorator, - "getOutputDecorator", - "()Lcom/fasterxml/jackson/core/io/OutputDecorator;"); - if (_m_JsonFactory__getOutputDecorator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__getOutputDecorator); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__setOutputDecorator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__setOutputDecorator(jobject self_, jobject d) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__setOutputDecorator, - "setOutputDecorator", - "(Lcom/fasterxml/jackson/core/io/OutputDecorator;)Lcom/fasterxml/" - "jackson/core/JsonFactory;"); - if (_m_JsonFactory__setOutputDecorator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__setOutputDecorator, d); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__setRootValueSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__setRootValueSeparator(jobject self_, jobject sep) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__setRootValueSeparator, - "setRootValueSeparator", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory;"); - if (_m_JsonFactory__setRootValueSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__setRootValueSeparator, sep); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__getRootValueSeparator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getRootValueSeparator(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getRootValueSeparator, - "getRootValueSeparator", "()Ljava/lang/String;"); - if (_m_JsonFactory__getRootValueSeparator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__getRootValueSeparator); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__setCodec = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__setCodec(jobject self_, jobject oc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__setCodec, "setCodec", - "(Lcom/fasterxml/jackson/core/ObjectCodec;)Lcom/fasterxml/" - "jackson/core/JsonFactory;"); - if (_m_JsonFactory__setCodec == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__setCodec, oc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__getCodec = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__getCodec(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__getCodec, "getCodec", - "()Lcom/fasterxml/jackson/core/ObjectCodec;"); - if (_m_JsonFactory__getCodec == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonFactory__getCodec); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser, "createParser", - "(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser1(jobject self_, jobject url) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser1, "createParser", - "(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser1, url); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser2(jobject self_, jobject in) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser2, "createParser", - "(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser2, in); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser3 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser3(jobject self_, jobject r) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser3, "createParser", - "(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser3, r); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser4 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser4(jobject self_, jobject data) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser4, "createParser", - "([B)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser4, data); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser5 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser5(jobject self_, - jobject data, - int32_t offset, - int32_t len) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser5, "createParser", - "([BII)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser5 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser5, data, offset, len); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser6 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser6(jobject self_, jobject content) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser6, "createParser", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser6 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser6, content); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser7 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser7(jobject self_, jobject content) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser7, "createParser", - "([C)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser7 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser7, content); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser8 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser8(jobject self_, - jobject content, - int32_t offset, - int32_t len) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser8, "createParser", - "([CII)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser8 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser8, content, offset, len); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createParser9 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createParser9(jobject self_, jobject in) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createParser9, "createParser", - "(Ljava/io/DataInput;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createParser9 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createParser9, in); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createNonBlockingByteArrayParser = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createNonBlockingByteArrayParser(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createNonBlockingByteArrayParser, - "createNonBlockingByteArrayParser", - "()Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createNonBlockingByteArrayParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createNonBlockingByteArrayParser); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createGenerator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createGenerator(jobject self_, - jobject out, - jobject enc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createGenerator, - "createGenerator", - "(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/" - "JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createGenerator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createGenerator, out, enc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createGenerator1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createGenerator1(jobject self_, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonFactory, &_m_JsonFactory__createGenerator1, "createGenerator", - "(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createGenerator1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createGenerator1, out); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createGenerator2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createGenerator2(jobject self_, jobject w) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createGenerator2, - "createGenerator", - "(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createGenerator2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createGenerator2, w); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createGenerator3 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createGenerator3(jobject self_, jobject f, jobject enc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createGenerator3, - "createGenerator", - "(Ljava/io/File;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/" - "fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createGenerator3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createGenerator3, f, enc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createGenerator4 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createGenerator4(jobject self_, - jobject out, - jobject enc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createGenerator4, - "createGenerator", - "(Ljava/io/DataOutput;Lcom/fasterxml/jackson/core/" - "JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createGenerator4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createGenerator4, out, enc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createGenerator5 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createGenerator5(jobject self_, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonFactory, &_m_JsonFactory__createGenerator5, "createGenerator", - "(Ljava/io/DataOutput;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createGenerator5 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createGenerator5, out); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser, - "createJsonParser", - "(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser1(jobject self_, jobject url) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser1, - "createJsonParser", - "(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser1, url); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser2(jobject self_, jobject in) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser2, - "createJsonParser", - "(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser2, in); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser3 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser3(jobject self_, jobject r) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser3, - "createJsonParser", - "(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser3, r); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser4 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser4(jobject self_, jobject data) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser4, - "createJsonParser", - "([B)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser4, data); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser5 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser5(jobject self_, - jobject data, - int32_t offset, - int32_t len) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser5, - "createJsonParser", - "([BII)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser5 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser5, data, offset, len); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonParser6 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonParser6(jobject self_, jobject content) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonParser6, - "createJsonParser", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonFactory__createJsonParser6 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonParser6, content); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonGenerator = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonGenerator(jobject self_, - jobject out, - jobject enc) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonGenerator, - "createJsonGenerator", - "(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/" - "JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createJsonGenerator == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonGenerator, out, enc); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonGenerator1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonGenerator1(jobject self_, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__createJsonGenerator1, - "createJsonGenerator", - "(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createJsonGenerator1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonGenerator1, out); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonFactory__createJsonGenerator2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonFactory__createJsonGenerator2(jobject self_, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonFactory, &_m_JsonFactory__createJsonGenerator2, - "createJsonGenerator", - "(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;"); - if (_m_JsonFactory__createJsonGenerator2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonFactory__createJsonGenerator2, out); - return to_global_ref_result(_result); -} - -jfieldID _f_JsonFactory__FORMAT_NAME_JSON = NULL; -FFI_PLUGIN_EXPORT -JniResult get_JsonFactory__FORMAT_NAME_JSON() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_JsonFactory, &_f_JsonFactory__FORMAT_NAME_JSON, - "FORMAT_NAME_JSON", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_JsonFactory, _f_JsonFactory__FORMAT_NAME_JSON); - return to_global_ref_result(_result); -} - -jfieldID _f_JsonFactory__DEFAULT_FACTORY_FEATURE_FLAGS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_JsonFactory__DEFAULT_FACTORY_FEATURE_FLAGS() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_JsonFactory, - &_f_JsonFactory__DEFAULT_FACTORY_FEATURE_FLAGS, - "DEFAULT_FACTORY_FEATURE_FLAGS", "I"); - int32_t _result = (*jniEnv)->GetStaticIntField( - jniEnv, _c_JsonFactory, _f_JsonFactory__DEFAULT_FACTORY_FEATURE_FLAGS); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_JsonFactory__DEFAULT_PARSER_FEATURE_FLAGS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_JsonFactory__DEFAULT_PARSER_FEATURE_FLAGS() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_JsonFactory, - &_f_JsonFactory__DEFAULT_PARSER_FEATURE_FLAGS, - "DEFAULT_PARSER_FEATURE_FLAGS", "I"); - int32_t _result = (*jniEnv)->GetStaticIntField( - jniEnv, _c_JsonFactory, _f_JsonFactory__DEFAULT_PARSER_FEATURE_FLAGS); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_JsonFactory__DEFAULT_GENERATOR_FEATURE_FLAGS = NULL; -FFI_PLUGIN_EXPORT -JniResult get_JsonFactory__DEFAULT_GENERATOR_FEATURE_FLAGS() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_JsonFactory, - &_f_JsonFactory__DEFAULT_GENERATOR_FEATURE_FLAGS, - "DEFAULT_GENERATOR_FEATURE_FLAGS", "I"); - int32_t _result = (*jniEnv)->GetStaticIntField( - jniEnv, _c_JsonFactory, _f_JsonFactory__DEFAULT_GENERATOR_FEATURE_FLAGS); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jfieldID _f_JsonFactory__DEFAULT_ROOT_VALUE_SEPARATOR = NULL; -FFI_PLUGIN_EXPORT -JniResult get_JsonFactory__DEFAULT_ROOT_VALUE_SEPARATOR() { - load_env(); - load_class_global_ref(&_c_JsonFactory, - "com/fasterxml/jackson/core/JsonFactory"); - if (_c_JsonFactory == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_JsonFactory, - &_f_JsonFactory__DEFAULT_ROOT_VALUE_SEPARATOR, - "DEFAULT_ROOT_VALUE_SEPARATOR", - "Lcom/fasterxml/jackson/core/SerializableString;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_JsonFactory, _f_JsonFactory__DEFAULT_ROOT_VALUE_SEPARATOR); - return to_global_ref_result(_result); -} - -// com.fasterxml.jackson.core.JsonParser$Feature -jclass _c_JsonParser_Feature = NULL; - -jmethodID _m_JsonParser_Feature__values = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_Feature__values() { - load_env(); - load_class_global_ref(&_c_JsonParser_Feature, - "com/fasterxml/jackson/core/JsonParser$Feature"); - if (_c_JsonParser_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__values, - "values", - "()[Lcom/fasterxml/jackson/core/JsonParser$Feature;"); - if (_m_JsonParser_Feature__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonParser_Feature, _m_JsonParser_Feature__values); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser_Feature__valueOf = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_Feature__valueOf(jobject name) { - load_env(); - load_class_global_ref(&_c_JsonParser_Feature, - "com/fasterxml/jackson/core/JsonParser$Feature"); - if (_c_JsonParser_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_JsonParser_Feature, &_m_JsonParser_Feature__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$Feature;"); - if (_m_JsonParser_Feature__valueOf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonParser_Feature, _m_JsonParser_Feature__valueOf, name); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser_Feature__collectDefaults = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_Feature__collectDefaults() { - load_env(); - load_class_global_ref(&_c_JsonParser_Feature, - "com/fasterxml/jackson/core/JsonParser$Feature"); - if (_c_JsonParser_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonParser_Feature, - &_m_JsonParser_Feature__collectDefaults, "collectDefaults", - "()I"); - if (_m_JsonParser_Feature__collectDefaults == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod( - jniEnv, _c_JsonParser_Feature, _m_JsonParser_Feature__collectDefaults); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser_Feature__enabledByDefault = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_Feature__enabledByDefault(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser_Feature, - "com/fasterxml/jackson/core/JsonParser$Feature"); - if (_c_JsonParser_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__enabledByDefault, - "enabledByDefault", "()Z"); - if (_m_JsonParser_Feature__enabledByDefault == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser_Feature__enabledByDefault); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser_Feature__enabledIn = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_Feature__enabledIn(jobject self_, int32_t flags) { - load_env(); - load_class_global_ref(&_c_JsonParser_Feature, - "com/fasterxml/jackson/core/JsonParser$Feature"); - if (_c_JsonParser_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__enabledIn, - "enabledIn", "(I)Z"); - if (_m_JsonParser_Feature__enabledIn == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser_Feature__enabledIn, flags); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser_Feature__getMask = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_Feature__getMask(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser_Feature, - "com/fasterxml/jackson/core/JsonParser$Feature"); - if (_c_JsonParser_Feature == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__getMask, "getMask", - "()I"); - if (_m_JsonParser_Feature__getMask == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser_Feature__getMask); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -// com.fasterxml.jackson.core.JsonParser$NumberType -jclass _c_JsonParser_NumberType = NULL; - -jmethodID _m_JsonParser_NumberType__values = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_NumberType__values() { - load_env(); - load_class_global_ref(&_c_JsonParser_NumberType, - "com/fasterxml/jackson/core/JsonParser$NumberType"); - if (_c_JsonParser_NumberType == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonParser_NumberType, - &_m_JsonParser_NumberType__values, "values", - "()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); - if (_m_JsonParser_NumberType__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonParser_NumberType, _m_JsonParser_NumberType__values); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser_NumberType__valueOf = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser_NumberType__valueOf(jobject name) { - load_env(); - load_class_global_ref(&_c_JsonParser_NumberType, - "com/fasterxml/jackson/core/JsonParser$NumberType"); - if (_c_JsonParser_NumberType == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_JsonParser_NumberType, &_m_JsonParser_NumberType__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); - if (_m_JsonParser_NumberType__valueOf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonParser_NumberType, _m_JsonParser_NumberType__valueOf, - name); - return to_global_ref_result(_result); -} - -// com.fasterxml.jackson.core.JsonParser -jclass _c_JsonParser = NULL; - -jmethodID _m_JsonParser__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__new0() { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__new0, "", "()V"); - if (_m_JsonParser__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonParser, _m_JsonParser__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__new1(int32_t features) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__new1, "", "(I)V"); - if (_m_JsonParser__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_JsonParser, - _m_JsonParser__new1, features); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getCodec = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getCodec(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getCodec, "getCodec", - "()Lcom/fasterxml/jackson/core/ObjectCodec;"); - if (_m_JsonParser__getCodec == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getCodec); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__setCodec = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setCodec(jobject self_, jobject oc) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setCodec, "setCodec", - "(Lcom/fasterxml/jackson/core/ObjectCodec;)V"); - if (_m_JsonParser__setCodec == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__setCodec, oc); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getInputSource = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getInputSource(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getInputSource, "getInputSource", - "()Ljava/lang/Object;"); - if (_m_JsonParser__getInputSource == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getInputSource); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__setRequestPayloadOnError = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setRequestPayloadOnError(jobject self_, jobject payload) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setRequestPayloadOnError, - "setRequestPayloadOnError", - "(Lcom/fasterxml/jackson/core/util/RequestPayload;)V"); - if (_m_JsonParser__setRequestPayloadOnError == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_JsonParser__setRequestPayloadOnError, payload); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__setRequestPayloadOnError1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setRequestPayloadOnError1(jobject self_, - jobject payload, - jobject charset) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setRequestPayloadOnError1, - "setRequestPayloadOnError", "([BLjava/lang/String;)V"); - if (_m_JsonParser__setRequestPayloadOnError1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_JsonParser__setRequestPayloadOnError1, payload, - charset); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__setRequestPayloadOnError2 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setRequestPayloadOnError2(jobject self_, - jobject payload) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setRequestPayloadOnError2, - "setRequestPayloadOnError", "(Ljava/lang/String;)V"); - if (_m_JsonParser__setRequestPayloadOnError2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_JsonParser__setRequestPayloadOnError2, payload); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__setSchema = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setSchema(jobject self_, jobject schema) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setSchema, "setSchema", - "(Lcom/fasterxml/jackson/core/FormatSchema;)V"); - if (_m_JsonParser__setSchema == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__setSchema, schema); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getSchema = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getSchema(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getSchema, "getSchema", - "()Lcom/fasterxml/jackson/core/FormatSchema;"); - if (_m_JsonParser__getSchema == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getSchema); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__canUseSchema = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__canUseSchema(jobject self_, jobject schema) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__canUseSchema, "canUseSchema", - "(Lcom/fasterxml/jackson/core/FormatSchema;)Z"); - if (_m_JsonParser__canUseSchema == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__canUseSchema, schema); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__requiresCustomCodec = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__requiresCustomCodec(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__requiresCustomCodec, - "requiresCustomCodec", "()Z"); - if (_m_JsonParser__requiresCustomCodec == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__requiresCustomCodec); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__canParseAsync = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__canParseAsync(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__canParseAsync, "canParseAsync", - "()Z"); - if (_m_JsonParser__canParseAsync == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__canParseAsync); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getNonBlockingInputFeeder = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getNonBlockingInputFeeder(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getNonBlockingInputFeeder, - "getNonBlockingInputFeeder", - "()Lcom/fasterxml/jackson/core/async/NonBlockingInputFeeder;"); - if (_m_JsonParser__getNonBlockingInputFeeder == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getNonBlockingInputFeeder); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getReadCapabilities = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getReadCapabilities(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getReadCapabilities, - "getReadCapabilities", - "()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;"); - if (_m_JsonParser__getReadCapabilities == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getReadCapabilities); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__version = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__version(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__version, "version", - "()Lcom/fasterxml/jackson/core/Version;"); - if (_m_JsonParser__version == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__version); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__close = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__close(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__close, "close", "()V"); - if (_m_JsonParser__close == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__close); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__isClosed = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isClosed(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isClosed, "isClosed", "()Z"); - if (_m_JsonParser__isClosed == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__isClosed); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getParsingContext = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getParsingContext(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getParsingContext, - "getParsingContext", - "()Lcom/fasterxml/jackson/core/JsonStreamContext;"); - if (_m_JsonParser__getParsingContext == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getParsingContext); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__currentLocation = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__currentLocation(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__currentLocation, "currentLocation", - "()Lcom/fasterxml/jackson/core/JsonLocation;"); - if (_m_JsonParser__currentLocation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonParser__currentLocation); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__currentTokenLocation = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__currentTokenLocation(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__currentTokenLocation, - "currentTokenLocation", - "()Lcom/fasterxml/jackson/core/JsonLocation;"); - if (_m_JsonParser__currentTokenLocation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__currentTokenLocation); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getCurrentLocation = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getCurrentLocation(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getCurrentLocation, - "getCurrentLocation", - "()Lcom/fasterxml/jackson/core/JsonLocation;"); - if (_m_JsonParser__getCurrentLocation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getCurrentLocation); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getTokenLocation = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getTokenLocation(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getTokenLocation, - "getTokenLocation", - "()Lcom/fasterxml/jackson/core/JsonLocation;"); - if (_m_JsonParser__getTokenLocation == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getTokenLocation); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__currentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__currentValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__currentValue, "currentValue", - "()Ljava/lang/Object;"); - if (_m_JsonParser__currentValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__currentValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__assignCurrentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__assignCurrentValue(jobject self_, jobject v) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__assignCurrentValue, - "assignCurrentValue", "(Ljava/lang/Object;)V"); - if (_m_JsonParser__assignCurrentValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__assignCurrentValue, - v); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getCurrentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getCurrentValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getCurrentValue, "getCurrentValue", - "()Ljava/lang/Object;"); - if (_m_JsonParser__getCurrentValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonParser__getCurrentValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__setCurrentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setCurrentValue(jobject self_, jobject v) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setCurrentValue, "setCurrentValue", - "(Ljava/lang/Object;)V"); - if (_m_JsonParser__setCurrentValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__setCurrentValue, v); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__releaseBuffered = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__releaseBuffered(jobject self_, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__releaseBuffered, "releaseBuffered", - "(Ljava/io/OutputStream;)I"); - if (_m_JsonParser__releaseBuffered == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonParser__releaseBuffered, out); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__releaseBuffered1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__releaseBuffered1(jobject self_, jobject w) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__releaseBuffered1, - "releaseBuffered", "(Ljava/io/Writer;)I"); - if (_m_JsonParser__releaseBuffered1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonParser__releaseBuffered1, w); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__enable = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__enable(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__enable, "enable", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/" - "jackson/core/JsonParser;"); - if (_m_JsonParser__enable == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__enable, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__disable = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__disable(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__disable, "disable", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/" - "jackson/core/JsonParser;"); - if (_m_JsonParser__disable == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__disable, f); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__configure = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__configure(jobject self_, jobject f, uint8_t state) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__configure, "configure", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/" - "fasterxml/jackson/core/JsonParser;"); - if (_m_JsonParser__configure == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__configure, f, state); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__isEnabled = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isEnabled(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isEnabled, "isEnabled", - "(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Z"); - if (_m_JsonParser__isEnabled == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__isEnabled, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__isEnabled1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isEnabled1(jobject self_, jobject f) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isEnabled1, "isEnabled", - "(Lcom/fasterxml/jackson/core/StreamReadFeature;)Z"); - if (_m_JsonParser__isEnabled1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__isEnabled1, f); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getFeatureMask = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getFeatureMask(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getFeatureMask, "getFeatureMask", - "()I"); - if (_m_JsonParser__getFeatureMask == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getFeatureMask); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__setFeatureMask = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__setFeatureMask(jobject self_, int32_t mask) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__setFeatureMask, "setFeatureMask", - "(I)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonParser__setFeatureMask == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__setFeatureMask, mask); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__overrideStdFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__overrideStdFeatures(jobject self_, - int32_t values, - int32_t mask) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__overrideStdFeatures, - "overrideStdFeatures", - "(II)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonParser__overrideStdFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__overrideStdFeatures, values, mask); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getFormatFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getFormatFeatures(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getFormatFeatures, - "getFormatFeatures", "()I"); - if (_m_JsonParser__getFormatFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getFormatFeatures); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__overrideFormatFeatures = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__overrideFormatFeatures(jobject self_, - int32_t values, - int32_t mask) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__overrideFormatFeatures, - "overrideFormatFeatures", - "(II)Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonParser__overrideFormatFeatures == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__overrideFormatFeatures, values, mask); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__nextToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextToken, "nextToken", - "()Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonParser__nextToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__nextToken); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__nextValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextValue, "nextValue", - "()Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonParser__nextValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__nextValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__nextFieldName = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextFieldName(jobject self_, jobject str) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextFieldName, "nextFieldName", - "(Lcom/fasterxml/jackson/core/SerializableString;)Z"); - if (_m_JsonParser__nextFieldName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__nextFieldName, str); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__nextFieldName1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextFieldName1(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextFieldName1, "nextFieldName", - "()Ljava/lang/String;"); - if (_m_JsonParser__nextFieldName1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__nextFieldName1); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__nextTextValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextTextValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextTextValue, "nextTextValue", - "()Ljava/lang/String;"); - if (_m_JsonParser__nextTextValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__nextTextValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__nextIntValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextIntValue(jobject self_, int32_t defaultValue) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextIntValue, "nextIntValue", - "(I)I"); - if (_m_JsonParser__nextIntValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonParser__nextIntValue, defaultValue); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__nextLongValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextLongValue(jobject self_, int64_t defaultValue) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextLongValue, "nextLongValue", - "(J)J"); - if (_m_JsonParser__nextLongValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_JsonParser__nextLongValue, defaultValue); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__nextBooleanValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__nextBooleanValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__nextBooleanValue, - "nextBooleanValue", "()Ljava/lang/Boolean;"); - if (_m_JsonParser__nextBooleanValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__nextBooleanValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__skipChildren = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__skipChildren(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__skipChildren, "skipChildren", - "()Lcom/fasterxml/jackson/core/JsonParser;"); - if (_m_JsonParser__skipChildren == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__skipChildren); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__finishToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__finishToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__finishToken, "finishToken", "()V"); - if (_m_JsonParser__finishToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__finishToken); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__currentToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__currentToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__currentToken, "currentToken", - "()Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonParser__currentToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__currentToken); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__currentTokenId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__currentTokenId(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__currentTokenId, "currentTokenId", - "()I"); - if (_m_JsonParser__currentTokenId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__currentTokenId); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getCurrentToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getCurrentToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getCurrentToken, "getCurrentToken", - "()Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonParser__getCurrentToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonParser__getCurrentToken); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getCurrentTokenId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getCurrentTokenId(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getCurrentTokenId, - "getCurrentTokenId", "()I"); - if (_m_JsonParser__getCurrentTokenId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getCurrentTokenId); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__hasCurrentToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__hasCurrentToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__hasCurrentToken, "hasCurrentToken", - "()Z"); - if (_m_JsonParser__hasCurrentToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__hasCurrentToken); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__hasTokenId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__hasTokenId(jobject self_, int32_t id) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__hasTokenId, "hasTokenId", "(I)Z"); - if (_m_JsonParser__hasTokenId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod(jniEnv, self_, - _m_JsonParser__hasTokenId, id); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__hasToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__hasToken(jobject self_, jobject t) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__hasToken, "hasToken", - "(Lcom/fasterxml/jackson/core/JsonToken;)Z"); - if (_m_JsonParser__hasToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__hasToken, t); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__isExpectedStartArrayToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isExpectedStartArrayToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isExpectedStartArrayToken, - "isExpectedStartArrayToken", "()Z"); - if (_m_JsonParser__isExpectedStartArrayToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__isExpectedStartArrayToken); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__isExpectedStartObjectToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isExpectedStartObjectToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isExpectedStartObjectToken, - "isExpectedStartObjectToken", "()Z"); - if (_m_JsonParser__isExpectedStartObjectToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__isExpectedStartObjectToken); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__isExpectedNumberIntToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isExpectedNumberIntToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isExpectedNumberIntToken, - "isExpectedNumberIntToken", "()Z"); - if (_m_JsonParser__isExpectedNumberIntToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__isExpectedNumberIntToken); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__isNaN = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__isNaN(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__isNaN, "isNaN", "()Z"); - if (_m_JsonParser__isNaN == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__isNaN); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__clearCurrentToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__clearCurrentToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__clearCurrentToken, - "clearCurrentToken", "()V"); - if (_m_JsonParser__clearCurrentToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__clearCurrentToken); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getLastClearedToken = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getLastClearedToken(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getLastClearedToken, - "getLastClearedToken", - "()Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonParser__getLastClearedToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getLastClearedToken); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__overrideCurrentName = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__overrideCurrentName(jobject self_, jobject name) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__overrideCurrentName, - "overrideCurrentName", "(Ljava/lang/String;)V"); - if (_m_JsonParser__overrideCurrentName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_JsonParser__overrideCurrentName, - name); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getCurrentName = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getCurrentName(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getCurrentName, "getCurrentName", - "()Ljava/lang/String;"); - if (_m_JsonParser__getCurrentName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getCurrentName); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__currentName = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__currentName(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__currentName, "currentName", - "()Ljava/lang/String;"); - if (_m_JsonParser__currentName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__currentName); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getText = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getText(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getText, "getText", - "()Ljava/lang/String;"); - if (_m_JsonParser__getText == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getText); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getText1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getText1(jobject self_, jobject writer) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getText1, "getText", - "(Ljava/io/Writer;)I"); - if (_m_JsonParser__getText1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getText1, writer); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getTextCharacters = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getTextCharacters(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getTextCharacters, - "getTextCharacters", "()[C"); - if (_m_JsonParser__getTextCharacters == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getTextCharacters); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getTextLength = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getTextLength(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getTextLength, "getTextLength", - "()I"); - if (_m_JsonParser__getTextLength == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getTextLength); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getTextOffset = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getTextOffset(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getTextOffset, "getTextOffset", - "()I"); - if (_m_JsonParser__getTextOffset == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getTextOffset); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__hasTextCharacters = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__hasTextCharacters(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__hasTextCharacters, - "hasTextCharacters", "()Z"); - if (_m_JsonParser__hasTextCharacters == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__hasTextCharacters); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getNumberValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getNumberValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getNumberValue, "getNumberValue", - "()Ljava/lang/Number;"); - if (_m_JsonParser__getNumberValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getNumberValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getNumberValueExact = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getNumberValueExact(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getNumberValueExact, - "getNumberValueExact", "()Ljava/lang/Number;"); - if (_m_JsonParser__getNumberValueExact == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getNumberValueExact); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getNumberType = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getNumberType(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getNumberType, "getNumberType", - "()Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); - if (_m_JsonParser__getNumberType == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getNumberType); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getByteValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getByteValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getByteValue, "getByteValue", - "()B"); - if (_m_JsonParser__getByteValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int8_t _result = - (*jniEnv)->CallByteMethod(jniEnv, self_, _m_JsonParser__getByteValue); - return (JniResult){.value = {.b = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getShortValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getShortValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getShortValue, "getShortValue", - "()S"); - if (_m_JsonParser__getShortValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int16_t _result = - (*jniEnv)->CallShortMethod(jniEnv, self_, _m_JsonParser__getShortValue); - return (JniResult){.value = {.s = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getIntValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getIntValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getIntValue, "getIntValue", "()I"); - if (_m_JsonParser__getIntValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getIntValue); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getLongValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getLongValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getLongValue, "getLongValue", - "()J"); - if (_m_JsonParser__getLongValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = - (*jniEnv)->CallLongMethod(jniEnv, self_, _m_JsonParser__getLongValue); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getBigIntegerValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getBigIntegerValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getBigIntegerValue, - "getBigIntegerValue", "()Ljava/math/BigInteger;"); - if (_m_JsonParser__getBigIntegerValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getBigIntegerValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getFloatValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getFloatValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getFloatValue, "getFloatValue", - "()F"); - if (_m_JsonParser__getFloatValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - float _result = - (*jniEnv)->CallFloatMethod(jniEnv, self_, _m_JsonParser__getFloatValue); - return (JniResult){.value = {.f = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getDoubleValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getDoubleValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getDoubleValue, "getDoubleValue", - "()D"); - if (_m_JsonParser__getDoubleValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - double _result = - (*jniEnv)->CallDoubleMethod(jniEnv, self_, _m_JsonParser__getDoubleValue); - return (JniResult){.value = {.d = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getDecimalValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getDecimalValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getDecimalValue, "getDecimalValue", - "()Ljava/math/BigDecimal;"); - if (_m_JsonParser__getDecimalValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonParser__getDecimalValue); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getBooleanValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getBooleanValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getBooleanValue, "getBooleanValue", - "()Z"); - if (_m_JsonParser__getBooleanValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__getBooleanValue); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getEmbeddedObject = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getEmbeddedObject(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getEmbeddedObject, - "getEmbeddedObject", "()Ljava/lang/Object;"); - if (_m_JsonParser__getEmbeddedObject == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getEmbeddedObject); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getBinaryValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getBinaryValue(jobject self_, jobject bv) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getBinaryValue, "getBinaryValue", - "(Lcom/fasterxml/jackson/core/Base64Variant;)[B"); - if (_m_JsonParser__getBinaryValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getBinaryValue, bv); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getBinaryValue1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getBinaryValue1(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getBinaryValue1, "getBinaryValue", - "()[B"); - if (_m_JsonParser__getBinaryValue1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonParser__getBinaryValue1); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__readBinaryValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readBinaryValue(jobject self_, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__readBinaryValue, "readBinaryValue", - "(Ljava/io/OutputStream;)I"); - if (_m_JsonParser__readBinaryValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonParser__readBinaryValue, out); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__readBinaryValue1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readBinaryValue1(jobject self_, jobject bv, jobject out) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonParser, &_m_JsonParser__readBinaryValue1, "readBinaryValue", - "(Lcom/fasterxml/jackson/core/Base64Variant;Ljava/io/OutputStream;)I"); - if (_m_JsonParser__readBinaryValue1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonParser__readBinaryValue1, bv, out); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsInt = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsInt(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsInt, "getValueAsInt", - "()I"); - if (_m_JsonParser__getValueAsInt == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonParser__getValueAsInt); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsInt1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsInt1(jobject self_, int32_t def) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsInt1, "getValueAsInt", - "(I)I"); - if (_m_JsonParser__getValueAsInt1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_JsonParser__getValueAsInt1, def); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsLong = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsLong(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsLong, "getValueAsLong", - "()J"); - if (_m_JsonParser__getValueAsLong == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = - (*jniEnv)->CallLongMethod(jniEnv, self_, _m_JsonParser__getValueAsLong); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsLong1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsLong1(jobject self_, int64_t def) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsLong1, "getValueAsLong", - "(J)J"); - if (_m_JsonParser__getValueAsLong1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_JsonParser__getValueAsLong1, def); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsDouble = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsDouble(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsDouble, - "getValueAsDouble", "()D"); - if (_m_JsonParser__getValueAsDouble == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - double _result = (*jniEnv)->CallDoubleMethod(jniEnv, self_, - _m_JsonParser__getValueAsDouble); - return (JniResult){.value = {.d = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsDouble1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsDouble1(jobject self_, double def) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsDouble1, - "getValueAsDouble", "(D)D"); - if (_m_JsonParser__getValueAsDouble1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - double _result = (*jniEnv)->CallDoubleMethod( - jniEnv, self_, _m_JsonParser__getValueAsDouble1, def); - return (JniResult){.value = {.d = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsBoolean = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsBoolean(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsBoolean, - "getValueAsBoolean", "()Z"); - if (_m_JsonParser__getValueAsBoolean == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__getValueAsBoolean); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsBoolean1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsBoolean1(jobject self_, uint8_t def) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsBoolean1, - "getValueAsBoolean", "(Z)Z"); - if (_m_JsonParser__getValueAsBoolean1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__getValueAsBoolean1, def); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getValueAsString = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsString(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsString, - "getValueAsString", "()Ljava/lang/String;"); - if (_m_JsonParser__getValueAsString == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getValueAsString); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getValueAsString1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getValueAsString1(jobject self_, jobject def) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getValueAsString1, - "getValueAsString", "(Ljava/lang/String;)Ljava/lang/String;"); - if (_m_JsonParser__getValueAsString1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__getValueAsString1, def); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__canReadObjectId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__canReadObjectId(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__canReadObjectId, "canReadObjectId", - "()Z"); - if (_m_JsonParser__canReadObjectId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonParser__canReadObjectId); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__canReadTypeId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__canReadTypeId(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__canReadTypeId, "canReadTypeId", - "()Z"); - if (_m_JsonParser__canReadTypeId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonParser__canReadTypeId); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonParser__getObjectId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getObjectId(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getObjectId, "getObjectId", - "()Ljava/lang/Object;"); - if (_m_JsonParser__getObjectId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getObjectId); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__getTypeId = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__getTypeId(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__getTypeId, "getTypeId", - "()Ljava/lang/Object;"); - if (_m_JsonParser__getTypeId == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonParser__getTypeId); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__readValueAs = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readValueAs(jobject self_, jobject valueType) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__readValueAs, "readValueAs", - "(Ljava/lang/Class;)Ljava/lang/Object;"); - if (_m_JsonParser__readValueAs == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__readValueAs, valueType); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__readValueAs1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readValueAs1(jobject self_, jobject valueTypeRef) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonParser, &_m_JsonParser__readValueAs1, "readValueAs", - "(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/lang/Object;"); - if (_m_JsonParser__readValueAs1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__readValueAs1, valueTypeRef); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__readValuesAs = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readValuesAs(jobject self_, jobject valueType) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__readValuesAs, "readValuesAs", - "(Ljava/lang/Class;)Ljava/util/Iterator;"); - if (_m_JsonParser__readValuesAs == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__readValuesAs, valueType); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__readValuesAs1 = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readValuesAs1(jobject self_, jobject valueTypeRef) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonParser, &_m_JsonParser__readValuesAs1, "readValuesAs", - "(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/util/Iterator;"); - if (_m_JsonParser__readValuesAs1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_JsonParser__readValuesAs1, valueTypeRef); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonParser__readValueAsTree = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonParser__readValueAsTree(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__readValueAsTree, "readValueAsTree", - "()Lcom/fasterxml/jackson/core/TreeNode;"); - if (_m_JsonParser__readValueAsTree == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_JsonParser__readValueAsTree); - return to_global_ref_result(_result); -} - -jfieldID _f_JsonParser__DEFAULT_READ_CAPABILITIES = NULL; -FFI_PLUGIN_EXPORT -JniResult get_JsonParser__DEFAULT_READ_CAPABILITIES() { - load_env(); - load_class_global_ref(&_c_JsonParser, - "com/fasterxml/jackson/core/JsonParser"); - if (_c_JsonParser == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_JsonParser, &_f_JsonParser__DEFAULT_READ_CAPABILITIES, - "DEFAULT_READ_CAPABILITIES", - "Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_JsonParser, _f_JsonParser__DEFAULT_READ_CAPABILITIES); - return to_global_ref_result(_result); -} - -// com.fasterxml.jackson.core.JsonToken -jclass _c_JsonToken = NULL; - -jmethodID _m_JsonToken__values = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__values() { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonToken, &_m_JsonToken__values, "values", - "()[Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonToken__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_JsonToken, - _m_JsonToken__values); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonToken__valueOf = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__valueOf(jobject name) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_JsonToken, &_m_JsonToken__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonToken;"); - if (_m_JsonToken__valueOf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonToken, _m_JsonToken__valueOf, name); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonToken__id = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__id(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__id, "id", "()I"); - if (_m_JsonToken__id == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod(jniEnv, self_, _m_JsonToken__id); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonToken__asString = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__asString(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__asString, "asString", - "()Ljava/lang/String;"); - if (_m_JsonToken__asString == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonToken__asString); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonToken__asCharArray = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__asCharArray(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__asCharArray, "asCharArray", "()[C"); - if (_m_JsonToken__asCharArray == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonToken__asCharArray); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonToken__asByteArray = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__asByteArray(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__asByteArray, "asByteArray", "()[B"); - if (_m_JsonToken__asByteArray == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonToken__asByteArray); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonToken__isNumeric = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__isNumeric(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__isNumeric, "isNumeric", "()Z"); - if (_m_JsonToken__isNumeric == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonToken__isNumeric); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonToken__isStructStart = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__isStructStart(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__isStructStart, "isStructStart", - "()Z"); - if (_m_JsonToken__isStructStart == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonToken__isStructStart); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonToken__isStructEnd = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__isStructEnd(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__isStructEnd, "isStructEnd", "()Z"); - if (_m_JsonToken__isStructEnd == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonToken__isStructEnd); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonToken__isScalarValue = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__isScalarValue(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__isScalarValue, "isScalarValue", - "()Z"); - if (_m_JsonToken__isScalarValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonToken__isScalarValue); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_JsonToken__isBoolean = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonToken__isBoolean(jobject self_) { - load_env(); - load_class_global_ref(&_c_JsonToken, "com/fasterxml/jackson/core/JsonToken"); - if (_c_JsonToken == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonToken, &_m_JsonToken__isBoolean, "isBoolean", "()Z"); - if (_m_JsonToken__isBoolean == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_JsonToken__isBoolean); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/_init.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/_init.dart deleted file mode 100644 index 8018e7d3c..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/_init.dart +++ /dev/null @@ -1,24 +0,0 @@ -// Generated from jackson-core which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// See https://github.com/FasterXML/jackson-core/blob/2.14/LICENSE -// -// Copyright (c) 2007 - The Jackson Project Authors -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; - -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("jackson_core"); diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart deleted file mode 100644 index 49c8a125b..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ /dev/null @@ -1,2109 +0,0 @@ -// Generated from jackson-core which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// See https://github.com/FasterXML/jackson-core/blob/2.14/LICENSE -// -// Copyright (c) 2007 - The Jackson Project Authors -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Autogenerated by jnigen. DO NOT EDIT! - -// ignore_for_file: annotate_overrides -// ignore_for_file: camel_case_extensions -// ignore_for_file: camel_case_types -// ignore_for_file: constant_identifier_names -// ignore_for_file: doc_directive_unknown -// ignore_for_file: file_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: overridden_fields -// ignore_for_file: unnecessary_cast -// ignore_for_file: unused_element -// ignore_for_file: unused_field -// ignore_for_file: unused_import -// ignore_for_file: unused_local_variable -// ignore_for_file: unused_shown_name -// ignore_for_file: use_super_parameters - -import "dart:isolate" show ReceivePort; -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; -import "package:jni/jni.dart" as jni; - -import "JsonParser.dart" as jsonparser_; -import "../../../../_init.dart"; - -/// from: com.fasterxml.jackson.core.JsonFactory$Feature -/// -/// Enumeration that defines all on/off features that can only be -/// changed for JsonFactory. -class JsonFactory_Feature extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonFactory_Feature.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonFactory_FeatureType(); - static final _values = - jniLookup>( - "JsonFactory_Feature__values") - .asFunction(); - - /// from: static public com.fasterxml.jackson.core.JsonFactory.Feature[] values() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values().object(const jni.JArrayType($JsonFactory_FeatureType())); - } - - static final _valueOf = jniLookup< - ffi - .NativeFunction)>>( - "JsonFactory_Feature__valueOf") - .asFunction)>(); - - /// from: static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name) - /// The returned object must be released after use, by calling the [release] method. - static JsonFactory_Feature valueOf( - jni.JString name, - ) { - return _valueOf(name.reference.pointer) - .object(const $JsonFactory_FeatureType()); - } - - static final _collectDefaults = - jniLookup>( - "JsonFactory_Feature__collectDefaults") - .asFunction(); - - /// from: static public int collectDefaults() - /// - /// Method that calculates bit set (flags) of all features that - /// are enabled by default. - ///@return Bit field of features enabled by default - static int collectDefaults() { - return _collectDefaults().integer; - } - - static final _enabledByDefault = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory_Feature__enabledByDefault") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean enabledByDefault() - bool enabledByDefault() { - return _enabledByDefault(reference.pointer).boolean; - } - - static final _enabledIn = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("JsonFactory_Feature__enabledIn") - .asFunction, int)>(); - - /// from: public boolean enabledIn(int flags) - bool enabledIn( - int flags, - ) { - return _enabledIn(reference.pointer, flags).boolean; - } - - static final _getMask = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory_Feature__getMask") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getMask() - int getMask() { - return _getMask(reference.pointer).integer; - } -} - -final class $JsonFactory_FeatureType extends jni.JObjType { - const $JsonFactory_FeatureType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonFactory$Feature;"; - - @override - JsonFactory_Feature fromReference(jni.JReference reference) => - JsonFactory_Feature.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonFactory_FeatureType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonFactory_FeatureType) && - other is $JsonFactory_FeatureType; - } -} - -/// from: com.fasterxml.jackson.core.JsonFactory -/// -/// The main factory class of Jackson package, used to configure and -/// construct reader (aka parser, JsonParser) -/// and writer (aka generator, JsonGenerator) -/// instances. -/// -/// Factory instances are thread-safe and reusable after configuration -/// (if any). Typically applications and services use only a single -/// globally shared factory instance, unless they need differently -/// configured factories. Factory reuse is important if efficiency matters; -/// most recycling of expensive construct is done on per-factory basis. -/// -/// Creation of a factory instance is a light-weight operation, -/// and since there is no need for pluggable alternative implementations -/// (as there is no "standard" JSON processor API to implement), -/// the default constructor is used for constructing factory -/// instances. -///@author Tatu Saloranta -class JsonFactory extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonFactory.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonFactoryType(); - static final _get_FORMAT_NAME_JSON = - jniLookup>( - "get_JsonFactory__FORMAT_NAME_JSON") - .asFunction(); - - /// from: static public final java.lang.String FORMAT_NAME_JSON - /// The returned object must be released after use, by calling the [release] method. - /// - /// Name used to identify JSON format - /// (and returned by \#getFormatName() - static jni.JString get FORMAT_NAME_JSON => - _get_FORMAT_NAME_JSON().object(const jni.JStringType()); - - static final _get_DEFAULT_FACTORY_FEATURE_FLAGS = - jniLookup>( - "get_JsonFactory__DEFAULT_FACTORY_FEATURE_FLAGS") - .asFunction(); - - /// from: static protected final int DEFAULT_FACTORY_FEATURE_FLAGS - /// - /// Bitfield (set of flags) of all factory features that are enabled by default. - static int get DEFAULT_FACTORY_FEATURE_FLAGS => - _get_DEFAULT_FACTORY_FEATURE_FLAGS().integer; - - static final _get_DEFAULT_PARSER_FEATURE_FLAGS = - jniLookup>( - "get_JsonFactory__DEFAULT_PARSER_FEATURE_FLAGS") - .asFunction(); - - /// from: static protected final int DEFAULT_PARSER_FEATURE_FLAGS - /// - /// Bitfield (set of flags) of all parser features that are enabled - /// by default. - static int get DEFAULT_PARSER_FEATURE_FLAGS => - _get_DEFAULT_PARSER_FEATURE_FLAGS().integer; - - static final _get_DEFAULT_GENERATOR_FEATURE_FLAGS = - jniLookup>( - "get_JsonFactory__DEFAULT_GENERATOR_FEATURE_FLAGS") - .asFunction(); - - /// from: static protected final int DEFAULT_GENERATOR_FEATURE_FLAGS - /// - /// Bitfield (set of flags) of all generator features that are enabled - /// by default. - static int get DEFAULT_GENERATOR_FEATURE_FLAGS => - _get_DEFAULT_GENERATOR_FEATURE_FLAGS().integer; - - static final _get_DEFAULT_ROOT_VALUE_SEPARATOR = - jniLookup>( - "get_JsonFactory__DEFAULT_ROOT_VALUE_SEPARATOR") - .asFunction(); - - /// from: static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR - /// The returned object must be released after use, by calling the [release] method. - static jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => - _get_DEFAULT_ROOT_VALUE_SEPARATOR().object(const jni.JObjectType()); - - static final _new0 = jniLookup>( - "JsonFactory__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - /// - /// Default constructor used to create factory instances. - /// Creation of a factory instance is a light-weight operation, - /// but it is still a good idea to reuse limited number of - /// factory instances (and quite often just a single instance): - /// factories are used as context for storing some reused - /// processing objects (such as symbol tables parsers use) - /// and this reuse only works within context of a single - /// factory instance. - factory JsonFactory() { - return JsonFactory.fromReference(_new0().reference); - } - - static final _new1 = jniLookup< - ffi - .NativeFunction)>>( - "JsonFactory__new1") - .asFunction)>(); - - /// from: public void (com.fasterxml.jackson.core.ObjectCodec oc) - /// The returned object must be released after use, by calling the [release] method. - factory JsonFactory.new1( - jni.JObject oc, - ) { - return JsonFactory.fromReference(_new1(oc.reference.pointer).reference); - } - - static final _new2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__new2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: protected void (com.fasterxml.jackson.core.JsonFactory src, com.fasterxml.jackson.core.ObjectCodec codec) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Constructor used when copy()ing a factory instance. - ///@param src Original factory to copy settings from - ///@param codec Databinding-level codec to use, if any - ///@since 2.2.1 - factory JsonFactory.new2( - JsonFactory src, - jni.JObject codec, - ) { - return JsonFactory.fromReference( - _new2(src.reference.pointer, codec.reference.pointer).reference); - } - - static final _new3 = jniLookup< - ffi - .NativeFunction)>>( - "JsonFactory__new3") - .asFunction)>(); - - /// from: public void (com.fasterxml.jackson.core.JsonFactoryBuilder b) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Constructor used by JsonFactoryBuilder for instantiation. - ///@param b Builder that contains settings to use - ///@since 2.10 - factory JsonFactory.new3( - jni.JObject b, - ) { - return JsonFactory.fromReference(_new3(b.reference.pointer).reference); - } - - static final _new4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Uint8)>>("JsonFactory__new4") - .asFunction, int)>(); - - /// from: protected void (com.fasterxml.jackson.core.TSFBuilder b, boolean bogus) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Constructor for subtypes; needed to work around the fact that before 3.0, - /// this factory has cumbersome dual role as generic type as well as actual - /// implementation for json. - ///@param b Builder that contains settings to use - ///@param bogus Argument only needed to separate constructor signature; ignored - factory JsonFactory.new4( - jni.JObject b, - bool bogus, - ) { - return JsonFactory.fromReference( - _new4(b.reference.pointer, bogus ? 1 : 0).reference); - } - - static final _rebuild = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__rebuild") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.TSFBuilder rebuild() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that allows construction of differently configured factory, starting - /// with settings of this factory. - ///@return Builder instance to use - ///@since 2.10 - jni.JObject rebuild() { - return _rebuild(reference.pointer).object(const jni.JObjectType()); - } - - static final _builder = - jniLookup>( - "JsonFactory__builder") - .asFunction(); - - /// from: static public com.fasterxml.jackson.core.TSFBuilder builder() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Main factory method to use for constructing JsonFactory instances with - /// different configuration: creates and returns a builder for collecting configuration - /// settings; instance created by calling {@code build()} after all configuration - /// set. - /// - /// NOTE: signature unfortunately does not expose true implementation type; this - /// will be fixed in 3.0. - ///@return Builder instance to use - static jni.JObject builder() { - return _builder().object(const jni.JObjectType()); - } - - static final _copy = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__copy") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory copy() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing a new JsonFactory that has - /// the same settings as this instance, but is otherwise - /// independent (i.e. nothing is actually shared, symbol tables - /// are separate). - /// Note that ObjectCodec reference is not copied but is - /// set to null; caller typically needs to set it after calling - /// this method. Reason for this is that the codec is used for - /// callbacks, and assumption is that there is strict 1-to-1 - /// mapping between codec, factory. Caller has to, then, explicitly - /// set codec after making the copy. - ///@return Copy of this factory instance - ///@since 2.1 - JsonFactory copy() { - return _copy(reference.pointer).object(const $JsonFactoryType()); - } - - static final _readResolve = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__readResolve") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: protected java.lang.Object readResolve() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that we need to override to actually make restoration go - /// through constructors etc: needed to allow JDK serializability of - /// factory instances. - /// - /// Note: must be overridden by sub-classes as well. - ///@return Newly constructed instance - jni.JObject readResolve() { - return _readResolve(reference.pointer).object(const jni.JObjectType()); - } - - static final _requiresPropertyOrdering = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__requiresPropertyOrdering") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean requiresPropertyOrdering() - /// - /// Introspection method that higher-level functionality may call - /// to see whether underlying data format requires a stable ordering - /// of object properties or not. - /// This is usually used for determining - /// whether to force a stable ordering (like alphabetic ordering by name) - /// if no ordering if explicitly specified. - /// - /// Default implementation returns false as JSON does NOT - /// require stable ordering. Formats that require ordering include positional - /// textual formats like CSV, and schema-based binary formats - /// like Avro. - ///@return Whether format supported by this factory - /// requires Object properties to be ordered. - ///@since 2.3 - bool requiresPropertyOrdering() { - return _requiresPropertyOrdering(reference.pointer).boolean; - } - - static final _canHandleBinaryNatively = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__canHandleBinaryNatively") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean canHandleBinaryNatively() - /// - /// Introspection method that higher-level functionality may call - /// to see whether underlying data format can read and write binary - /// data natively; that is, embeded it as-is without using encodings - /// such as Base64. - /// - /// Default implementation returns false as JSON does not - /// support native access: all binary content must use Base64 encoding. - /// Most binary formats (like Smile and Avro) support native binary content. - ///@return Whether format supported by this factory - /// supports native binary content - ///@since 2.3 - bool canHandleBinaryNatively() { - return _canHandleBinaryNatively(reference.pointer).boolean; - } - - static final _canUseCharArrays = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__canUseCharArrays") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean canUseCharArrays() - /// - /// Introspection method that can be used by base factory to check - /// whether access using char[] is something that actual - /// parser implementations can take advantage of, over having to - /// use java.io.Reader. Sub-types are expected to override - /// definition; default implementation (suitable for JSON) alleges - /// that optimization are possible; and thereby is likely to try - /// to access java.lang.String content by first copying it into - /// recyclable intermediate buffer. - ///@return Whether access to decoded textual content can be efficiently - /// accessed using parser method {@code getTextCharacters()}. - ///@since 2.4 - bool canUseCharArrays() { - return _canUseCharArrays(reference.pointer).boolean; - } - - static final _canParseAsync = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__canParseAsync") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean canParseAsync() - /// - /// Introspection method that can be used to check whether this - /// factory can create non-blocking parsers: parsers that do not - /// use blocking I/O abstractions but instead use a - /// com.fasterxml.jackson.core.async.NonBlockingInputFeeder. - ///@return Whether this factory supports non-blocking ("async") parsing or - /// not (and consequently whether {@code createNonBlockingXxx()} method(s) work) - ///@since 2.9 - bool canParseAsync() { - return _canParseAsync(reference.pointer).boolean; - } - - static final _getFormatReadFeatureType = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getFormatReadFeatureType") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Class getFormatReadFeatureType() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject getFormatReadFeatureType() { - return _getFormatReadFeatureType(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _getFormatWriteFeatureType = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getFormatWriteFeatureType") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Class getFormatWriteFeatureType() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject getFormatWriteFeatureType() { - return _getFormatWriteFeatureType(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _canUseSchema = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__canUseSchema") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema) - /// - /// Method that can be used to quickly check whether given schema - /// is something that parsers and/or generators constructed by this - /// factory could use. Note that this means possible use, at the level - /// of data format (i.e. schema is for same data format as parsers and - /// generators this factory constructs); individual schema instances - /// may have further usage restrictions. - ///@param schema Schema instance to check - ///@return Whether parsers and generators constructed by this factory - /// can use specified format schema instance - bool canUseSchema( - jni.JObject schema, - ) { - return _canUseSchema(reference.pointer, schema.reference.pointer).boolean; - } - - static final _getFormatName = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getFormatName") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String getFormatName() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that returns short textual id identifying format - /// this factory supports. - /// - /// 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.JString getFormatName() { - return _getFormatName(reference.pointer).object(const jni.JStringType()); - } - - static final _hasFormat = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__hasFormat") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) - /// The returned object must be released after use, by calling the [release] method. - jni.JObject hasFormat( - jni.JObject acc, - ) { - return _hasFormat(reference.pointer, acc.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _requiresCustomCodec = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__requiresCustomCodec") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean requiresCustomCodec() - /// - /// Method that can be called to determine if a custom - /// ObjectCodec is needed for binding data parsed - /// using JsonParser constructed by this factory - /// (which typically also implies the same for serialization - /// with JsonGenerator). - ///@return True if custom codec is needed with parsers and - /// generators created by this factory; false if a general - /// ObjectCodec is enough - ///@since 2.1 - bool requiresCustomCodec() { - return _requiresCustomCodec(reference.pointer).boolean; - } - - static final _hasJSONFormat = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__hasJSONFormat") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: protected com.fasterxml.jackson.core.format.MatchStrength hasJSONFormat(com.fasterxml.jackson.core.format.InputAccessor acc) - /// The returned object must be released after use, by calling the [release] method. - jni.JObject hasJSONFormat( - jni.JObject acc, - ) { - return _hasJSONFormat(reference.pointer, acc.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _version = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__version") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.Version version() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject version() { - return _version(reference.pointer).object(const jni.JObjectType()); - } - - static final _configure = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>("JsonFactory__configure") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); - - /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory.Feature f, boolean state) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling or disabling specified parser feature - /// (check JsonParser.Feature for list of features) - ///@param f Feature to enable/disable - ///@param state Whether to enable or disable the feature - ///@return This factory instance (to allow call chaining) - ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead - JsonFactory configure( - JsonFactory_Feature f, - bool state, - ) { - return _configure(reference.pointer, f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactoryType()); - } - - static final _enable = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__enable") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling specified parser feature - /// (check JsonFactory.Feature for list of features) - ///@param f Feature to enable - ///@return This factory instance (to allow call chaining) - ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead - JsonFactory enable( - JsonFactory_Feature f, - ) { - return _enable(reference.pointer, f.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _disable = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__disable") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for disabling specified parser features - /// (check JsonFactory.Feature for list of features) - ///@param f Feature to disable - ///@return This factory instance (to allow call chaining) - ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead - JsonFactory disable( - JsonFactory_Feature f, - ) { - return _disable(reference.pointer, f.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _isEnabled = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__isEnabled") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public final boolean isEnabled(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// - /// Checked whether specified parser feature is enabled. - ///@param f Feature to check - ///@return True if the specified feature is enabled - bool isEnabled( - JsonFactory_Feature f, - ) { - return _isEnabled(reference.pointer, f.reference.pointer).boolean; - } - - static final _getParserFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getParserFeatures") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final int getParserFeatures() - int getParserFeatures() { - return _getParserFeatures(reference.pointer).integer; - } - - static final _getGeneratorFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getGeneratorFeatures") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final int getGeneratorFeatures() - int getGeneratorFeatures() { - return _getGeneratorFeatures(reference.pointer).integer; - } - - static final _getFormatParserFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getFormatParserFeatures") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getFormatParserFeatures() - int getFormatParserFeatures() { - return _getFormatParserFeatures(reference.pointer).integer; - } - - static final _getFormatGeneratorFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getFormatGeneratorFeatures") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getFormatGeneratorFeatures() - int getFormatGeneratorFeatures() { - return _getFormatGeneratorFeatures(reference.pointer).integer; - } - - static final _configure1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>("JsonFactory__configure1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); - - /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling or disabling specified parser feature - /// (check JsonParser.Feature for list of features) - ///@param f Feature to enable/disable - ///@param state Whether to enable or disable the feature - ///@return This factory instance (to allow call chaining) - JsonFactory configure1( - jsonparser_.JsonParser_Feature f, - bool state, - ) { - return _configure1(reference.pointer, f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactoryType()); - } - - static final _enable1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__enable1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling specified parser feature - /// (check JsonParser.Feature for list of features) - ///@param f Feature to enable - ///@return This factory instance (to allow call chaining) - JsonFactory enable1( - jsonparser_.JsonParser_Feature f, - ) { - return _enable1(reference.pointer, f.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _disable1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__disable1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for disabling specified parser features - /// (check JsonParser.Feature for list of features) - ///@param f Feature to disable - ///@return This factory instance (to allow call chaining) - JsonFactory disable1( - jsonparser_.JsonParser_Feature f, - ) { - return _disable1(reference.pointer, f.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _isEnabled1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__isEnabled1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public final boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f) - /// - /// Method for checking if the specified parser feature is enabled. - ///@param f Feature to check - ///@return True if specified feature is enabled - bool isEnabled1( - jsonparser_.JsonParser_Feature f, - ) { - return _isEnabled1(reference.pointer, f.reference.pointer).boolean; - } - - static final _isEnabled2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__isEnabled2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public final boolean isEnabled(com.fasterxml.jackson.core.StreamReadFeature f) - /// - /// Method for checking if the specified stream read feature is enabled. - ///@param f Feature to check - ///@return True if specified feature is enabled - ///@since 2.10 - bool isEnabled2( - jni.JObject f, - ) { - return _isEnabled2(reference.pointer, f.reference.pointer).boolean; - } - - static final _getInputDecorator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getInputDecorator") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.io.InputDecorator getInputDecorator() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for getting currently configured input decorator (if any; - /// there is no default decorator). - ///@return InputDecorator configured, if any - jni.JObject getInputDecorator() { - return _getInputDecorator(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _setInputDecorator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__setInputDecorator") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory setInputDecorator(com.fasterxml.jackson.core.io.InputDecorator d) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for overriding currently configured input decorator - ///@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.JObject d, - ) { - return _setInputDecorator(reference.pointer, d.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _configure2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>("JsonFactory__configure2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); - - /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling or disabling specified generator feature - /// (check JsonGenerator.Feature for list of features) - ///@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.JObject f, - bool state, - ) { - return _configure2(reference.pointer, f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactoryType()); - } - - static final _enable2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__enable2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling specified generator features - /// (check JsonGenerator.Feature for list of features) - ///@param f Feature to enable - ///@return This factory instance (to allow call chaining) - JsonFactory enable2( - jni.JObject f, - ) { - return _enable2(reference.pointer, f.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _disable2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__disable2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for disabling specified generator feature - /// (check JsonGenerator.Feature for list of features) - ///@param f Feature to disable - ///@return This factory instance (to allow call chaining) - JsonFactory disable2( - jni.JObject f, - ) { - return _disable2(reference.pointer, f.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _isEnabled3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__isEnabled3") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public final boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// - /// Check whether specified generator feature is enabled. - ///@param f Feature to check - ///@return Whether specified feature is enabled - bool isEnabled3( - jni.JObject f, - ) { - return _isEnabled3(reference.pointer, f.reference.pointer).boolean; - } - - static final _isEnabled4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__isEnabled4") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public final boolean isEnabled(com.fasterxml.jackson.core.StreamWriteFeature f) - /// - /// Check whether specified stream write feature is enabled. - ///@param f Feature to check - ///@return Whether specified feature is enabled - ///@since 2.10 - bool isEnabled4( - jni.JObject f, - ) { - return _isEnabled4(reference.pointer, f.reference.pointer).boolean; - } - - static final _getCharacterEscapes = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getCharacterEscapes") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.io.CharacterEscapes getCharacterEscapes() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for accessing custom escapes factory uses for JsonGenerators - /// it creates. - ///@return Configured {@code CharacterEscapes}, if any; {@code null} if none - jni.JObject getCharacterEscapes() { - return _getCharacterEscapes(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _setCharacterEscapes = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__setCharacterEscapes") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory setCharacterEscapes(com.fasterxml.jackson.core.io.CharacterEscapes esc) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for defining custom escapes factory uses for JsonGenerators - /// it creates. - ///@param esc CharaterEscapes to set (or {@code null} for "none") - ///@return This factory instance (to allow call chaining) - JsonFactory setCharacterEscapes( - jni.JObject esc, - ) { - return _setCharacterEscapes(reference.pointer, esc.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _getOutputDecorator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getOutputDecorator") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.io.OutputDecorator getOutputDecorator() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for getting currently configured output decorator (if any; - /// there is no default decorator). - ///@return OutputDecorator configured for generators factory creates, if any; - /// {@code null} if none. - jni.JObject getOutputDecorator() { - return _getOutputDecorator(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _setOutputDecorator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__setOutputDecorator") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory setOutputDecorator(com.fasterxml.jackson.core.io.OutputDecorator d) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for overriding currently configured output decorator - ///@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.JObject d, - ) { - return _setOutputDecorator(reference.pointer, d.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _setRootValueSeparator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__setRootValueSeparator") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory setRootValueSeparator(java.lang.String sep) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that allows overriding String used for separating root-level - /// JSON values (default is single space character) - ///@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.JString sep, - ) { - return _setRootValueSeparator(reference.pointer, sep.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _getRootValueSeparator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getRootValueSeparator") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String getRootValueSeparator() - /// The returned object must be released after use, by calling the [release] method. - /// - /// @return Root value separator configured, if any - jni.JString getRootValueSeparator() { - return _getRootValueSeparator(reference.pointer) - .object(const jni.JStringType()); - } - - static final _setCodec = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__setCodec") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonFactory setCodec(com.fasterxml.jackson.core.ObjectCodec oc) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for associating a ObjectCodec (typically - /// a com.fasterxml.jackson.databind.ObjectMapper) - /// with this factory (and more importantly, parsers and generators - /// it constructs). This is needed to use data-binding methods - /// of JsonParser and JsonGenerator instances. - ///@param oc Codec to use - ///@return This factory instance (to allow call chaining) - JsonFactory setCodec( - jni.JObject oc, - ) { - return _setCodec(reference.pointer, oc.reference.pointer) - .object(const $JsonFactoryType()); - } - - static final _getCodec = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__getCodec") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.ObjectCodec getCodec() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject getCodec() { - return _getCodec(reference.pointer).object(const jni.JObjectType()); - } - - static final _createParser = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.File f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON parser instance to parse - /// contents of specified file. - /// - /// - /// Encoding is auto-detected from contents according to JSON - /// specification recommended mechanism. Json specification - /// supports only UTF-8, UTF-16 and UTF-32 as valid encodings, - /// so auto-detection implemented only for this charsets. - /// For other charsets use \#createParser(java.io.Reader). - /// - /// - /// Underlying input stream (needed for reading contents) - /// will be __owned__ (and managed, i.e. closed as need be) by - /// 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.JObject f, - ) { - return _createParser(reference.pointer, f.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.net.URL url) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON parser instance to parse - /// contents of resource reference by given URL. - /// - /// Encoding is auto-detected from contents according to JSON - /// specification recommended mechanism. Json specification - /// supports only UTF-8, UTF-16 and UTF-32 as valid encodings, - /// so auto-detection implemented only for this charsets. - /// For other charsets use \#createParser(java.io.Reader). - /// - /// Underlying input stream (needed for reading contents) - /// will be __owned__ (and managed, i.e. closed as need be) by - /// 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.JObject url, - ) { - return _createParser1(reference.pointer, url.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.InputStream in) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON parser instance to parse - /// the contents accessed via specified input stream. - /// - /// The input stream will __not be owned__ by - /// the parser, it will still be managed (i.e. closed if - /// end-of-stream is reacher, or parser close method called) - /// if (and only if) com.fasterxml.jackson.core.StreamReadFeature\#AUTO_CLOSE_SOURCE - /// is enabled. - /// - /// - /// Note: no encoding argument is taken since it can always be - /// auto-detected as suggested by JSON RFC. Json specification - /// supports only UTF-8, UTF-16 and UTF-32 as valid encodings, - /// so auto-detection implemented only for this charsets. - /// 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.JObject in0, - ) { - return _createParser2(reference.pointer, in0.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser3") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.Reader r) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// the contents accessed via specified Reader. - /// - /// The read stream will __not be owned__ by - /// the parser, it will still be managed (i.e. closed if - /// end-of-stream is reacher, or parser close method called) - /// if (and only if) com.fasterxml.jackson.core.StreamReadFeature\#AUTO_CLOSE_SOURCE - /// is enabled. - ///@param r Reader to use for reading JSON content to parse - ///@since 2.1 - jsonparser_.JsonParser createParser3( - jni.JObject r, - ) { - return _createParser3(reference.pointer, r.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser4") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(byte[] data) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// the contents of given byte array. - ///@since 2.1 - jsonparser_.JsonParser createParser4( - jni.JArray data, - ) { - return _createParser4(reference.pointer, data.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser5 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32)>>("JsonFactory__createParser5") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(byte[] data, int offset, int len) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// the contents of given byte array. - ///@param data Buffer that contains data to parse - ///@param offset Offset of the first data byte within buffer - ///@param len Length of contents to parse within buffer - ///@since 2.1 - jsonparser_.JsonParser createParser5( - jni.JArray data, - int offset, - int len, - ) { - return _createParser5( - reference.pointer, data.reference.pointer, offset, len) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser6 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser6") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.lang.String content) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// contents of given String. - ///@since 2.1 - jsonparser_.JsonParser createParser6( - jni.JString content, - ) { - return _createParser6(reference.pointer, content.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser7 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser7") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(char[] content) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// contents of given char array. - ///@since 2.4 - jsonparser_.JsonParser createParser7( - jni.JArray content, - ) { - return _createParser7(reference.pointer, content.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser8 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32)>>("JsonFactory__createParser8") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(char[] content, int offset, int len) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing contents of given char array. - ///@since 2.4 - jsonparser_.JsonParser createParser8( - jni.JArray content, - int offset, - int len, - ) { - return _createParser8( - reference.pointer, content.reference.pointer, offset, len) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createParser9 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createParser9") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.DataInput in) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Optional method for constructing parser for reading contents from specified DataInput - /// instance. - /// - /// If this factory does not support DataInput as source, - /// will throw UnsupportedOperationException - ///@since 2.8 - jsonparser_.JsonParser createParser9( - jni.JObject in0, - ) { - return _createParser9(reference.pointer, in0.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createNonBlockingByteArrayParser = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonFactory__createNonBlockingByteArrayParser") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createNonBlockingByteArrayParser() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Optional method for constructing parser for non-blocking parsing - /// via com.fasterxml.jackson.core.async.ByteArrayFeeder - /// interface (accessed using JsonParser\#getNonBlockingInputFeeder() - /// from constructed instance). - /// - /// If this factory does not support non-blocking parsing (either at all, - /// or from byte array), - /// will throw UnsupportedOperationException. - /// - /// Note that JSON-backed factory only supports parsing of UTF-8 encoded JSON content - /// (and US-ASCII since it is proper subset); other encodings are not supported - /// at this point. - ///@since 2.9 - jsonparser_.JsonParser createNonBlockingByteArrayParser() { - return _createNonBlockingByteArrayParser(reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createGenerator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createGenerator") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON generator for writing JSON content - /// using specified output stream. - /// Encoding to use must be specified, and needs to be one of available - /// types (as per JSON specification). - /// - /// Underlying stream __is NOT owned__ by the generator constructed, - /// so that generator will NOT close the output stream when - /// JsonGenerator\#close is called (unless auto-closing - /// feature, - /// com.fasterxml.jackson.core.JsonGenerator.Feature\#AUTO_CLOSE_TARGET - /// is enabled). - /// Using application needs to close it explicitly if this is the case. - /// - /// Note: there are formats that use fixed encoding (like most binary data formats) - /// and that ignore passed in encoding. - ///@param out OutputStream to use for writing JSON content - ///@param enc Character encoding to use - ///@since 2.1 - jni.JObject createGenerator( - jni.JObject out, - jni.JObject enc, - ) { - return _createGenerator( - reference.pointer, out.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createGenerator1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createGenerator1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Convenience method for constructing generator that uses default - /// encoding of the format (UTF-8 for JSON and most other data formats). - /// - /// Note: there are formats that use fixed encoding (like most binary data formats). - ///@since 2.1 - jni.JObject createGenerator1( - jni.JObject out, - ) { - return _createGenerator1(reference.pointer, out.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createGenerator2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createGenerator2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.Writer w) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON generator for writing JSON content - /// using specified Writer. - /// - /// Underlying stream __is NOT owned__ by the generator constructed, - /// so that generator will NOT close the Reader when - /// JsonGenerator\#close is called (unless auto-closing - /// feature, - /// com.fasterxml.jackson.core.JsonGenerator.Feature\#AUTO_CLOSE_TARGET is enabled). - /// Using application needs to close it explicitly. - ///@since 2.1 - ///@param w Writer to use for writing JSON content - jni.JObject createGenerator2( - jni.JObject w, - ) { - return _createGenerator2(reference.pointer, w.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createGenerator3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createGenerator3") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.File f, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON generator for writing JSON content - /// to specified file, overwriting contents it might have (or creating - /// it if such file does not yet exist). - /// Encoding to use must be specified, and needs to be one of available - /// types (as per JSON specification). - /// - /// Underlying stream __is owned__ by the generator constructed, - /// i.e. generator will handle closing of file when - /// JsonGenerator\#close is called. - ///@param f File to write contents to - ///@param enc Character encoding to use - ///@since 2.1 - jni.JObject createGenerator3( - jni.JObject f, - jni.JObject enc, - ) { - return _createGenerator3( - reference.pointer, f.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createGenerator4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createGenerator4") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing generator for writing content using specified - /// DataOutput instance. - ///@since 2.8 - jni.JObject createGenerator4( - jni.JObject out, - jni.JObject enc, - ) { - return _createGenerator4( - reference.pointer, out.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createGenerator5 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createGenerator5") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Convenience method for constructing generator that uses default - /// encoding of the format (UTF-8 for JSON and most other data formats). - /// - /// Note: there are formats that use fixed encoding (like most binary data formats). - ///@since 2.8 - jni.JObject createGenerator5( - jni.JObject out, - ) { - return _createGenerator5(reference.pointer, out.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createJsonParser = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonParser") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.File f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON parser instance to parse - /// contents of specified file. - /// - /// Encoding is auto-detected from contents according to JSON - /// specification recommended mechanism. Json specification - /// supports only UTF-8, UTF-16 and UTF-32 as valid encodings, - /// so auto-detection implemented only for this charsets. - /// For other charsets use \#createParser(java.io.Reader). - /// - /// - /// Underlying input stream (needed for reading contents) - /// will be __owned__ (and managed, i.e. closed as need be) by - /// the parser, since caller has no access to it. - ///@param f File that contains JSON content to parse - ///@return Parser constructed - ///@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.JObject f, - ) { - return _createJsonParser(reference.pointer, f.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonParser1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonParser1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.net.URL url) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON parser instance to parse - /// contents of resource reference by given URL. - /// - /// Encoding is auto-detected from contents according to JSON - /// specification recommended mechanism. Json specification - /// supports only UTF-8, UTF-16 and UTF-32 as valid encodings, - /// so auto-detection implemented only for this charsets. - /// For other charsets use \#createParser(java.io.Reader). - /// - /// Underlying input stream (needed for reading contents) - /// will be __owned__ (and managed, i.e. closed as need be) by - /// the parser, since caller has no access to it. - ///@param url URL pointing to resource that contains JSON content to parse - ///@return Parser constructed - ///@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.JObject url, - ) { - return _createJsonParser1(reference.pointer, url.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonParser2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonParser2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.InputStream in) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON parser instance to parse - /// the contents accessed via specified input stream. - /// - /// The input stream will __not be owned__ by - /// the parser, it will still be managed (i.e. closed if - /// end-of-stream is reacher, or parser close method called) - /// if (and only if) com.fasterxml.jackson.core.JsonParser.Feature\#AUTO_CLOSE_SOURCE - /// is enabled. - /// - /// - /// Note: no encoding argument is taken since it can always be - /// auto-detected as suggested by JSON RFC. Json specification - /// supports only UTF-8, UTF-16 and UTF-32 as valid encodings, - /// so auto-detection implemented only for this charsets. - /// For other charsets use \#createParser(java.io.Reader). - ///@param in InputStream to use for reading JSON content to parse - ///@return Parser constructed - ///@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.JObject in0, - ) { - return _createJsonParser2(reference.pointer, in0.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonParser3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonParser3") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.Reader r) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// the contents accessed via specified Reader. - /// - /// The read stream will __not be owned__ by - /// the parser, it will still be managed (i.e. closed if - /// end-of-stream is reacher, or parser close method called) - /// if (and only if) com.fasterxml.jackson.core.JsonParser.Feature\#AUTO_CLOSE_SOURCE - /// is enabled. - ///@param r Reader to use for reading JSON content to parse - ///@return Parser constructed - ///@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.JObject r, - ) { - return _createJsonParser3(reference.pointer, r.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonParser4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonParser4") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing the contents of given byte array. - ///@param data Input content to parse - ///@return Parser constructed - ///@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.JArray data, - ) { - return _createJsonParser4(reference.pointer, data.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonParser5 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32)>>("JsonFactory__createJsonParser5") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data, int offset, int len) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// the contents of given byte array. - ///@param data Buffer that contains data to parse - ///@param offset Offset of the first data byte within buffer - ///@param len Length of contents to parse within buffer - ///@return Parser constructed - ///@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[],int,int) instead. - jsonparser_.JsonParser createJsonParser5( - jni.JArray data, - int offset, - int len, - ) { - return _createJsonParser5( - reference.pointer, data.reference.pointer, offset, len) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonParser6 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonParser6") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.lang.String content) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing parser for parsing - /// contents of given String. - ///@param content Input content to parse - ///@return Parser constructed - ///@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.JString content, - ) { - return _createJsonParser6(reference.pointer, content.reference.pointer) - .object(const jsonparser_.$JsonParserType()); - } - - static final _createJsonGenerator = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonGenerator") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON generator for writing JSON content - /// using specified output stream. - /// Encoding to use must be specified, and needs to be one of available - /// types (as per JSON specification). - /// - /// Underlying stream __is NOT owned__ by the generator constructed, - /// so that generator will NOT close the output stream when - /// JsonGenerator\#close is called (unless auto-closing - /// feature, - /// com.fasterxml.jackson.core.JsonGenerator.Feature\#AUTO_CLOSE_TARGET - /// is enabled). - /// Using application needs to close it explicitly if this is the case. - /// - /// Note: there are formats that use fixed encoding (like most binary data formats) - /// and that ignore passed in encoding. - ///@param out OutputStream to use for writing JSON content - ///@param enc Character encoding to use - ///@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.JObject createJsonGenerator( - jni.JObject out, - jni.JObject enc, - ) { - return _createJsonGenerator( - reference.pointer, out.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createJsonGenerator1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonGenerator1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.Writer out) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for constructing JSON generator for writing JSON content - /// using specified Writer. - /// - /// Underlying stream __is NOT owned__ by the generator constructed, - /// so that generator will NOT close the Reader when - /// JsonGenerator\#close is called (unless auto-closing - /// feature, - /// com.fasterxml.jackson.core.JsonGenerator.Feature\#AUTO_CLOSE_TARGET is enabled). - /// Using application needs to close it explicitly. - ///@param out Writer to use for writing JSON content - ///@return Generator constructed - ///@throws IOException if parser initialization fails due to I/O (write) problem - ///@deprecated Since 2.2, use \#createGenerator(Writer) instead. - jni.JObject createJsonGenerator1( - jni.JObject out, - ) { - return _createJsonGenerator1(reference.pointer, out.reference.pointer) - .object(const jni.JObjectType()); - } - - static final _createJsonGenerator2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonFactory__createJsonGenerator2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Convenience method for constructing generator that uses default - /// encoding of the format (UTF-8 for JSON and most other data formats). - /// - /// Note: there are formats that use fixed encoding (like most binary data formats). - ///@param out OutputStream to use for writing JSON content - ///@return Generator constructed - ///@throws IOException if parser initialization fails due to I/O (write) problem - ///@deprecated Since 2.2, use \#createGenerator(OutputStream) instead. - jni.JObject createJsonGenerator2( - jni.JObject out, - ) { - return _createJsonGenerator2(reference.pointer, out.reference.pointer) - .object(const jni.JObjectType()); - } -} - -final class $JsonFactoryType extends jni.JObjType { - const $JsonFactoryType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonFactory;"; - - @override - JsonFactory fromReference(jni.JReference reference) => - JsonFactory.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonFactoryType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonFactoryType) && other is $JsonFactoryType; - } -} diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart deleted file mode 100644 index 49368b30e..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart +++ /dev/null @@ -1,3133 +0,0 @@ -// Generated from jackson-core which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// See https://github.com/FasterXML/jackson-core/blob/2.14/LICENSE -// -// Copyright (c) 2007 - The Jackson Project Authors -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Autogenerated by jnigen. DO NOT EDIT! - -// ignore_for_file: annotate_overrides -// ignore_for_file: camel_case_extensions -// ignore_for_file: camel_case_types -// ignore_for_file: constant_identifier_names -// ignore_for_file: doc_directive_unknown -// ignore_for_file: file_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: overridden_fields -// ignore_for_file: unnecessary_cast -// ignore_for_file: unused_element -// ignore_for_file: unused_field -// ignore_for_file: unused_import -// ignore_for_file: unused_local_variable -// ignore_for_file: unused_shown_name -// ignore_for_file: use_super_parameters - -import "dart:isolate" show ReceivePort; -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; -import "package:jni/jni.dart" as jni; - -import "JsonToken.dart" as jsontoken_; -import "../../../../_init.dart"; - -/// from: com.fasterxml.jackson.core.JsonParser$Feature -/// -/// Enumeration that defines all on/off features for parsers. -class JsonParser_Feature extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonParser_Feature.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonParser_FeatureType(); - static final _values = - jniLookup>( - "JsonParser_Feature__values") - .asFunction(); - - /// from: static public com.fasterxml.jackson.core.JsonParser.Feature[] values() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values().object(const jni.JArrayType($JsonParser_FeatureType())); - } - - static final _valueOf = jniLookup< - ffi - .NativeFunction)>>( - "JsonParser_Feature__valueOf") - .asFunction)>(); - - /// from: static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name) - /// The returned object must be released after use, by calling the [release] method. - static JsonParser_Feature valueOf( - jni.JString name, - ) { - return _valueOf(name.reference.pointer) - .object(const $JsonParser_FeatureType()); - } - - static final _collectDefaults = - jniLookup>( - "JsonParser_Feature__collectDefaults") - .asFunction(); - - /// from: static public int collectDefaults() - /// - /// Method that calculates bit set (flags) of all features that - /// are enabled by default. - ///@return Bit mask of all features that are enabled by default - static int collectDefaults() { - return _collectDefaults().integer; - } - - static final _enabledByDefault = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser_Feature__enabledByDefault") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean enabledByDefault() - bool enabledByDefault() { - return _enabledByDefault(reference.pointer).boolean; - } - - static final _enabledIn = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("JsonParser_Feature__enabledIn") - .asFunction, int)>(); - - /// from: public boolean enabledIn(int flags) - bool enabledIn( - int flags, - ) { - return _enabledIn(reference.pointer, flags).boolean; - } - - static final _getMask = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser_Feature__getMask") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getMask() - int getMask() { - return _getMask(reference.pointer).integer; - } -} - -final class $JsonParser_FeatureType extends jni.JObjType { - const $JsonParser_FeatureType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$Feature;"; - - @override - JsonParser_Feature fromReference(jni.JReference reference) => - JsonParser_Feature.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonParser_FeatureType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_FeatureType) && - other is $JsonParser_FeatureType; - } -} - -/// from: com.fasterxml.jackson.core.JsonParser$NumberType -/// -/// Enumeration of possible "native" (optimal) types that can be -/// used for numbers. -class JsonParser_NumberType extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonParser_NumberType.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonParser_NumberTypeType(); - static final _values = - jniLookup>( - "JsonParser_NumberType__values") - .asFunction(); - - /// from: static public com.fasterxml.jackson.core.JsonParser.NumberType[] values() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values().object(const jni.JArrayType($JsonParser_NumberTypeType())); - } - - static final _valueOf = jniLookup< - ffi - .NativeFunction)>>( - "JsonParser_NumberType__valueOf") - .asFunction)>(); - - /// from: static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name) - /// The returned object must be released after use, by calling the [release] method. - static JsonParser_NumberType valueOf( - jni.JString name, - ) { - return _valueOf(name.reference.pointer) - .object(const $JsonParser_NumberTypeType()); - } -} - -final class $JsonParser_NumberTypeType - extends jni.JObjType { - const $JsonParser_NumberTypeType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$NumberType;"; - - @override - JsonParser_NumberType fromReference(jni.JReference reference) => - JsonParser_NumberType.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonParser_NumberTypeType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_NumberTypeType) && - other is $JsonParser_NumberTypeType; - } -} - -/// from: com.fasterxml.jackson.core.JsonParser -/// -/// Base class that defines public API for reading JSON content. -/// Instances are created using factory methods of -/// a JsonFactory instance. -///@author Tatu Saloranta -class JsonParser extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonParser.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonParserType(); - static final _get_DEFAULT_READ_CAPABILITIES = - jniLookup>( - "get_JsonParser__DEFAULT_READ_CAPABILITIES") - .asFunction(); - - /// from: static protected final com.fasterxml.jackson.core.util.JacksonFeatureSet DEFAULT_READ_CAPABILITIES - /// The returned object must be released after use, by calling the [release] method. - /// - /// Default set of StreamReadCapabilityies that may be used as - /// basis for format-specific readers (or as bogus instance if non-null - /// set needs to be passed). - ///@since 2.12 - static jni.JObject get DEFAULT_READ_CAPABILITIES => - _get_DEFAULT_READ_CAPABILITIES().object(const jni.JObjectType()); - - static final _new0 = jniLookup>( - "JsonParser__new0") - .asFunction(); - - /// from: protected void () - /// The returned object must be released after use, by calling the [release] method. - factory JsonParser() { - return JsonParser.fromReference(_new0().reference); - } - - static final _new1 = - jniLookup>( - "JsonParser__new1") - .asFunction(); - - /// from: protected void (int features) - /// The returned object must be released after use, by calling the [release] method. - factory JsonParser.new1( - int features, - ) { - return JsonParser.fromReference(_new1(features).reference); - } - - static final _getCodec = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getCodec") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.ObjectCodec getCodec() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Accessor for ObjectCodec associated with this - /// 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.JObject getCodec() { - return _getCodec(reference.pointer).object(const jni.JObjectType()); - } - - static final _setCodec = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__setCodec") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract void setCodec(com.fasterxml.jackson.core.ObjectCodec oc) - /// - /// Setter that allows defining ObjectCodec associated with this - /// 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.JObject oc, - ) { - _setCodec(reference.pointer, oc.reference.pointer).check(); - } - - static final _getInputSource = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getInputSource") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object getInputSource() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be used to get access to object that is used - /// to access input being parsed; this is usually either - /// InputStream or Reader, depending on what - /// parser was constructed with. - /// Note that returned value may be null in some cases; including - /// case where parser implementation does not want to exposed raw - /// source to caller. - /// In cases where input has been decorated, object returned here - /// is the decorated version; this allows some level of interaction - /// between users of parser and decorator object. - /// - /// 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.JObject getInputSource() { - return _getInputSource(reference.pointer).object(const jni.JObjectType()); - } - - static final _setRequestPayloadOnError = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "JsonParser__setRequestPayloadOnError") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void setRequestPayloadOnError(com.fasterxml.jackson.core.util.RequestPayload payload) - /// - /// Sets the payload to be passed if JsonParseException is thrown. - ///@param payload Payload to pass - ///@since 2.8 - void setRequestPayloadOnError( - jni.JObject payload, - ) { - _setRequestPayloadOnError(reference.pointer, payload.reference.pointer) - .check(); - } - - static final _setRequestPayloadOnError1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>( - "JsonParser__setRequestPayloadOnError1") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public void setRequestPayloadOnError(byte[] payload, java.lang.String charset) - /// - /// Sets the byte[] request payload and the charset - ///@param payload Payload to pass - ///@param charset Character encoding for (lazily) decoding payload - ///@since 2.8 - void setRequestPayloadOnError1( - jni.JArray payload, - jni.JString charset, - ) { - _setRequestPayloadOnError1(reference.pointer, payload.reference.pointer, - charset.reference.pointer) - .check(); - } - - static final _setRequestPayloadOnError2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "JsonParser__setRequestPayloadOnError2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void setRequestPayloadOnError(java.lang.String payload) - /// - /// Sets the String request payload - ///@param payload Payload to pass - ///@since 2.8 - void setRequestPayloadOnError2( - jni.JString payload, - ) { - _setRequestPayloadOnError2(reference.pointer, payload.reference.pointer) - .check(); - } - - static final _setSchema = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__setSchema") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void setSchema(com.fasterxml.jackson.core.FormatSchema schema) - /// - /// Method to call to make this parser use specified schema. Method must - /// be called before trying to parse any content, right after parser instance - /// has been created. - /// Note that not all parsers support schemas; and those that do usually only - /// accept specific types of schemas: ones defined for data format parser can read. - /// - /// If parser does not support specified schema, UnsupportedOperationException - /// is thrown. - ///@param schema Schema to use - ///@throws UnsupportedOperationException if parser does not support schema - void setSchema( - jni.JObject schema, - ) { - _setSchema(reference.pointer, schema.reference.pointer).check(); - } - - static final _getSchema = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getSchema") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.FormatSchema getSchema() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for accessing Schema that this parser uses, if any. - /// Default implementation returns null. - ///@return Schema in use by this parser, if any; {@code null} if none - ///@since 2.1 - jni.JObject getSchema() { - return _getSchema(reference.pointer).object(const jni.JObjectType()); - } - - static final _canUseSchema = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__canUseSchema") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema) - /// - /// Method that can be used to verify that given schema can be used with - /// this parser (using \#setSchema). - ///@param schema Schema to check - ///@return True if this parser can use given schema; false if not - bool canUseSchema( - jni.JObject schema, - ) { - return _canUseSchema(reference.pointer, schema.reference.pointer).boolean; - } - - static final _requiresCustomCodec = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__requiresCustomCodec") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean requiresCustomCodec() - /// - /// Method that can be called to determine if a custom - /// ObjectCodec is needed for binding data parsed - /// using JsonParser constructed by this factory - /// (which typically also implies the same for serialization - /// with JsonGenerator). - ///@return True if format-specific codec is needed with this parser; false if a general - /// ObjectCodec is enough - ///@since 2.1 - bool requiresCustomCodec() { - return _requiresCustomCodec(reference.pointer).boolean; - } - - static final _canParseAsync = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__canParseAsync") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean canParseAsync() - /// - /// Method that can be called to determine if this parser instance - /// uses non-blocking ("asynchronous") input access for decoding or not. - /// Access mode is determined by earlier calls via JsonFactory; - /// it may not be changed after construction. - /// - /// If non-blocking decoding is (@code true}, it is possible to call - /// \#getNonBlockingInputFeeder() to obtain object to use - /// for feeding input; otherwise (false returned) - /// input is read by blocking - ///@return True if this is a non-blocking ("asynchronous") parser - ///@since 2.9 - bool canParseAsync() { - return _canParseAsync(reference.pointer).boolean; - } - - static final _getNonBlockingInputFeeder = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getNonBlockingInputFeeder") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.async.NonBlockingInputFeeder getNonBlockingInputFeeder() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that will either return a feeder instance (if parser uses - /// non-blocking, aka asynchronous access); or null for - /// parsers that use blocking I/O. - ///@return Input feeder to use with non-blocking (async) parsing - ///@since 2.9 - jni.JObject getNonBlockingInputFeeder() { - return _getNonBlockingInputFeeder(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _getReadCapabilities = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getReadCapabilities") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Accessor for getting metadata on capabilities of this parser, based on - /// underlying data format being read (directly or indirectly). - ///@return Set of read capabilities for content to read via this parser - ///@since 2.12 - jni.JObject getReadCapabilities() { - return _getReadCapabilities(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _version = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__version") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.Version version() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Accessor for getting version of the core package, given a parser instance. - /// 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.JObject version() { - return _version(reference.pointer).object(const jni.JObjectType()); - } - - static final _close = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__close") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract void close() - /// - /// Closes the parser so that no further iteration or data access - /// can be made; will also close the underlying input source - /// if parser either __owns__ the input source, or feature - /// Feature\#AUTO_CLOSE_SOURCE is enabled. - /// Whether parser owns the input source depends on factory - /// method that was used to construct instance (so check - /// com.fasterxml.jackson.core.JsonFactory for details, - /// but the general - /// idea is that if caller passes in closable resource (such - /// as InputStream or Reader) parser does NOT - /// own the source; but if it passes a reference (such as - /// java.io.File or java.net.URL and creates - /// stream or reader it does own them. - ///@throws IOException if there is either an underlying I/O problem - void close() { - _close(reference.pointer).check(); - } - - static final _isClosed = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__isClosed") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract boolean isClosed() - /// - /// Method that can be called to determine whether this parser - /// is closed or not. If it is closed, no new tokens can be - /// retrieved by calling \#nextToken (and the underlying - /// stream may be closed). Closing may be due to an explicit - /// call to \#close or because parser has encountered - /// end of input. - ///@return {@code True} if this parser instance has been closed - bool isClosed() { - return _isClosed(reference.pointer).boolean; - } - - static final _getParsingContext = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getParsingContext") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonStreamContext getParsingContext() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be used to access current parsing context reader - /// is in. There are 3 different types: root, array and object contexts, - /// with slightly different available information. Contexts are - /// hierarchically nested, and can be used for example for figuring - /// out part of the input document that correspond to specific - /// array or object (for highlighting purposes, or error reporting). - /// 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.JObject getParsingContext() { - return _getParsingContext(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _currentLocation = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__currentLocation") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.JsonLocation currentLocation() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that returns location of the last processed input unit (character - /// or byte) from the input; - /// usually for error reporting purposes. - /// - /// Note that the location is not guaranteed to be accurate (although most - /// implementation will try their best): some implementations may only - /// report specific boundary locations (start or end locations of tokens) - /// and others only return JsonLocation\#NA due to not having access - /// to input location information (when delegating actual decoding work - /// to other library) - ///@return Location of the last processed input unit (byte or character) - ///@since 2.13 - jni.JObject currentLocation() { - return _currentLocation(reference.pointer).object(const jni.JObjectType()); - } - - static final _currentTokenLocation = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__currentTokenLocation") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that return the __starting__ location of the current - /// (most recently returned) - /// token; that is, the position of the first input unit (character or byte) from input - /// that starts the current token. - /// - /// Note that the location is not guaranteed to be accurate (although most - /// implementation will try their best): some implementations may only - /// return JsonLocation\#NA due to not having access - /// to input location information (when delegating actual decoding work - /// to other library) - ///@return Starting location of the token parser currently points to - ///@since 2.13 (will eventually replace \#getTokenLocation) - jni.JObject currentTokenLocation() { - return _currentTokenLocation(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _getCurrentLocation = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getCurrentLocation") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonLocation getCurrentLocation() - /// The returned object must be released after use, by calling the [release] method. - /// - /// 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.JObject getCurrentLocation() { - return _getCurrentLocation(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _getTokenLocation = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getTokenLocation") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonLocation getTokenLocation() - /// The returned object must be released after use, by calling the [release] method. - /// - /// 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.JObject getTokenLocation() { - return _getTokenLocation(reference.pointer).object(const jni.JObjectType()); - } - - static final _currentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__currentValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object currentValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Helper method, usually equivalent to: - /// - /// getParsingContext().getCurrentValue(); - /// - /// - /// Note that "current value" is NOT populated (or used) by Streaming parser; - /// it is only used by higher-level data-binding functionality. - /// The reason it is included here is that it can be stored and accessed hierarchically, - /// 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.JObject currentValue() { - return _currentValue(reference.pointer).object(const jni.JObjectType()); - } - - static final _assignCurrentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__assignCurrentValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void assignCurrentValue(java.lang.Object v) - /// - /// Helper method, usually equivalent to: - /// - /// getParsingContext().setCurrentValue(v); - /// - ///@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.JObject v, - ) { - _assignCurrentValue(reference.pointer, v.reference.pointer).check(); - } - - static final _getCurrentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getCurrentValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object getCurrentValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// 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.JObject getCurrentValue() { - return _getCurrentValue(reference.pointer).object(const jni.JObjectType()); - } - - static final _setCurrentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__setCurrentValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void setCurrentValue(java.lang.Object v) - /// - /// 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.JObject v, - ) { - _setCurrentValue(reference.pointer, v.reference.pointer).check(); - } - - static final _releaseBuffered = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__releaseBuffered") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public int releaseBuffered(java.io.OutputStream out) - /// - /// Method that can be called to push back any content that - /// has been read but not consumed by the parser. This is usually - /// done after reading all content of interest using parser. - /// Content is released by writing it to given stream if possible; - /// if underlying input is byte-based it can released, if not (char-based) - /// it can not. - ///@param out OutputStream to which buffered, undecoded content is written to - ///@return -1 if the underlying content source is not byte based - /// (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.JObject out, - ) { - return _releaseBuffered(reference.pointer, out.reference.pointer).integer; - } - - static final _releaseBuffered1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__releaseBuffered1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public int releaseBuffered(java.io.Writer w) - /// - /// Method that can be called to push back any content that - /// has been read but not consumed by the parser. - /// This is usually - /// done after reading all content of interest using parser. - /// Content is released by writing it to given writer if possible; - /// if underlying input is char-based it can released, if not (byte-based) - /// it can not. - ///@param w Writer to which buffered but unprocessed content is written to - ///@return -1 if the underlying content source is not char-based - /// (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.JObject w, - ) { - return _releaseBuffered1(reference.pointer, w.reference.pointer).integer; - } - - static final _enable = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__enable") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling specified parser feature - /// (check Feature for list of features) - ///@param f Feature to enable - ///@return This parser, to allow call chaining - JsonParser enable( - JsonParser_Feature f, - ) { - return _enable(reference.pointer, f.reference.pointer) - .object(const $JsonParserType()); - } - - static final _disable = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__disable") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for disabling specified feature - /// (check Feature for list of features) - ///@param f Feature to disable - ///@return This parser, to allow call chaining - JsonParser disable( - JsonParser_Feature f, - ) { - return _disable(reference.pointer, f.reference.pointer) - .object(const $JsonParserType()); - } - - static final _configure = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>("JsonParser__configure") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for enabling or disabling specified feature - /// (check Feature for list of features) - ///@param f Feature to enable or disable - ///@param state Whether to enable feature ({@code true}) or disable ({@code false}) - ///@return This parser, to allow call chaining - JsonParser configure( - JsonParser_Feature f, - bool state, - ) { - return _configure(reference.pointer, f.reference.pointer, state ? 1 : 0) - .object(const $JsonParserType()); - } - - static final _isEnabled = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__isEnabled") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f) - /// - /// Method for checking whether specified Feature is enabled. - ///@param f Feature to check - ///@return {@code True} if feature is enabled; {@code false} otherwise - bool isEnabled( - JsonParser_Feature f, - ) { - return _isEnabled(reference.pointer, f.reference.pointer).boolean; - } - - static final _isEnabled1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__isEnabled1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public boolean isEnabled(com.fasterxml.jackson.core.StreamReadFeature f) - /// - /// Method for checking whether specified Feature is enabled. - ///@param f Feature to check - ///@return {@code True} if feature is enabled; {@code false} otherwise - ///@since 2.10 - bool isEnabled1( - jni.JObject f, - ) { - return _isEnabled1(reference.pointer, f.reference.pointer).boolean; - } - - static final _getFeatureMask = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getFeatureMask") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getFeatureMask() - /// - /// Bulk access method for getting state of all standard Features. - ///@return Bit mask that defines current states of all standard Features. - ///@since 2.3 - int getFeatureMask() { - return _getFeatureMask(reference.pointer).integer; - } - - static final _setFeatureMask = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("JsonParser__setFeatureMask") - .asFunction, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser setFeatureMask(int mask) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Bulk set method for (re)setting states of all standard Features - ///@param mask Bit mask that defines set of features to enable - ///@return This parser, to allow call chaining - ///@since 2.3 - ///@deprecated Since 2.7, use \#overrideStdFeatures(int, int) instead - JsonParser setFeatureMask( - int mask, - ) { - return _setFeatureMask(reference.pointer, mask) - .object(const $JsonParserType()); - } - - static final _overrideStdFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Int32, - ffi.Int32)>>("JsonParser__overrideStdFeatures") - .asFunction, int, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser overrideStdFeatures(int values, int mask) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Bulk set method for (re)setting states of features specified by mask. - /// Functionally equivalent to - /// - /// int oldState = getFeatureMask(); - /// int newState = (oldState & ~mask) | (values & mask); - /// setFeatureMask(newState); - /// - /// but preferred as this lets caller more efficiently specify actual changes made. - ///@param values Bit mask of set/clear state for features to change - ///@param mask Bit mask of features to change - ///@return This parser, to allow call chaining - ///@since 2.6 - JsonParser overrideStdFeatures( - int values, - int mask, - ) { - return _overrideStdFeatures(reference.pointer, values, mask) - .object(const $JsonParserType()); - } - - static final _getFormatFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getFormatFeatures") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getFormatFeatures() - /// - /// Bulk access method for getting state of all FormatFeatures, format-specific - /// on/off configuration settings. - ///@return Bit mask that defines current states of all standard FormatFeatures. - ///@since 2.6 - int getFormatFeatures() { - return _getFormatFeatures(reference.pointer).integer; - } - - static final _overrideFormatFeatures = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Int32, - ffi.Int32)>>("JsonParser__overrideFormatFeatures") - .asFunction, int, int)>(); - - /// from: public com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values, int mask) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Bulk set method for (re)setting states of FormatFeatures, - /// by specifying values (set / clear) along with a mask, to determine - /// which features to change, if any. - /// - /// Default implementation will simply throw an exception to indicate that - /// the parser implementation does not support any FormatFeatures. - ///@param values Bit mask of set/clear state for features to change - ///@param mask Bit mask of features to change - ///@return This parser, to allow call chaining - ///@since 2.6 - JsonParser overrideFormatFeatures( - int values, - int mask, - ) { - return _overrideFormatFeatures(reference.pointer, values, mask) - .object(const $JsonParserType()); - } - - static final _nextToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__nextToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonToken nextToken() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Main iteration method, which will advance stream enough - /// to determine type of the next token, if any. If none - /// remaining (stream has no content other than possible - /// white space before ending), null will be returned. - ///@return Next token from the stream, if any found, or null - /// to indicate end-of-input - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jsontoken_.JsonToken nextToken() { - return _nextToken(reference.pointer) - .object(const jsontoken_.$JsonTokenType()); - } - - static final _nextValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__nextValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonToken nextValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Iteration method that will advance stream enough - /// to determine type of the next token that is a value type - /// (including JSON Array and Object start/end markers). - /// Or put another way, nextToken() will be called once, - /// and if JsonToken\#FIELD_NAME is returned, another - /// time to get the value for the field. - /// Method is most useful for iterating over value entries - /// of JSON objects; field name will still be available - /// by calling \#getCurrentName when parser points to - /// the value. - ///@return Next non-field-name token from the stream, if any found, - /// or null to indicate end-of-input (or, for non-blocking - /// parsers, JsonToken\#NOT_AVAILABLE if no tokens were - /// available yet) - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jsontoken_.JsonToken nextValue() { - return _nextValue(reference.pointer) - .object(const jsontoken_.$JsonTokenType()); - } - - static final _nextFieldName = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__nextFieldName") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString str) - /// - /// Method that fetches next token (as if calling \#nextToken) and - /// verifies whether it is JsonToken\#FIELD_NAME with specified name - /// and returns result of that comparison. - /// It is functionally equivalent to: - ///
-  ///  return (nextToken() == JsonToken.FIELD_NAME) && str.getValue().equals(getCurrentName());
-  ///
- /// but may be faster for parser to verify, and can therefore be used if caller - /// expects to get such a property name from input next. - ///@param str Property name to compare next token to (if next token is - /// JsonToken.FIELD_NAME) - ///@return {@code True} if parser advanced to {@code JsonToken.FIELD_NAME} with - /// 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.JObject str, - ) { - return _nextFieldName(reference.pointer, str.reference.pointer).boolean; - } - - static final _nextFieldName1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__nextFieldName1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String nextFieldName() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that fetches next token (as if calling \#nextToken) and - /// verifies whether it is JsonToken\#FIELD_NAME; if it is, - /// returns same as \#getCurrentName(), otherwise null. - ///@return Name of the the {@code JsonToken.FIELD_NAME} parser advanced to, if any; - /// {@code null} if next token is of some other type - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.5 - jni.JString nextFieldName1() { - return _nextFieldName1(reference.pointer).object(const jni.JStringType()); - } - - static final _nextTextValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__nextTextValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String nextTextValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that fetches next token (as if calling \#nextToken) and - /// if it is JsonToken\#VALUE_STRING returns contained String value; - /// otherwise returns null. - /// It is functionally equivalent to: - ///
-  ///  return (nextToken() == JsonToken.VALUE_STRING) ? getText() : null;
-  ///
- /// but may be faster for parser to process, and can therefore be used if caller - /// expects to get a String value next from input. - ///@return Text value of the {@code JsonToken.VALUE_STRING} 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.JString nextTextValue() { - return _nextTextValue(reference.pointer).object(const jni.JStringType()); - } - - static final _nextIntValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("JsonParser__nextIntValue") - .asFunction, int)>(); - - /// from: public int nextIntValue(int defaultValue) - /// - /// Method that fetches next token (as if calling \#nextToken) and - /// if it is JsonToken\#VALUE_NUMBER_INT returns 32-bit int value; - /// otherwise returns specified default value - /// It is functionally equivalent to: - ///
-  ///  return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? getIntValue() : defaultValue;
-  ///
- /// but may be faster for parser to process, and can therefore be used if caller - /// expects to get an int value next from input. - /// - /// NOTE: value checks are performed similar to \#getIntValue() - ///@param defaultValue Value to return if next token is NOT of type {@code JsonToken.VALUE_NUMBER_INT} - ///@return Integer ({@code int}) value of the {@code JsonToken.VALUE_NUMBER_INT} token parser advanced - /// to; or {@code defaultValue} if next token is of some other type - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@throws InputCoercionException if integer number does not fit in Java {@code int} - int nextIntValue( - int defaultValue, - ) { - return _nextIntValue(reference.pointer, defaultValue).integer; - } - - static final _nextLongValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int64)>>("JsonParser__nextLongValue") - .asFunction, int)>(); - - /// from: public long nextLongValue(long defaultValue) - /// - /// Method that fetches next token (as if calling \#nextToken) and - /// if it is JsonToken\#VALUE_NUMBER_INT returns 64-bit long value; - /// otherwise returns specified default value - /// It is functionally equivalent to: - ///
-  ///  return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? getLongValue() : defaultValue;
-  ///
- /// but may be faster for parser to process, and can therefore be used if caller - /// expects to get a long value next from input. - /// - /// NOTE: value checks are performed similar to \#getLongValue() - ///@param defaultValue Value to return if next token is NOT of type {@code JsonToken.VALUE_NUMBER_INT} - ///@return {@code long} value of the {@code JsonToken.VALUE_NUMBER_INT} token parser advanced - /// to; or {@code defaultValue} if next token is of some other type - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@throws InputCoercionException if integer number does not fit in Java {@code long} - int nextLongValue( - int defaultValue, - ) { - return _nextLongValue(reference.pointer, defaultValue).long; - } - - static final _nextBooleanValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__nextBooleanValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Boolean nextBooleanValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that fetches next token (as if calling \#nextToken) and - /// if it is JsonToken\#VALUE_TRUE or JsonToken\#VALUE_FALSE - /// returns matching Boolean value; otherwise return null. - /// It is functionally equivalent to: - ///
-  ///  JsonToken t = nextToken();
-  ///  if (t == JsonToken.VALUE_TRUE) return Boolean.TRUE;
-  ///  if (t == JsonToken.VALUE_FALSE) return Boolean.FALSE;
-  ///  return null;
-  ///
- /// but may be faster for parser to process, and can therefore be used if caller - /// expects to get a Boolean value next from input. - ///@return {@code Boolean} value of the {@code JsonToken.VALUE_TRUE} or {@code JsonToken.VALUE_FALSE} - /// 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.JBoolean nextBooleanValue() { - return _nextBooleanValue(reference.pointer) - .object(const jni.JBooleanType()); - } - - static final _skipChildren = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__skipChildren") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonParser skipChildren() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that will skip all child tokens of an array or - /// object token that the parser currently points to, - /// iff stream points to - /// JsonToken\#START_OBJECT or JsonToken\#START_ARRAY. - /// If not, it will do nothing. - /// After skipping, stream will point to __matching__ - /// JsonToken\#END_OBJECT or JsonToken\#END_ARRAY - /// (possibly skipping nested pairs of START/END OBJECT/ARRAY tokens - /// as well as value tokens). - /// The idea is that after calling this method, application - /// will call \#nextToken to point to the next - /// available token, if any. - ///@return This parser, to allow call chaining - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - JsonParser skipChildren() { - return _skipChildren(reference.pointer).object(const $JsonParserType()); - } - - static final _finishToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__finishToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public void finishToken() - /// - /// Method that may be used to force full handling of the current token - /// so that even if lazy processing is enabled, the whole contents are - /// read for possible retrieval. This is usually used to ensure that - /// the token end location is available, as well as token contents - /// (similar to what calling, say \#getTextCharacters(), would - /// achieve). - /// - /// Note that for many dataformat implementations this method - /// will not do anything; this is the default implementation unless - /// overridden by sub-classes. - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.8 - void finishToken() { - _finishToken(reference.pointer).check(); - } - - static final _currentToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__currentToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.fasterxml.jackson.core.JsonToken currentToken() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Accessor to find which token parser currently points to, if any; - /// null will be returned if none. - /// If return value is non-null, data associated with the token - /// is available via other accessor methods. - ///@return Type of the token this parser currently points to, - /// if any: null before any tokens have been read, and - /// after end-of-input has been encountered, as well as - /// if the current token has been explicitly cleared. - ///@since 2.8 - jsontoken_.JsonToken currentToken() { - return _currentToken(reference.pointer) - .object(const jsontoken_.$JsonTokenType()); - } - - static final _currentTokenId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__currentTokenId") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int currentTokenId() - /// - /// Method similar to \#getCurrentToken() but that returns an - /// int instead of JsonToken (enum value). - /// - /// Use of int directly is typically more efficient on switch statements, - /// so this method may be useful when building low-overhead codecs. - /// Note, however, that effect may not be big enough to matter: make sure - /// to profile performance before deciding to use this method. - ///@since 2.8 - ///@return {@code int} matching one of constants from JsonTokenId. - int currentTokenId() { - return _currentTokenId(reference.pointer).integer; - } - - static final _getCurrentToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getCurrentToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonToken getCurrentToken() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Alias for \#currentToken(), may be deprecated sometime after - /// Jackson 2.13 (will be removed from 3.0). - ///@return Type of the token this parser currently points to, - /// if any: null before any tokens have been read, and - jsontoken_.JsonToken getCurrentToken() { - return _getCurrentToken(reference.pointer) - .object(const jsontoken_.$JsonTokenType()); - } - - static final _getCurrentTokenId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getCurrentTokenId") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract int getCurrentTokenId() - /// - /// Deprecated alias for \#currentTokenId(). - ///@return {@code int} matching one of constants from JsonTokenId. - ///@deprecated Since 2.12 use \#currentTokenId instead - int getCurrentTokenId() { - return _getCurrentTokenId(reference.pointer).integer; - } - - static final _hasCurrentToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__hasCurrentToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract boolean hasCurrentToken() - /// - /// Method for checking whether parser currently points to - /// a token (and data for that token is available). - /// Equivalent to check for parser.getCurrentToken() != null. - ///@return True if the parser just returned a valid - /// token via \#nextToken; false otherwise (parser - /// was just constructed, encountered end-of-input - /// and returned null from \#nextToken, or the token - /// has been consumed) - bool hasCurrentToken() { - return _hasCurrentToken(reference.pointer).boolean; - } - - static final _hasTokenId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Int32)>>("JsonParser__hasTokenId") - .asFunction, int)>(); - - /// from: public abstract boolean hasTokenId(int id) - /// - /// Method that is functionally equivalent to: - /// - /// return currentTokenId() == id - /// - /// but may be more efficiently implemented. - /// - /// Note that no traversal or conversion is performed; so in some - /// cases calling method like \#isExpectedStartArrayToken() - /// is necessary instead. - ///@param id Token id to match (from (@link JsonTokenId}) - ///@return {@code True} if the parser current points to specified token - ///@since 2.5 - bool hasTokenId( - int id, - ) { - return _hasTokenId(reference.pointer, id).boolean; - } - - static final _hasToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__hasToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract boolean hasToken(com.fasterxml.jackson.core.JsonToken t) - /// - /// Method that is functionally equivalent to: - /// - /// return currentToken() == t - /// - /// but may be more efficiently implemented. - /// - /// Note that no traversal or conversion is performed; so in some - /// cases calling method like \#isExpectedStartArrayToken() - /// is necessary instead. - ///@param t Token to match - ///@return {@code True} if the parser current points to specified token - ///@since 2.6 - bool hasToken( - jsontoken_.JsonToken t, - ) { - return _hasToken(reference.pointer, t.reference.pointer).boolean; - } - - static final _isExpectedStartArrayToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__isExpectedStartArrayToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean isExpectedStartArrayToken() - /// - /// Specialized accessor that can be used to verify that the current - /// token indicates start array (usually meaning that current token - /// is JsonToken\#START_ARRAY) when start array is expected. - /// For some specialized parsers this can return true for other cases - /// as well; this is usually done to emulate arrays in cases underlying - /// format is ambiguous (XML, for example, has no format-level difference - /// between Objects and Arrays; it just has elements). - /// - /// Default implementation is equivalent to: - ///
-  ///   currentToken() == JsonToken.START_ARRAY
-  ///
- /// but may be overridden by custom parser implementations. - ///@return True if the current token can be considered as a - /// start-array marker (such JsonToken\#START_ARRAY); - /// {@code false} if not - bool isExpectedStartArrayToken() { - return _isExpectedStartArrayToken(reference.pointer).boolean; - } - - static final _isExpectedStartObjectToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__isExpectedStartObjectToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean isExpectedStartObjectToken() - /// - /// Similar to \#isExpectedStartArrayToken(), but checks whether stream - /// currently points to JsonToken\#START_OBJECT. - ///@return True if the current token can be considered as a - /// start-array marker (such JsonToken\#START_OBJECT); - /// {@code false} if not - ///@since 2.5 - bool isExpectedStartObjectToken() { - return _isExpectedStartObjectToken(reference.pointer).boolean; - } - - static final _isExpectedNumberIntToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__isExpectedNumberIntToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean isExpectedNumberIntToken() - /// - /// Similar to \#isExpectedStartArrayToken(), but checks whether stream - /// currently points to JsonToken\#VALUE_NUMBER_INT. - /// - /// The initial use case is for XML backend to efficiently (attempt to) coerce - /// textual content into numbers. - ///@return True if the current token can be considered as a - /// start-array marker (such JsonToken\#VALUE_NUMBER_INT); - /// {@code false} if not - ///@since 2.12 - bool isExpectedNumberIntToken() { - return _isExpectedNumberIntToken(reference.pointer).boolean; - } - - static final _isNaN = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__isNaN") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean isNaN() - /// - /// Access for checking whether current token is a numeric value token, but - /// one that is of "not-a-number" (NaN) variety (including both "NaN" AND - /// positive/negative infinity!): not supported by all formats, - /// but often supported for JsonToken\#VALUE_NUMBER_FLOAT. - /// NOTE: roughly equivalent to calling !Double.isFinite() - /// on value you would get from calling \#getDoubleValue(). - ///@return {@code True} if the current token is of type JsonToken\#VALUE_NUMBER_FLOAT - /// but represents a "Not a Number"; {@code false} for other tokens and regular - /// floating-point numbers - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.9 - bool isNaN() { - return _isNaN(reference.pointer).boolean; - } - - static final _clearCurrentToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__clearCurrentToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract void clearCurrentToken() - /// - /// Method called to "consume" the current token by effectively - /// removing it so that \#hasCurrentToken returns false, and - /// \#getCurrentToken null). - /// Cleared token value can still be accessed by calling - /// \#getLastClearedToken (if absolutely needed), but - /// usually isn't. - /// - /// Method was added to be used by the optional data binder, since - /// it has to be able to consume last token used for binding (so that - /// it will not be used again). - void clearCurrentToken() { - _clearCurrentToken(reference.pointer).check(); - } - - static final _getLastClearedToken = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getLastClearedToken") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonToken getLastClearedToken() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be called to get the last token that was - /// cleared using \#clearCurrentToken. This is not necessarily - /// the latest token read. - /// Will return null if no tokens have been cleared, - /// or if parser has been closed. - ///@return Last cleared token, if any; {@code null} otherwise - jsontoken_.JsonToken getLastClearedToken() { - return _getLastClearedToken(reference.pointer) - .object(const jsontoken_.$JsonTokenType()); - } - - static final _overrideCurrentName = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__overrideCurrentName") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract void overrideCurrentName(java.lang.String name) - /// - /// Method that can be used to change what is considered to be - /// the current (field) name. - /// May be needed to support non-JSON data formats or unusual binding - /// conventions; not needed for typical processing. - /// - /// 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.JString name, - ) { - _overrideCurrentName(reference.pointer, name.reference.pointer).check(); - } - - static final _getCurrentName = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getCurrentName") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract java.lang.String getCurrentName() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Alias of \#currentName(). - ///@return Name of the current field in the parsing context - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JString getCurrentName() { - return _getCurrentName(reference.pointer).object(const jni.JStringType()); - } - - static final _currentName = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__currentName") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String currentName() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be called to get the name associated with - /// the current token: for JsonToken\#FIELD_NAMEs it will - /// be the same as what \#getText returns; - /// for field values it will be preceding field name; - /// and for others (array values, root-level values) null. - ///@return Name of the current field in the parsing context - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.10 - jni.JString currentName() { - return _currentName(reference.pointer).object(const jni.JStringType()); - } - - static final _getText = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getText") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract java.lang.String getText() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for accessing textual representation of the current token; - /// if no current token (before first call to \#nextToken, or - /// after encountering end-of-input), returns null. - /// Method can be called for any token type. - ///@return Textual value associated with the current token (one returned - /// by \#nextToken() or other iteration methods) - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JString getText() { - return _getText(reference.pointer).object(const jni.JStringType()); - } - - static final _getText1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__getText1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public int getText(java.io.Writer writer) - /// - /// Method to read the textual representation of the current token in chunks and - /// pass it to the given Writer. - /// Conceptually same as calling: - ///
-  ///  writer.write(parser.getText());
-  ///
- /// but should typically be more efficient as longer content does need to - /// be combined into a single String to return, and write - /// can occur directly from intermediate buffers Jackson uses. - ///@param writer Writer to write textual content to - ///@return The number of characters written to the Writer - ///@throws IOException for low-level read issues or writes using passed - /// {@code writer}, or - /// JsonParseException for decoding problems - ///@since 2.8 - int getText1( - jni.JObject writer, - ) { - return _getText1(reference.pointer, writer.reference.pointer).integer; - } - - static final _getTextCharacters = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getTextCharacters") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract char[] getTextCharacters() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method similar to \#getText, but that will return - /// underlying (unmodifiable) character array that contains - /// textual value, instead of constructing a String object - /// to contain this information. - /// Note, however, that: - ///
    - ///
  • Textual contents are not guaranteed to start at - /// index 0 (rather, call \#getTextOffset) to - /// know the actual offset - ///
  • - ///
  • Length of textual contents may be less than the - /// length of returned buffer: call \#getTextLength - /// for actual length of returned content. - ///
  • - ///
- /// - /// Note that caller __MUST NOT__ modify the returned - /// character array in any way -- doing so may corrupt - /// current parser state and render parser instance useless. - /// - /// The only reason to call this method (over \#getText) - /// is to avoid construction of a String object (which - /// will make a copy of contents). - ///@return Buffer that contains the current textual value (but not necessarily - /// at offset 0, and not necessarily until the end of buffer) - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JArray getTextCharacters() { - return _getTextCharacters(reference.pointer) - .object(const jni.JArrayType(jni.jcharType())); - } - - static final _getTextLength = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getTextLength") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract int getTextLength() - /// - /// Accessor used with \#getTextCharacters, to know length - /// of String stored in returned buffer. - ///@return Number of characters within buffer returned - /// by \#getTextCharacters that are part of - /// textual content of the current token. - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getTextLength() { - return _getTextLength(reference.pointer).integer; - } - - static final _getTextOffset = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getTextOffset") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract int getTextOffset() - /// - /// Accessor used with \#getTextCharacters, to know offset - /// of the first text content character within buffer. - ///@return Offset of the first character within buffer returned - /// by \#getTextCharacters that is part of - /// textual content of the current token. - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getTextOffset() { - return _getTextOffset(reference.pointer).integer; - } - - static final _hasTextCharacters = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__hasTextCharacters") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract boolean hasTextCharacters() - /// - /// Method that can be used to determine whether calling of - /// \#getTextCharacters would be the most efficient - /// way to access textual content for the event parser currently - /// points to. - /// - /// Default implementation simply returns false since only actual - /// implementation class has knowledge of its internal buffering - /// state. - /// Implementations are strongly encouraged to properly override - /// this method, to allow efficient copying of content by other - /// code. - ///@return True if parser currently has character array that can - /// be efficiently returned via \#getTextCharacters; false - /// means that it may or may not exist - bool hasTextCharacters() { - return _hasTextCharacters(reference.pointer).boolean; - } - - static final _getNumberValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getNumberValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract java.lang.Number getNumberValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Generic number value accessor method that will work for - /// all kinds of numeric values. It will return the optimal - /// (simplest/smallest possible) wrapper object that can - /// express the numeric value just parsed. - ///@return Numeric value of the current token in its most optimal - /// representation - ///@throws IOException Problem with access: JsonParseException if - /// 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.JNumber getNumberValue() { - return _getNumberValue(reference.pointer).object(const jni.JNumberType()); - } - - static final _getNumberValueExact = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getNumberValueExact") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Number getNumberValueExact() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method similar to \#getNumberValue with the difference that - /// for floating-point numbers value returned may be BigDecimal - /// if the underlying format does not store floating-point numbers using - /// native representation: for example, textual formats represent numbers - /// as Strings (which are 10-based), and conversion to java.lang.Double - /// is potentially lossy operation. - /// - /// Default implementation simply returns \#getNumberValue() - ///@return Numeric value of the current token using most accurate representation - ///@throws IOException Problem with access: JsonParseException if - /// 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) - ///@since 2.12 - jni.JNumber getNumberValueExact() { - return _getNumberValueExact(reference.pointer) - .object(const jni.JNumberType()); - } - - static final _getNumberType = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getNumberType") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.fasterxml.jackson.core.JsonParser.NumberType getNumberType() - /// The returned object must be released after use, by calling the [release] method. - /// - /// If current token is of type - /// JsonToken\#VALUE_NUMBER_INT or - /// JsonToken\#VALUE_NUMBER_FLOAT, returns - /// one of NumberType constants; otherwise returns null. - ///@return Type of current number, if parser points to numeric token; {@code null} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - JsonParser_NumberType getNumberType() { - return _getNumberType(reference.pointer) - .object(const $JsonParser_NumberTypeType()); - } - - static final _getByteValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getByteValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public byte getByteValue() - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_INT and - /// it can be expressed as a value of Java byte primitive type. - /// Note that in addition to "natural" input range of {@code [-128, 127]}, - /// this also allows "unsigned 8-bit byte" values {@code [128, 255]}: - /// but for this range value will be translated by truncation, leading - /// to sign change. - /// - /// It can also be called for JsonToken\#VALUE_NUMBER_FLOAT; - /// if so, it is equivalent to calling \#getDoubleValue - /// and then casting; except for possible overflow/underflow - /// exception. - /// - /// Note: if the resulting integer value falls outside range of - /// {@code [-128, 255]}, - /// a InputCoercionException - /// will be thrown to indicate numeric overflow/underflow. - ///@return Current number value as {@code byte} (if numeric token within - /// range of {@code [-128, 255]}); otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getByteValue() { - return _getByteValue(reference.pointer).byte; - } - - static final _getShortValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getShortValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public short getShortValue() - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_INT and - /// it can be expressed as a value of Java short primitive type. - /// It can also be called for JsonToken\#VALUE_NUMBER_FLOAT; - /// if so, it is equivalent to calling \#getDoubleValue - /// and then casting; except for possible overflow/underflow - /// exception. - /// - /// Note: if the resulting integer value falls outside range of - /// Java short, a InputCoercionException - /// will be thrown to indicate numeric overflow/underflow. - ///@return Current number value as {@code short} (if numeric token within - /// Java 16-bit signed {@code short} range); otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getShortValue() { - return _getShortValue(reference.pointer).short; - } - - static final _getIntValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getIntValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract int getIntValue() - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_INT and - /// it can be expressed as a value of Java int primitive type. - /// It can also be called for JsonToken\#VALUE_NUMBER_FLOAT; - /// if so, it is equivalent to calling \#getDoubleValue - /// and then casting; except for possible overflow/underflow - /// exception. - /// - /// Note: if the resulting integer value falls outside range of - /// Java {@code int}, a InputCoercionException - /// may be thrown to indicate numeric overflow/underflow. - ///@return Current number value as {@code int} (if numeric token within - /// Java 32-bit signed {@code int} range); otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getIntValue() { - return _getIntValue(reference.pointer).integer; - } - - static final _getLongValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getLongValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract long getLongValue() - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_INT and - /// it can be expressed as a Java long primitive type. - /// It can also be called for JsonToken\#VALUE_NUMBER_FLOAT; - /// if so, it is equivalent to calling \#getDoubleValue - /// and then casting to int; except for possible overflow/underflow - /// exception. - /// - /// Note: if the token is an integer, but its value falls - /// outside of range of Java long, a InputCoercionException - /// may be thrown to indicate numeric overflow/underflow. - ///@return Current number value as {@code long} (if numeric token within - /// Java 32-bit signed {@code long} range); otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getLongValue() { - return _getLongValue(reference.pointer).long; - } - - static final _getBigIntegerValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getBigIntegerValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract java.math.BigInteger getBigIntegerValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_INT and - /// it can not be used as a Java long primitive type due to its - /// magnitude. - /// It can also be called for JsonToken\#VALUE_NUMBER_FLOAT; - /// if so, it is equivalent to calling \#getDecimalValue - /// and then constructing a BigInteger from that value. - ///@return Current number value as BigInteger (if numeric token); - /// otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JObject getBigIntegerValue() { - return _getBigIntegerValue(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _getFloatValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getFloatValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract float getFloatValue() - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_FLOAT and - /// it can be expressed as a Java float primitive type. - /// It can also be called for JsonToken\#VALUE_NUMBER_INT; - /// if so, it is equivalent to calling \#getLongValue - /// and then casting; except for possible overflow/underflow - /// exception. - /// - /// Note: if the value falls - /// outside of range of Java float, a InputCoercionException - /// will be thrown to indicate numeric overflow/underflow. - ///@return Current number value as {@code float} (if numeric token within - /// Java {@code float} range); otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - double getFloatValue() { - return _getFloatValue(reference.pointer).float; - } - - static final _getDoubleValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getDoubleValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract double getDoubleValue() - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_FLOAT and - /// it can be expressed as a Java double primitive type. - /// It can also be called for JsonToken\#VALUE_NUMBER_INT; - /// if so, it is equivalent to calling \#getLongValue - /// and then casting; except for possible overflow/underflow - /// exception. - /// - /// Note: if the value falls - /// outside of range of Java double, a InputCoercionException - /// will be thrown to indicate numeric overflow/underflow. - ///@return Current number value as {@code double} (if numeric token within - /// Java {@code double} range); otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - double getDoubleValue() { - return _getDoubleValue(reference.pointer).doubleFloat; - } - - static final _getDecimalValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getDecimalValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract java.math.BigDecimal getDecimalValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Numeric accessor that can be called when the current - /// token is of type JsonToken\#VALUE_NUMBER_FLOAT or - /// JsonToken\#VALUE_NUMBER_INT. No under/overflow exceptions - /// are ever thrown. - ///@return Current number value as BigDecimal (if numeric token); - /// otherwise exception thrown - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JObject getDecimalValue() { - return _getDecimalValue(reference.pointer).object(const jni.JObjectType()); - } - - static final _getBooleanValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getBooleanValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean getBooleanValue() - /// - /// Convenience accessor that can be called when the current - /// token is JsonToken\#VALUE_TRUE or - /// JsonToken\#VALUE_FALSE, to return matching {@code boolean} - /// value. - /// If the current token is of some other type, JsonParseException - /// will be thrown - ///@return {@code True} if current token is {@code JsonToken.VALUE_TRUE}, - /// {@code false} if current token is {@code JsonToken.VALUE_FALSE}; - /// otherwise throws JsonParseException - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - bool getBooleanValue() { - return _getBooleanValue(reference.pointer).boolean; - } - - static final _getEmbeddedObject = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getEmbeddedObject") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object getEmbeddedObject() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Accessor that can be called if (and only if) the current token - /// is JsonToken\#VALUE_EMBEDDED_OBJECT. For other token types, - /// null is returned. - /// - /// Note: only some specialized parser implementations support - /// embedding of objects (usually ones that are facades on top - /// of non-streaming sources, such as object trees). One exception - /// is access to binary content (whether via base64 encoding or not) - /// which typically is accessible using this method, as well as - /// \#getBinaryValue(). - ///@return Embedded value (usually of "native" type supported by format) - /// for the current token, if any; {@code null otherwise} - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JObject getEmbeddedObject() { - return _getEmbeddedObject(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _getBinaryValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__getBinaryValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant bv) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be used to read (and consume -- results - /// may not be accessible using other methods after the call) - /// base64-encoded binary data - /// included in the current textual JSON value. - /// It works similar to getting String value via \#getText - /// and decoding result (except for decoding part), - /// but should be significantly more performant. - /// - /// Note that non-decoded textual contents of the current token - /// are not guaranteed to be accessible after this method - /// is called. Current implementation, for example, clears up - /// textual content during decoding. - /// Decoded binary content, however, will be retained until - /// parser is advanced to the next event. - ///@param bv Expected variant of base64 encoded - /// content (see Base64Variants for definitions - /// of "standard" variants). - ///@return Decoded binary data - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JArray getBinaryValue( - jni.JObject bv, - ) { - return _getBinaryValue(reference.pointer, bv.reference.pointer) - .object(const jni.JArrayType(jni.jbyteType())); - } - - static final _getBinaryValue1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getBinaryValue1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public byte[] getBinaryValue() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Convenience alternative to \#getBinaryValue(Base64Variant) - /// that defaults to using - /// Base64Variants\#getDefaultVariant as the default encoding. - ///@return Decoded binary data - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - jni.JArray getBinaryValue1() { - return _getBinaryValue1(reference.pointer) - .object(const jni.JArrayType(jni.jbyteType())); - } - - static final _readBinaryValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__readBinaryValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public int readBinaryValue(java.io.OutputStream out) - /// - /// Method that can be used as an alternative to \#getBigIntegerValue(), - /// especially when value can be large. The main difference (beyond method - /// of returning content using OutputStream instead of as byte array) - /// is that content will NOT remain accessible after method returns: any content - /// processed will be consumed and is not buffered in any way. If caller needs - /// buffering, it has to implement it. - ///@param out Output stream to use for passing decoded binary data - ///@return Number of bytes that were decoded and written via OutputStream - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.1 - int readBinaryValue( - jni.JObject out, - ) { - return _readBinaryValue(reference.pointer, out.reference.pointer).integer; - } - - static final _readBinaryValue1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("JsonParser__readBinaryValue1") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public int readBinaryValue(com.fasterxml.jackson.core.Base64Variant bv, java.io.OutputStream out) - /// - /// Similar to \#readBinaryValue(OutputStream) but allows explicitly - /// specifying base64 variant to use. - ///@param bv base64 variant to use - ///@param out Output stream to use for passing decoded binary data - ///@return Number of bytes that were decoded and written via OutputStream - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.1 - int readBinaryValue1( - jni.JObject bv, - jni.JObject out, - ) { - return _readBinaryValue1( - reference.pointer, bv.reference.pointer, out.reference.pointer) - .integer; - } - - static final _getValueAsInt = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getValueAsInt") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getValueAsInt() - /// - /// Method that will try to convert value of current token to a - /// Java {@code int} value. - /// Numbers are coerced using default Java rules; booleans convert to 0 (false) - /// and 1 (true), and Strings are parsed using default Java language integer - /// parsing rules. - /// - /// If representation can not be converted to an int (including structured type - /// markers like start/end Object/Array) - /// default value of __0__ will be returned; no exceptions are thrown. - ///@return {@code int} value current token is converted to, if possible; exception thrown - /// otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getValueAsInt() { - return _getValueAsInt(reference.pointer).integer; - } - - static final _getValueAsInt1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("JsonParser__getValueAsInt1") - .asFunction, int)>(); - - /// from: public int getValueAsInt(int def) - /// - /// Method that will try to convert value of current token to a - /// __int__. - /// Numbers are coerced using default Java rules; booleans convert to 0 (false) - /// and 1 (true), and Strings are parsed using default Java language integer - /// parsing rules. - /// - /// If representation can not be converted to an int (including structured type - /// markers like start/end Object/Array) - /// specified __def__ will be returned; no exceptions are thrown. - ///@param def Default value to return if conversion to {@code int} is not possible - ///@return {@code int} value current token is converted to, if possible; {@code def} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getValueAsInt1( - int def, - ) { - return _getValueAsInt1(reference.pointer, def).integer; - } - - static final _getValueAsLong = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getValueAsLong") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public long getValueAsLong() - /// - /// Method that will try to convert value of current token to a - /// __long__. - /// Numbers are coerced using default Java rules; booleans convert to 0 (false) - /// and 1 (true), and Strings are parsed using default Java language integer - /// parsing rules. - /// - /// If representation can not be converted to a long (including structured type - /// markers like start/end Object/Array) - /// default value of __0L__ will be returned; no exceptions are thrown. - ///@return {@code long} value current token is converted to, if possible; exception thrown - /// otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getValueAsLong() { - return _getValueAsLong(reference.pointer).long; - } - - static final _getValueAsLong1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int64)>>("JsonParser__getValueAsLong1") - .asFunction, int)>(); - - /// from: public long getValueAsLong(long def) - /// - /// Method that will try to convert value of current token to a - /// __long__. - /// Numbers are coerced using default Java rules; booleans convert to 0 (false) - /// and 1 (true), and Strings are parsed using default Java language integer - /// parsing rules. - /// - /// If representation can not be converted to a long (including structured type - /// markers like start/end Object/Array) - /// specified __def__ will be returned; no exceptions are thrown. - ///@param def Default value to return if conversion to {@code long} is not possible - ///@return {@code long} value current token is converted to, if possible; {@code def} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - int getValueAsLong1( - int def, - ) { - return _getValueAsLong1(reference.pointer, def).long; - } - - static final _getValueAsDouble = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getValueAsDouble") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public double getValueAsDouble() - /// - /// Method that will try to convert value of current token to a Java - /// __double__. - /// Numbers are coerced using default Java rules; booleans convert to 0.0 (false) - /// and 1.0 (true), and Strings are parsed using default Java language floating - /// point parsing rules. - /// - /// If representation can not be converted to a double (including structured types - /// like Objects and Arrays), - /// default value of __0.0__ will be returned; no exceptions are thrown. - ///@return {@code double} value current token is converted to, if possible; exception thrown - /// otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - double getValueAsDouble() { - return _getValueAsDouble(reference.pointer).doubleFloat; - } - - static final _getValueAsDouble1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Double)>>("JsonParser__getValueAsDouble1") - .asFunction, double)>(); - - /// from: public double getValueAsDouble(double def) - /// - /// Method that will try to convert value of current token to a - /// Java __double__. - /// Numbers are coerced using default Java rules; booleans convert to 0.0 (false) - /// and 1.0 (true), and Strings are parsed using default Java language floating - /// point parsing rules. - /// - /// If representation can not be converted to a double (including structured types - /// like Objects and Arrays), - /// specified __def__ will be returned; no exceptions are thrown. - ///@param def Default value to return if conversion to {@code double} is not possible - ///@return {@code double} value current token is converted to, if possible; {@code def} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - double getValueAsDouble1( - double def, - ) { - return _getValueAsDouble1(reference.pointer, def).doubleFloat; - } - - static final _getValueAsBoolean = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getValueAsBoolean") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean getValueAsBoolean() - /// - /// Method that will try to convert value of current token to a - /// __boolean__. - /// JSON booleans map naturally; integer numbers other than 0 map to true, and - /// 0 maps to false - /// and Strings 'true' and 'false' map to corresponding values. - /// - /// If representation can not be converted to a boolean value (including structured types - /// like Objects and Arrays), - /// default value of __false__ will be returned; no exceptions are thrown. - ///@return {@code boolean} value current token is converted to, if possible; exception thrown - /// otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - bool getValueAsBoolean() { - return _getValueAsBoolean(reference.pointer).boolean; - } - - static final _getValueAsBoolean1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("JsonParser__getValueAsBoolean1") - .asFunction, int)>(); - - /// from: public boolean getValueAsBoolean(boolean def) - /// - /// Method that will try to convert value of current token to a - /// __boolean__. - /// JSON booleans map naturally; integer numbers other than 0 map to true, and - /// 0 maps to false - /// and Strings 'true' and 'false' map to corresponding values. - /// - /// If representation can not be converted to a boolean value (including structured types - /// like Objects and Arrays), - /// specified __def__ will be returned; no exceptions are thrown. - ///@param def Default value to return if conversion to {@code boolean} is not possible - ///@return {@code boolean} value current token is converted to, if possible; {@code def} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - bool getValueAsBoolean1( - bool def, - ) { - return _getValueAsBoolean1(reference.pointer, def ? 1 : 0).boolean; - } - - static final _getValueAsString = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getValueAsString") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String getValueAsString() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that will try to convert value of current token to a - /// java.lang.String. - /// JSON Strings map naturally; scalar values get converted to - /// their textual representation. - /// If representation can not be converted to a String value (including structured types - /// like Objects and Arrays and {@code null} token), default value of - /// __null__ will be returned; no exceptions are thrown. - ///@return String value current token is converted to, if possible; {@code null} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.1 - jni.JString getValueAsString() { - return _getValueAsString(reference.pointer).object(const jni.JStringType()); - } - - static final _getValueAsString1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__getValueAsString1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract java.lang.String getValueAsString(java.lang.String def) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that will try to convert value of current token to a - /// java.lang.String. - /// JSON Strings map naturally; scalar values get converted to - /// their textual representation. - /// If representation can not be converted to a String value (including structured types - /// like Objects and Arrays and {@code null} token), specified default value - /// will be returned; no exceptions are thrown. - ///@param def Default value to return if conversion to {@code String} is not possible - ///@return String value current token is converted to, if possible; {@code def} otherwise - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.1 - jni.JString getValueAsString1( - jni.JString def, - ) { - return _getValueAsString1(reference.pointer, def.reference.pointer) - .object(const jni.JStringType()); - } - - static final _canReadObjectId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__canReadObjectId") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean canReadObjectId() - /// - /// Introspection method that may be called to see if the underlying - /// data format supports some kind of Object Ids natively (many do not; - /// for example, JSON doesn't). - /// - /// Default implementation returns true; overridden by data formats - /// that do support native Object Ids. Caller is expected to either - /// use a non-native notation (explicit property or such), or fail, - /// in case it can not use native object ids. - ///@return {@code True} if the format being read supports native Object Ids; - /// {@code false} if not - ///@since 2.3 - bool canReadObjectId() { - return _canReadObjectId(reference.pointer).boolean; - } - - static final _canReadTypeId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__canReadTypeId") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean canReadTypeId() - /// - /// Introspection method that may be called to see if the underlying - /// data format supports some kind of Type Ids natively (many do not; - /// for example, JSON doesn't). - /// - /// Default implementation returns true; overridden by data formats - /// that do support native Type Ids. Caller is expected to either - /// use a non-native notation (explicit property or such), or fail, - /// in case it can not use native type ids. - ///@return {@code True} if the format being read supports native Type Ids; - /// {@code false} if not - ///@since 2.3 - bool canReadTypeId() { - return _canReadTypeId(reference.pointer).boolean; - } - - static final _getObjectId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getObjectId") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object getObjectId() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be called to check whether current token - /// (one that was just read) has an associated Object id, and if - /// so, return it. - /// Note that while typically caller should check with \#canReadObjectId - /// first, it is not illegal to call this method even if that method returns - /// true; but if so, it will return null. This may be used to simplify calling - /// code. - /// - /// Default implementation will simply return null. - ///@return Native Object id associated with the current token, if any; {@code null} if none - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.3 - jni.JObject getObjectId() { - return _getObjectId(reference.pointer).object(const jni.JObjectType()); - } - - static final _getTypeId = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__getTypeId") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object getTypeId() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method that can be called to check whether current token - /// (one that was just read) has an associated type id, and if - /// so, return it. - /// Note that while typically caller should check with \#canReadTypeId - /// first, it is not illegal to call this method even if that method returns - /// true; but if so, it will return null. This may be used to simplify calling - /// code. - /// - /// Default implementation will simply return null. - ///@return Native Type Id associated with the current token, if any; {@code null} if none - ///@throws IOException for low-level read issues, or - /// JsonParseException for decoding problems - ///@since 2.3 - jni.JObject getTypeId() { - return _getTypeId(reference.pointer).object(const jni.JObjectType()); - } - - static final _readValueAs = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__readValueAs") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public T readValueAs(java.lang.Class valueType) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method to deserialize JSON content into a non-container - /// type (it can be an array type, however): typically a bean, array - /// or a wrapper type (like java.lang.Boolean). - /// __Note__: method can only be called if the parser has - /// an object codec assigned; this is true for parsers constructed - /// by MappingJsonFactory (from "jackson-databind" jar) - /// but not for JsonFactory (unless its setCodec - /// method has been explicitly called). - /// - /// This method may advance the event stream, for structured types - /// the current token will be the closing end marker (END_ARRAY, - /// END_OBJECT) of the bound structure. For non-structured Json types - /// (and for JsonToken\#VALUE_EMBEDDED_OBJECT) - /// stream is not advanced. - /// - /// Note: this method should NOT be used if the result type is a - /// container (java.util.Collection or java.util.Map. - /// The reason is that due to type erasure, key and value types - /// can not be introspected when using this method. - ///@param Nominal type parameter for value type - ///@param valueType Java type to read content as (passed to ObjectCodec that - /// deserializes content) - ///@return Java value read from content - ///@throws IOException if there is either an underlying I/O problem or decoding - /// issue at format layer - $T readValueAs<$T extends jni.JObject>( - jni.JObject valueType, { - required jni.JObjType<$T> T, - }) { - return _readValueAs(reference.pointer, valueType.reference.pointer) - .object(T); - } - - static final _readValueAs1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__readValueAs1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public T readValueAs(com.fasterxml.jackson.core.type.TypeReference valueTypeRef) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method to deserialize JSON content into a Java type, reference - /// to which is passed as argument. Type is passed using so-called - /// "super type token" - /// and specifically needs to be used if the root type is a - /// parameterized (generic) container type. - /// __Note__: method can only be called if the parser has - /// an object codec assigned; this is true for parsers constructed - /// by MappingJsonFactory (defined in 'jackson-databind' bundle) - /// but not for JsonFactory (unless its setCodec - /// method has been explicitly called). - /// - /// This method may advance the event stream, for structured types - /// the current token will be the closing end marker (END_ARRAY, - /// END_OBJECT) of the bound structure. For non-structured Json types - /// (and for JsonToken\#VALUE_EMBEDDED_OBJECT) - /// stream is not advanced. - ///@param Nominal type parameter for value type - ///@param valueTypeRef Java type to read content as (passed to ObjectCodec that - /// deserializes content) - ///@return Java value read from content - ///@throws IOException if there is either an underlying I/O problem or decoding - /// issue at format layer - $T readValueAs1<$T extends jni.JObject>( - jni.JObject valueTypeRef, { - required jni.JObjType<$T> T, - }) { - return _readValueAs1(reference.pointer, valueTypeRef.reference.pointer) - .object(T); - } - - static final _readValuesAs = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__readValuesAs") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public java.util.Iterator readValuesAs(java.lang.Class valueType) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for reading sequence of Objects from parser stream, - /// all with same specified value type. - ///@param Nominal type parameter for value type - ///@param valueType Java type to read content as (passed to ObjectCodec that - /// deserializes content) - ///@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.JIterator<$T> readValuesAs<$T extends jni.JObject>( - jni.JObject valueType, { - required jni.JObjType<$T> T, - }) { - return _readValuesAs(reference.pointer, valueType.reference.pointer) - .object(jni.JIteratorType(T)); - } - - static final _readValuesAs1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("JsonParser__readValuesAs1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public java.util.Iterator readValuesAs(com.fasterxml.jackson.core.type.TypeReference valueTypeRef) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method for reading sequence of Objects from parser stream, - /// all with same specified value type. - ///@param Nominal type parameter for value type - ///@param valueTypeRef Java type to read content as (passed to ObjectCodec that - /// deserializes content) - ///@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.JIterator<$T> readValuesAs1<$T extends jni.JObject>( - jni.JObject valueTypeRef, { - required jni.JObjType<$T> T, - }) { - return _readValuesAs1(reference.pointer, valueTypeRef.reference.pointer) - .object(jni.JIteratorType(T)); - } - - static final _readValueAsTree = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonParser__readValueAsTree") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public T readValueAsTree() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Method to deserialize JSON content into equivalent "tree model", - /// represented by root TreeNode of resulting model. - /// For JSON Arrays it will an array node (with child nodes), - /// for objects object node (with child nodes), and for other types - /// matching leaf node type. Empty or whitespace documents are null. - ///@param Nominal type parameter for result node type (to reduce need for casting) - ///@return root of the document, or null if empty or whitespace. - ///@throws IOException if there is either an underlying I/O problem or decoding - /// issue at format layer - $T readValueAsTree<$T extends jni.JObject>({ - required jni.JObjType<$T> T, - }) { - return _readValueAsTree(reference.pointer).object(T); - } -} - -final class $JsonParserType extends jni.JObjType { - const $JsonParserType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonParser;"; - - @override - JsonParser fromReference(jni.JReference reference) => - JsonParser.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonParserType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonParserType) && other is $JsonParserType; - } -} diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart deleted file mode 100644 index a9da47b82..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart +++ /dev/null @@ -1,277 +0,0 @@ -// Generated from jackson-core which is licensed under the Apache License 2.0. -// The following copyright from the original authors applies. -// See https://github.com/FasterXML/jackson-core/blob/2.14/LICENSE -// -// Copyright (c) 2007 - The Jackson Project Authors -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Autogenerated by jnigen. DO NOT EDIT! - -// ignore_for_file: annotate_overrides -// ignore_for_file: camel_case_extensions -// ignore_for_file: camel_case_types -// ignore_for_file: constant_identifier_names -// ignore_for_file: doc_directive_unknown -// ignore_for_file: file_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: overridden_fields -// ignore_for_file: unnecessary_cast -// ignore_for_file: unused_element -// ignore_for_file: unused_field -// ignore_for_file: unused_import -// ignore_for_file: unused_local_variable -// ignore_for_file: unused_shown_name -// ignore_for_file: use_super_parameters - -import "dart:isolate" show ReceivePort; -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; -import "package:jni/jni.dart" as jni; - -import "../../../../_init.dart"; - -/// from: com.fasterxml.jackson.core.JsonToken -/// -/// Enumeration for basic token types used for returning results -/// of parsing JSON content. -class JsonToken extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonToken.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonTokenType(); - static final _values = - jniLookup>( - "JsonToken__values") - .asFunction(); - - /// from: static public com.fasterxml.jackson.core.JsonToken[] values() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values().object(const jni.JArrayType($JsonTokenType())); - } - - static final _valueOf = jniLookup< - ffi - .NativeFunction)>>( - "JsonToken__valueOf") - .asFunction)>(); - - /// from: static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name) - /// The returned object must be released after use, by calling the [release] method. - static JsonToken valueOf( - jni.JString name, - ) { - return _valueOf(name.reference.pointer).object(const $JsonTokenType()); - } - - static final _id = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__id") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final int id() - int id() { - return _id(reference.pointer).integer; - } - - static final _asString = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__asString") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final java.lang.String asString() - /// The returned object must be released after use, by calling the [release] method. - jni.JString asString() { - return _asString(reference.pointer).object(const jni.JStringType()); - } - - static final _asCharArray = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__asCharArray") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final char[] asCharArray() - /// The returned object must be released after use, by calling the [release] method. - jni.JArray asCharArray() { - return _asCharArray(reference.pointer) - .object(const jni.JArrayType(jni.jcharType())); - } - - static final _asByteArray = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__asByteArray") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final byte[] asByteArray() - /// The returned object must be released after use, by calling the [release] method. - jni.JArray asByteArray() { - return _asByteArray(reference.pointer) - .object(const jni.JArrayType(jni.jbyteType())); - } - - static final _isNumeric = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__isNumeric") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final boolean isNumeric() - /// - /// @return {@code True} if this token is {@code VALUE_NUMBER_INT} or {@code VALUE_NUMBER_FLOAT}, - /// {@code false} otherwise - bool isNumeric() { - return _isNumeric(reference.pointer).boolean; - } - - static final _isStructStart = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__isStructStart") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final boolean isStructStart() - /// - /// Accessor that is functionally equivalent to: - /// - /// this == JsonToken.START_OBJECT || this == JsonToken.START_ARRAY - /// - ///@return {@code True} if this token is {@code START_OBJECT} or {@code START_ARRAY}, - /// {@code false} otherwise - ///@since 2.3 - bool isStructStart() { - return _isStructStart(reference.pointer).boolean; - } - - static final _isStructEnd = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__isStructEnd") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final boolean isStructEnd() - /// - /// Accessor that is functionally equivalent to: - /// - /// this == JsonToken.END_OBJECT || this == JsonToken.END_ARRAY - /// - ///@return {@code True} if this token is {@code END_OBJECT} or {@code END_ARRAY}, - /// {@code false} otherwise - ///@since 2.3 - bool isStructEnd() { - return _isStructEnd(reference.pointer).boolean; - } - - static final _isScalarValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__isScalarValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final boolean isScalarValue() - /// - /// Method that can be used to check whether this token represents - /// a valid non-structured value. This means all {@code VALUE_xxx} tokens; - /// excluding {@code START_xxx} and {@code END_xxx} tokens as well - /// {@code FIELD_NAME}. - ///@return {@code True} if this token is a scalar value token (one of - /// {@code VALUE_xxx} tokens), {@code false} otherwise - bool isScalarValue() { - return _isScalarValue(reference.pointer).boolean; - } - - static final _isBoolean = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonToken__isBoolean") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final boolean isBoolean() - /// - /// @return {@code True} if this token is {@code VALUE_TRUE} or {@code VALUE_FALSE}, - /// {@code false} otherwise - bool isBoolean() { - return _isBoolean(reference.pointer).boolean; - } -} - -final class $JsonTokenType extends jni.JObjType { - const $JsonTokenType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonToken;"; - - @override - JsonToken fromReference(jni.JReference reference) => - JsonToken.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonTokenType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonTokenType) && other is $JsonTokenType; - } -} diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/_package.dart b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/_package.dart deleted file mode 100644 index cae2a52e6..000000000 --- a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/_package.dart +++ /dev/null @@ -1,3 +0,0 @@ -export "JsonFactory.dart"; -export "JsonParser.dart"; -export "JsonToken.dart"; diff --git a/pkgs/jnigen/test/kotlin_test/dart_only/dart_bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart similarity index 100% rename from pkgs/jnigen/test/kotlin_test/dart_only/dart_bindings/kotlin.dart rename to pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart diff --git a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/.clang-format b/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/CMakeLists.txt b/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/CMakeLists.txt deleted file mode 100644 index 3889f546a..000000000 --- a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(kotlin VERSION 0.0.1 LANGUAGES C) - -add_library(kotlin SHARED - "./kotlin.c" -) - -set_target_properties(kotlin PROPERTIES - OUTPUT_NAME "kotlin" -) - -target_compile_definitions(kotlin PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(kotlin log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(kotlin ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/dartjni.h b/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c b/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c deleted file mode 100644 index e3c227e6a..000000000 --- a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// com.github.dart_lang.jnigen.SuspendFun -jclass _c_SuspendFun = NULL; - -jmethodID _m_SuspendFun__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult SuspendFun__new0() { - load_env(); - load_class_global_ref(&_c_SuspendFun, - "com/github/dart_lang/jnigen/SuspendFun"); - if (_c_SuspendFun == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_SuspendFun, &_m_SuspendFun__new0, "", "()V"); - if (_m_SuspendFun__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_SuspendFun, _m_SuspendFun__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_SuspendFun__sayHello = NULL; -FFI_PLUGIN_EXPORT -JniResult SuspendFun__sayHello(jobject self_, jobject continuation) { - load_env(); - load_class_global_ref(&_c_SuspendFun, - "com/github/dart_lang/jnigen/SuspendFun"); - if (_c_SuspendFun == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_SuspendFun, &_m_SuspendFun__sayHello, "sayHello", - "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"); - if (_m_SuspendFun__sayHello == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_SuspendFun__sayHello, continuation); - return to_global_ref_result(_result); -} - -jmethodID _m_SuspendFun__sayHello1 = NULL; -FFI_PLUGIN_EXPORT -JniResult SuspendFun__sayHello1(jobject self_, - jobject string, - jobject continuation) { - load_env(); - load_class_global_ref(&_c_SuspendFun, - "com/github/dart_lang/jnigen/SuspendFun"); - if (_c_SuspendFun == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_SuspendFun, &_m_SuspendFun__sayHello1, "sayHello", - "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"); - if (_m_SuspendFun__sayHello1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_SuspendFun__sayHello1, string, continuation); - return to_global_ref_result(_result); -} diff --git a/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart deleted file mode 100644 index e221edbdb..000000000 --- a/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Autogenerated by jnigen. DO NOT EDIT! - -// ignore_for_file: annotate_overrides -// ignore_for_file: camel_case_extensions -// ignore_for_file: camel_case_types -// ignore_for_file: constant_identifier_names -// ignore_for_file: doc_directive_unknown -// ignore_for_file: file_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: overridden_fields -// ignore_for_file: unnecessary_cast -// ignore_for_file: unused_element -// ignore_for_file: unused_field -// ignore_for_file: unused_import -// ignore_for_file: unused_local_variable -// ignore_for_file: unused_shown_name -// ignore_for_file: use_super_parameters - -import "dart:isolate" show ReceivePort; -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; -import "package:jni/jni.dart" as jni; - -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("kotlin"); - -/// from: com.github.dart_lang.jnigen.SuspendFun -class SuspendFun extends jni.JObject { - @override - late final jni.JObjType $type = type; - - SuspendFun.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $SuspendFunType(); - static final _new0 = jniLookup>( - "SuspendFun__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory SuspendFun() { - return SuspendFun.fromReference(_new0().reference); - } - - static final _sayHello = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("SuspendFun__sayHello") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation) - /// The returned object must be released after use, by calling the [release] method. - Future sayHello() async { - final $p = ReceivePort(); - final $c = jni.JObject.fromReference( - ProtectedJniExtensions.newPortContinuation($p)); - _sayHello(reference.pointer, $c.reference.pointer) - .object(const jni.JObjectType()); - final $o = jni.JGlobalReference(jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const jni.JStringType().jClass.reference.pointer; - if (!jni.Jni.env.IsInstanceOf($o.pointer, $k)) { - throw "Failed"; - } - return const jni.JStringType().fromReference($o); - } - - static final _sayHello1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("SuspendFun__sayHello1") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation) - /// The returned object must be released after use, by calling the [release] method. - Future sayHello1( - jni.JString string, - ) async { - final $p = ReceivePort(); - final $c = jni.JObject.fromReference( - ProtectedJniExtensions.newPortContinuation($p)); - _sayHello1( - reference.pointer, string.reference.pointer, $c.reference.pointer) - .object(const jni.JObjectType()); - final $o = jni.JGlobalReference(jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const jni.JStringType().jClass.reference.pointer; - if (!jni.Jni.env.IsInstanceOf($o.pointer, $k)) { - throw "Failed"; - } - return const jni.JStringType().fromReference($o); - } -} - -final class $SuspendFunType extends jni.JObjType { - const $SuspendFunType(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/SuspendFun;"; - - @override - SuspendFun fromReference(jni.JReference reference) => - SuspendFun.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($SuspendFunType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($SuspendFunType) && other is $SuspendFunType; - } -} diff --git a/pkgs/jnigen/test/kotlin_test/generate.dart b/pkgs/jnigen/test/kotlin_test/generate.dart index 61686679a..f8fc1e1b3 100644 --- a/pkgs/jnigen/test/kotlin_test/generate.dart +++ b/pkgs/jnigen/test/kotlin_test/generate.dart @@ -35,12 +35,10 @@ void compileKotlinSources(String workingDir) async { } } -Config getConfig([BindingsType bindingsType = BindingsType.cBased]) { +Config getConfig() { compileKotlinSources(kotlinPath); - final typeDir = bindingsType.getConfigString(); - final cWrapperDir = Uri.directory(join(testRoot, typeDir, "c_bindings")); final dartWrappersRoot = Uri.directory( - join(testRoot, typeDir, "dart_bindings"), + join(testRoot, 'bindings'), ); final config = Config( classPath: [Uri.file(jarPath)], @@ -53,11 +51,6 @@ Config getConfig([BindingsType bindingsType = BindingsType.cBased]) { ], logLevel: Level.ALL, outputConfig: OutputConfig( - bindingsType: bindingsType, - cConfig: CCodeOutputConfig( - path: cWrapperDir, - libraryName: 'kotlin', - ), dartConfig: DartCodeOutputConfig( path: dartWrappersRoot.resolve('kotlin.dart'), structure: OutputStructure.singleFile, @@ -70,6 +63,5 @@ Config getConfig([BindingsType bindingsType = BindingsType.cBased]) { } void main() async { - await generateJniBindings(getConfig(BindingsType.cBased)); - await generateJniBindings(getConfig(BindingsType.dartOnly)); + await generateJniBindings(getConfig()); } diff --git a/pkgs/jnigen/test/kotlin_test/generated_files_test.dart b/pkgs/jnigen/test/kotlin_test/generated_files_test.dart index b96c643ca..5c081f323 100644 --- a/pkgs/jnigen/test/kotlin_test/generated_files_test.dart +++ b/pkgs/jnigen/test/kotlin_test/generated_files_test.dart @@ -2,9 +2,6 @@ // 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 'package:jnigen/jnigen.dart'; -import 'package:test/test.dart'; - import 'generate.dart'; import '../test_util/test_util.dart'; @@ -12,19 +9,8 @@ void main() async { // This is not run in setupAll, because we want to exit with one line of // error message, not throw a long exception. await checkLocallyBuiltDependencies(); - generateAndCompareBothModes( + generateAndCompare( 'Generate and compare bindings for kotlin_test', - getConfig(BindingsType.cBased), - getConfig(BindingsType.dartOnly), - ); - test( - "Generate and analyze bindings for kotlin_test - pure dart", - () async { - await generateAndAnalyzeBindings( - getConfig(BindingsType.dartOnly), - ); - }, - timeout: const Timeout.factor(1.5), - tags: largeTestTag, + getConfig(), ); } diff --git a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart index 6a9696b6e..a8f3807a4 100644 --- a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart @@ -7,7 +7,7 @@ import 'package:jni/jni.dart'; import '../test_util/callback_types.dart'; -import 'c_based/dart_bindings/kotlin.dart'; +import 'bindings/kotlin.dart'; void registerTests(String groupName, TestRunnerCallback test) { group(groupName, () { diff --git a/pkgs/jnigen/test/runtime_test.dart b/pkgs/jnigen/test/runtime_test.dart new file mode 100644 index 000000000..a43180963 --- /dev/null +++ b/pkgs/jnigen/test/runtime_test.dart @@ -0,0 +1,21 @@ +// Generated file. Do not edit or check-in to version control. + +// Copyright (c) 2023, 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 'package:test/test.dart'; +import 'test_util/bindings_test_setup.dart' as setup; + +import "jackson_core_test/runtime_test_registrant.dart" as jackson_core_test; +import "simple_package_test/runtime_test_registrant.dart" + as simple_package_test; +import "kotlin_test/runtime_test_registrant.dart" as kotlin_test; + +void main() { + setUpAll(setup.bindingsTestSetup); + jackson_core_test.registerTests("jackson_core_test_dart_only", test); + simple_package_test.registerTests("simple_package_test_dart_only", test); + kotlin_test.registerTests("kotlin_test_c_based", test); + tearDownAll(setup.bindingsTestTeardown); +} diff --git a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart similarity index 100% rename from pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart rename to pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart diff --git a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/.clang-format b/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/.clang-format deleted file mode 100644 index a256c2f09..000000000 --- a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -# From dart SDK: https://github.com/dart-lang/sdk/blob/main/.clang-format - -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium - -# clang-format doesn't seem to do a good job of this for longer comments. -ReflowComments: 'false' - -# We have lots of these. Though we need to put them all in curly braces, -# clang-format can't do that. -AllowShortIfStatementsOnASingleLine: 'true' - -# Put escaped newlines into the rightmost column. -AlignEscapedNewlinesLeft: false diff --git a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/CMakeLists.txt b/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/CMakeLists.txt deleted file mode 100644 index eeb352dc0..000000000 --- a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# jni_native_build (Build with jni:setup. Do not delete this line.) - -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(simple_package VERSION 0.0.1 LANGUAGES C) - -add_library(simple_package SHARED - "./simple_package.c" -) - -set_target_properties(simple_package PROPERTIES - OUTPUT_NAME "simple_package" -) - -target_compile_definitions(simple_package PUBLIC DART_SHARED_LIB) - -if(WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES - LINK_FLAGS "/DELAYLOAD:jvm.dll") -endif() - -if (ANDROID) - target_link_libraries(simple_package log) -else() - find_package(Java REQUIRED) - find_package(JNI REQUIRED) - include_directories(${JNI_INCLUDE_DIRS}) - target_link_libraries(simple_package ${JNI_LIBRARIES}) -endif() diff --git a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/dartjni.h b/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/dartjni.h deleted file mode 100644 index f834d1577..000000000 --- a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/dartjni.h +++ /dev/null @@ -1,383 +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. - -#pragma once - -// Note: include appropriate system jni.h as found by CMake, not third_party/jni.h. -#include -#include -#include -#include - -#if _WIN32 -#include -#else -#include -#include -#endif - -#if _WIN32 -#define FFI_PLUGIN_EXPORT __declspec(dllexport) -#else -#define FFI_PLUGIN_EXPORT -#endif - -#if defined _WIN32 -#define thread_local __declspec(thread) -#else -#define thread_local __thread -#endif - -#ifdef __ANDROID__ -#include -#endif - -#ifdef __ANDROID__ -#define __ENVP_CAST (JNIEnv**) -#else -#define __ENVP_CAST (void**) -#endif - -/// Locking functions for windows and pthread. - -#if defined _WIN32 -#include - -typedef CRITICAL_SECTION MutexLock; -typedef CONDITION_VARIABLE ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - InitializeCriticalSection(lock); -} - -static inline void acquire_lock(MutexLock* lock) { - EnterCriticalSection(lock); -} - -static inline void release_lock(MutexLock* lock) { - LeaveCriticalSection(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - DeleteCriticalSection(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - InitializeConditionVariable(cond); -} - -static inline void signal_cond(ConditionVariable* cond) { - WakeConditionVariable(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - SleepConditionVariableCS(cond, lock, INFINITE); -} - -static inline void destroy_cond(ConditionVariable* cond) { - // Not available. -} - -static inline void free_mem(void* mem) { - CoTaskMemFree(mem); -} - -#elif defined __APPLE__ || defined __LINUX__ || defined __ANDROID__ || \ - defined __GNUC__ -#include - -typedef pthread_mutex_t MutexLock; -typedef pthread_cond_t ConditionVariable; - -static inline void init_lock(MutexLock* lock) { - pthread_mutex_init(lock, NULL); -} - -static inline void acquire_lock(MutexLock* lock) { - pthread_mutex_lock(lock); -} - -static inline void release_lock(MutexLock* lock) { - pthread_mutex_unlock(lock); -} - -static inline void destroy_lock(MutexLock* lock) { - pthread_mutex_destroy(lock); -} - -static inline void init_cond(ConditionVariable* cond) { - pthread_cond_init(cond, NULL); -} - -static inline void signal_cond(ConditionVariable* cond) { - pthread_cond_signal(cond); -} - -static inline void wait_for(ConditionVariable* cond, MutexLock* lock) { - pthread_cond_wait(cond, lock); -} - -static inline void destroy_cond(ConditionVariable* cond) { - pthread_cond_destroy(cond); -} - -static inline void free_mem(void* mem) { - free(mem); -} - -#else - -#error "No locking/condition variable support; Possibly unsupported platform" - -#endif - -typedef struct CallbackResult { - MutexLock lock; - ConditionVariable cond; - int ready; - jobject object; -} CallbackResult; - -typedef struct JniLocks { - MutexLock classLoadingLock; -} JniLocks; - -/// Represents the error when dart-jni layer has already spawned singleton VM. -#define DART_JNI_SINGLETON_EXISTS (-99); - -/// Stores the global state of the JNI. -typedef struct JniContext { - JavaVM* jvm; - jobject classLoader; - jmethodID loadClassMethod; - jobject currentActivity; - jobject appContext; - JniLocks locks; -} JniContext; - -// jniEnv for this thread, used by inline functions in this header, -// therefore declared as extern. -extern thread_local JNIEnv* jniEnv; - -extern JniContext* jni; - -/// Types used by JNI API to distinguish between primitive types. -enum JniType { - booleanType = 0, - byteType = 1, - shortType = 2, - charType = 3, - intType = 4, - longType = 5, - floatType = 6, - doubleType = 7, - objectType = 8, - voidType = 9, -}; - -/// Result type for use by JNI. -/// -/// If [exception] is null, it means the result is valid. -/// It's assumed that the caller knows the expected type in [result]. -typedef struct JniResult { - jvalue value; - jthrowable exception; -} JniResult; - -/// Similar to [JniResult] but for class lookups. -typedef struct JniClassLookupResult { - jclass value; - jthrowable exception; -} JniClassLookupResult; - -/// Similar to [JniResult] but for method/field ID lookups. -typedef struct JniPointerResult { - const void* value; - jthrowable exception; -} JniPointerResult; - -/// JniExceptionDetails holds 2 jstring objects, one is the result of -/// calling `toString` on exception object, other is stack trace; -typedef struct JniExceptionDetails { - jstring message; - jstring stacktrace; -} JniExceptionDetails; - -/// This struct contains functions which wrap method call / field access conveniently along with -/// exception checking. -/// -/// Flutter embedding checks for pending JNI exceptions before an FFI transition, which requires us -/// to check for and clear the exception before returning to dart code, which requires these functions -/// to return result types. -typedef struct JniAccessorsStruct { - JniClassLookupResult (*getClass)(char* internalName); - JniPointerResult (*getFieldID)(jclass cls, char* fieldName, char* signature); - JniPointerResult (*getStaticFieldID)(jclass cls, - char* fieldName, - char* signature); - JniPointerResult (*getMethodID)(jclass cls, - char* methodName, - char* signature); - JniPointerResult (*getStaticMethodID)(jclass cls, - char* methodName, - char* signature); - JniResult (*newObject)(jclass cls, jmethodID ctor, jvalue* args); - JniResult (*newPrimitiveArray)(jsize length, int type); - JniResult (*newObjectArray)(jsize length, - jclass elementClass, - jobject initialElement); - JniResult (*getArrayElement)(jarray array, int index, int type); - JniResult (*callMethod)(jobject obj, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*callStaticMethod)(jclass cls, - jmethodID methodID, - int callType, - jvalue* args); - JniResult (*getField)(jobject obj, jfieldID fieldID, int callType); - JniResult (*getStaticField)(jclass cls, jfieldID fieldID, int callType); - JniExceptionDetails (*getExceptionDetails)(jthrowable exception); -} JniAccessorsStruct; - -FFI_PLUGIN_EXPORT JniAccessorsStruct* GetAccessors(); - -FFI_PLUGIN_EXPORT JavaVM* GetJavaVM(void); - -FFI_PLUGIN_EXPORT JNIEnv* GetJniEnv(void); - -/// Spawn a JVM with given arguments. -/// -/// Returns JNI_OK on success, and one of the documented JNI error codes on -/// failure. It returns DART_JNI_SINGLETON_EXISTS if an attempt to spawn multiple -/// JVMs is made, even if the underlying API potentially supports multiple VMs. -FFI_PLUGIN_EXPORT int SpawnJvm(JavaVMInitArgs* args); - -/// Returns Application classLoader (on Android), -/// which can be used to load application and platform classes. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetClassLoader(void); - -/// Returns application context on Android. -/// -/// On other platforms, NULL is returned. -FFI_PLUGIN_EXPORT jobject GetApplicationContext(void); - -/// Returns current activity of the app on Android. -FFI_PLUGIN_EXPORT jobject GetCurrentActivity(void); - -static inline void attach_thread() { - if (jniEnv == NULL) { - (*jni->jvm)->AttachCurrentThread(jni->jvm, __ENVP_CAST & jniEnv, NULL); - } -} - -/// Load class into [cls] using platform specific mechanism -static inline void load_class_platform(jclass* cls, const char* name) { -#ifdef __ANDROID__ - jstring className = (*jniEnv)->NewStringUTF(jniEnv, name); - *cls = (*jniEnv)->CallObjectMethod(jniEnv, jni->classLoader, - jni->loadClassMethod, className); - (*jniEnv)->DeleteLocalRef(jniEnv, className); -#else - *cls = (*jniEnv)->FindClass(jniEnv, name); -#endif -} - -static inline void load_class_global_ref(jclass* cls, const char* name) { - if (*cls == NULL) { - jclass tmp = NULL; - acquire_lock(&jni->locks.classLoadingLock); - if (*cls == NULL) { - load_class_platform(&tmp, name); - if (!(*jniEnv)->ExceptionCheck(jniEnv)) { - *cls = (*jniEnv)->NewGlobalRef(jniEnv, tmp); - (*jniEnv)->DeleteLocalRef(jniEnv, tmp); - } - } - release_lock(&jni->locks.classLoadingLock); - } -} - -static inline void load_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_method(jclass cls, - jmethodID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticMethodID(jniEnv, cls, name, sig); - } -} - -static inline void load_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetFieldID(jniEnv, cls, name, sig); - } -} - -static inline void load_static_field(jclass cls, - jfieldID* res, - const char* name, - const char* sig) { - if (*res == NULL) { - *res = (*jniEnv)->GetStaticFieldID(jniEnv, cls, name, sig); - } -} - -static inline jobject to_global_ref(jobject ref) { - jobject g = (*jniEnv)->NewGlobalRef(jniEnv, ref); - (*jniEnv)->DeleteLocalRef(jniEnv, ref); - return g; -} - -// These functions are useful for C+Dart bindings, and not required for pure dart bindings. - -FFI_PLUGIN_EXPORT JniContext* GetJniContextPtr(); - -/// For use by jni_gen's generated code -/// don't use these. - -// these 2 fn ptr vars will be defined by generated code library -extern JniContext* (*context_getter)(void); -extern JNIEnv* (*env_getter)(void); - -// this function will be exported by generated code library -// it will set above 2 variables. -FFI_PLUGIN_EXPORT void setJniGetters(struct JniContext* (*cg)(void), - JNIEnv* (*eg)(void)); - -static inline void load_env() { - if (jniEnv == NULL) { - jni = context_getter(); - jniEnv = env_getter(); - } -} - -static inline jthrowable check_exception() { - jthrowable exception = (*jniEnv)->ExceptionOccurred(jniEnv); - if (exception != NULL) (*jniEnv)->ExceptionClear(jniEnv); - if (exception == NULL) return NULL; - return to_global_ref(exception); -} - -static inline JniResult to_global_ref_result(jobject ref) { - JniResult result; - result.exception = check_exception(); - if (result.exception == NULL) { - result.value.l = to_global_ref(ref); - } - return result; -} diff --git a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c b/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c deleted file mode 100644 index 54d6b884d..000000000 --- a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c +++ /dev/null @@ -1,2991 +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. - -// Autogenerated by jnigen. DO NOT EDIT! - -#include -#include "dartjni.h" -#include "jni.h" - -thread_local JNIEnv* jniEnv; -JniContext* jni; - -JniContext* (*context_getter)(void); -JNIEnv* (*env_getter)(void); - -void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { - context_getter = cg; - env_getter = eg; -} - -// com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice -jclass _c_Example_Nested_NestedTwice = NULL; - -jmethodID _m_Example_Nested_NestedTwice__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example_Nested_NestedTwice__new0() { - load_env(); - load_class_global_ref( - &_c_Example_Nested_NestedTwice, - "com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice"); - if (_c_Example_Nested_NestedTwice == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_Nested_NestedTwice, - &_m_Example_Nested_NestedTwice__new0, "", "()V"); - if (_m_Example_Nested_NestedTwice__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example_Nested_NestedTwice, - _m_Example_Nested_NestedTwice__new0); - return to_global_ref_result(_result); -} - -jfieldID _f_Example_Nested_NestedTwice__ZERO = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Example_Nested_NestedTwice__ZERO() { - load_env(); - load_class_global_ref( - &_c_Example_Nested_NestedTwice, - "com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice"); - if (_c_Example_Nested_NestedTwice == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Example_Nested_NestedTwice, - &_f_Example_Nested_NestedTwice__ZERO, "ZERO", "I"); - int32_t _result = - (*jniEnv)->GetStaticIntField(jniEnv, _c_Example_Nested_NestedTwice, - _f_Example_Nested_NestedTwice__ZERO); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Example_Nested_NestedTwice__ZERO(int32_t value) { - load_env(); - load_class_global_ref( - &_c_Example_Nested_NestedTwice, - "com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice"); - if (_c_Example_Nested_NestedTwice == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Example_Nested_NestedTwice, - &_f_Example_Nested_NestedTwice__ZERO, "ZERO", "I"); - (*jniEnv)->SetStaticIntField(jniEnv, _c_Example_Nested_NestedTwice, - _f_Example_Nested_NestedTwice__ZERO, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.simple_package.Example$Nested -jclass _c_Example_Nested = NULL; - -jmethodID _m_Example_Nested__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example_Nested__new0(uint8_t value) { - load_env(); - load_class_global_ref( - &_c_Example_Nested, - "com/github/dart_lang/jnigen/simple_package/Example$Nested"); - if (_c_Example_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_Nested, &_m_Example_Nested__new0, "", "(Z)V"); - if (_m_Example_Nested__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example_Nested, - _m_Example_Nested__new0, value); - return to_global_ref_result(_result); -} - -jmethodID _m_Example_Nested__usesAnonymousInnerClass = NULL; -FFI_PLUGIN_EXPORT -JniResult Example_Nested__usesAnonymousInnerClass(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Example_Nested, - "com/github/dart_lang/jnigen/simple_package/Example$Nested"); - if (_c_Example_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_Nested, &_m_Example_Nested__usesAnonymousInnerClass, - "usesAnonymousInnerClass", "()V"); - if (_m_Example_Nested__usesAnonymousInnerClass == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_Example_Nested__usesAnonymousInnerClass); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example_Nested__getValue = NULL; -FFI_PLUGIN_EXPORT -JniResult Example_Nested__getValue(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Example_Nested, - "com/github/dart_lang/jnigen/simple_package/Example$Nested"); - if (_c_Example_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_Nested, &_m_Example_Nested__getValue, "getValue", - "()Z"); - if (_m_Example_Nested__getValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_Example_Nested__getValue); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example_Nested__setValue = NULL; -FFI_PLUGIN_EXPORT -JniResult Example_Nested__setValue(jobject self_, uint8_t value) { - load_env(); - load_class_global_ref( - &_c_Example_Nested, - "com/github/dart_lang/jnigen/simple_package/Example$Nested"); - if (_c_Example_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_Nested, &_m_Example_Nested__setValue, "setValue", - "(Z)V"); - if (_m_Example_Nested__setValue == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example_Nested__setValue, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested -jclass _c_Example_NonStaticNested = NULL; - -jmethodID _m_Example_NonStaticNested__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example_NonStaticNested__new0(jobject _parent) { - load_env(); - load_class_global_ref( - &_c_Example_NonStaticNested, - "com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested"); - if (_c_Example_NonStaticNested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_NonStaticNested, &_m_Example_NonStaticNested__new0, - "", - "(Lcom/github/dart_lang/jnigen/simple_package/Example;)V"); - if (_m_Example_NonStaticNested__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example_NonStaticNested, - _m_Example_NonStaticNested__new0, _parent); - return to_global_ref_result(_result); -} - -jfieldID _f_Example_NonStaticNested__ok = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Example_NonStaticNested__ok(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Example_NonStaticNested, - "com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested"); - if (_c_Example_NonStaticNested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Example_NonStaticNested, &_f_Example_NonStaticNested__ok, "ok", - "Z"); - uint8_t _result = - (*jniEnv)->GetBooleanField(jniEnv, self_, _f_Example_NonStaticNested__ok); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Example_NonStaticNested__ok(jobject self_, uint8_t value) { - load_env(); - load_class_global_ref( - &_c_Example_NonStaticNested, - "com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested"); - if (_c_Example_NonStaticNested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Example_NonStaticNested, &_f_Example_NonStaticNested__ok, "ok", - "Z"); - (*jniEnv)->SetBooleanField(jniEnv, self_, _f_Example_NonStaticNested__ok, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.simple_package.Example -jclass _c_Example = NULL; - -jmethodID _m_Example__getAmount = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getAmount() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__getAmount, "getAmount", "()I"); - if (_m_Example__getAmount == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallStaticIntMethod(jniEnv, _c_Example, _m_Example__getAmount); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getPi = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getPi() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__getPi, "getPi", "()D"); - if (_m_Example__getPi == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - double _result = - (*jniEnv)->CallStaticDoubleMethod(jniEnv, _c_Example, _m_Example__getPi); - return (JniResult){.value = {.d = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getAsterisk = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getAsterisk() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__getAsterisk, "getAsterisk", - "()C"); - if (_m_Example__getAsterisk == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint16_t _result = (*jniEnv)->CallStaticCharMethod(jniEnv, _c_Example, - _m_Example__getAsterisk); - return (JniResult){.value = {.c = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getName = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getName() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__getName, "getName", - "()Ljava/lang/String;"); - if (_m_Example__getName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_Example, - _m_Example__getName); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__getNestedInstance = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getNestedInstance() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_Example, &_m_Example__getNestedInstance, "getNestedInstance", - "()Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;"); - if (_m_Example__getNestedInstance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_Example, _m_Example__getNestedInstance); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__setAmount = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setAmount(int32_t newAmount) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__setAmount, "setAmount", "(I)V"); - if (_m_Example__setAmount == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Example, _m_Example__setAmount, - newAmount); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__setName = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setName(jobject newName) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__setName, "setName", - "(Ljava/lang/String;)V"); - if (_m_Example__setName == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Example, _m_Example__setName, - newName); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__setNestedInstance = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setNestedInstance(jobject newNested) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_Example, &_m_Example__setNestedInstance, "setNestedInstance", - "(Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;)V"); - if (_m_Example__setNestedInstance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Example, - _m_Example__setNestedInstance, newNested); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__max4 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__max4(int32_t a, int32_t b, int32_t c, int32_t d) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__max4, "max4", "(IIII)I"); - if (_m_Example__max4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod( - jniEnv, _c_Example, _m_Example__max4, a, b, c, d); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__max8 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__max8(int32_t a, - int32_t b, - int32_t c, - int32_t d, - int32_t e, - int32_t f, - int32_t g, - int32_t h) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__max8, "max8", "(IIIIIIII)I"); - if (_m_Example__max8 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod( - jniEnv, _c_Example, _m_Example__max8, a, b, c, d, e, f, g, h); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getNumber = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getNumber(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getNumber, "getNumber", "()I"); - if (_m_Example__getNumber == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Example__getNumber); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__setNumber = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setNumber(jobject self_, int32_t number) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__setNumber, "setNumber", "(I)V"); - if (_m_Example__setNumber == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__setNumber, number); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__getIsUp = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getIsUp(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getIsUp, "getIsUp", "()Z"); - if (_m_Example__getIsUp == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_Example__getIsUp); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__setUp = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setUp(jobject self_, uint8_t isUp) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__setUp, "setUp", "(Z)V"); - if (_m_Example__setUp == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__setUp, isUp); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__getCodename = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getCodename(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getCodename, "getCodename", - "()Ljava/lang/String;"); - if (_m_Example__getCodename == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Example__getCodename); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__setCodename = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setCodename(jobject self_, jobject codename) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__setCodename, "setCodename", - "(Ljava/lang/String;)V"); - if (_m_Example__setCodename == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__setCodename, codename); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__getRandom = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getRandom(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getRandom, "getRandom", - "()Ljava/util/Random;"); - if (_m_Example__getRandom == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Example__getRandom); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__setRandom = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__setRandom(jobject self_, jobject random) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__setRandom, "setRandom", - "(Ljava/util/Random;)V"); - if (_m_Example__setRandom == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__setRandom, random); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__getRandomLong = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getRandomLong(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getRandomLong, "getRandomLong", "()J"); - if (_m_Example__getRandomLong == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = - (*jniEnv)->CallLongMethod(jniEnv, self_, _m_Example__getRandomLong); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__add4Longs = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__add4Longs(jobject self_, - int64_t a, - int64_t b, - int64_t c, - int64_t d) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__add4Longs, "add4Longs", "(JJJJ)J"); - if (_m_Example__add4Longs == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_Example__add4Longs, a, b, c, d); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__add8Longs = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__add8Longs(jobject self_, - int64_t a, - int64_t b, - int64_t c, - int64_t d, - int64_t e, - int64_t f, - int64_t g, - int64_t h) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__add8Longs, "add8Longs", "(JJJJJJJJ)J"); - if (_m_Example__add8Longs == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_Example__add8Longs, a, b, c, d, e, f, g, h); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getRandomNumericString = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getRandomNumericString(jobject self_, jobject random) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getRandomNumericString, - "getRandomNumericString", - "(Ljava/util/Random;)Ljava/lang/String;"); - if (_m_Example__getRandomNumericString == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Example__getRandomNumericString, random); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__protectedMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__protectedMethod(jobject self_, jobject a, jobject b) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__protectedMethod, "protectedMethod", - "(Ljava/lang/String;Ljava/lang/String;)V"); - if (_m_Example__protectedMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__protectedMethod, a, b); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__finalMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__finalMethod(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__finalMethod, "finalMethod", "()V"); - if (_m_Example__finalMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__finalMethod); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__getList = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getList(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getList, "getList", - "()Ljava/util/List;"); - if (_m_Example__getList == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Example__getList); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__joinStrings = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__joinStrings(jobject self_, jobject values, jobject delim) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__joinStrings, "joinStrings", - "(Ljava/util/List;Ljava/lang/String;)Ljava/lang/String;"); - if (_m_Example__joinStrings == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Example__joinStrings, values, delim); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__methodWithSeveralParams = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__methodWithSeveralParams(jobject self_, - uint16_t ch, - jobject s, - jobject a, - jobject t, - jobject lt, - jobject wm) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__methodWithSeveralParams, - "methodWithSeveralParams", - "(CLjava/lang/String;[ILjava/lang/CharSequence;Ljava/util/" - "List;Ljava/util/Map;)V"); - if (_m_Example__methodWithSeveralParams == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__methodWithSeveralParams, - ch, s, a, t, lt, wm); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__new0() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__new0, "", "()V"); - if (_m_Example__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__new1(int32_t number) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__new1, "", "(I)V"); - if (_m_Example__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new1, number); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__new2 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__new2(int32_t number, uint8_t isUp) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__new2, "", "(IZ)V"); - if (_m_Example__new2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new2, number, isUp); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__new3 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__new3(int32_t number, uint8_t isUp, jobject codename) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__new3, "", - "(IZLjava/lang/String;)V"); - if (_m_Example__new3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new3, - number, isUp, codename); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__new4 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__new4(int32_t a, - int32_t b, - int32_t c, - int32_t d, - int32_t e, - int32_t f, - int32_t g, - int32_t h) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__new4, "", "(IIIIIIII)V"); - if (_m_Example__new4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new4, - a, b, c, d, e, f, g, h); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__whichExample = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__whichExample(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__whichExample, "whichExample", "()I"); - if (_m_Example__whichExample == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Example__whichExample); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__addInts = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__addInts(int32_t a, int32_t b) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__addInts, "addInts", "(II)I"); - if (_m_Example__addInts == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod(jniEnv, _c_Example, - _m_Example__addInts, a, b); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getArr = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getArr() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__getArr, "getArr", "()[I"); - if (_m_Example__getArr == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_Example, _m_Example__getArr); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__addAll = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__addAll(jobject arr) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__addAll, "addAll", "([I)I"); - if (_m_Example__addAll == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod(jniEnv, _c_Example, - _m_Example__addAll, arr); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Example__getSelf = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__getSelf(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__getSelf, "getSelf", - "()Lcom/github/dart_lang/jnigen/simple_package/Example;"); - if (_m_Example__getSelf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Example__getSelf); - return to_global_ref_result(_result); -} - -jmethodID _m_Example__throwException = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__throwException() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Example, &_m_Example__throwException, "throwException", - "()V"); - if (_m_Example__throwException == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Example, - _m_Example__throwException); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__overloaded = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__overloaded(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__overloaded, "overloaded", "()V"); - if (_m_Example__overloaded == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__overloaded); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__overloaded1 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__overloaded1(jobject self_, int32_t a, jobject b) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__overloaded1, "overloaded", - "(ILjava/lang/String;)V"); - if (_m_Example__overloaded1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__overloaded1, a, b); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__overloaded2 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__overloaded2(jobject self_, int32_t a) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__overloaded2, "overloaded", "(I)V"); - if (_m_Example__overloaded2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__overloaded2, a); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__overloaded3 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__overloaded3(jobject self_, jobject a, jobject b) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__overloaded3, "overloaded", - "(Ljava/util/List;Ljava/lang/String;)V"); - if (_m_Example__overloaded3 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__overloaded3, a, b); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_Example__overloaded4 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example__overloaded4(jobject self_, jobject a) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__overloaded4, "overloaded", - "(Ljava/util/List;)V"); - if (_m_Example__overloaded4 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_Example__overloaded4, a); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Example__SEMICOLON_STRING = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Example__SEMICOLON_STRING() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Example, &_f_Example__SEMICOLON_STRING, - "SEMICOLON_STRING", "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField( - jniEnv, _c_Example, _f_Example__SEMICOLON_STRING); - return to_global_ref_result(_result); -} - -jfieldID _f_Example__unusedRandom = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Example__unusedRandom() { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Example, &_f_Example__unusedRandom, "unusedRandom", - "Ljava/util/Random;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Example, - _f_Example__unusedRandom); - return to_global_ref_result(_result); -} - -jfieldID _f_Example__protectedField = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Example__protectedField(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Example, &_f_Example__protectedField, "protectedField", - "Ljava/util/Random;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_Example__protectedField); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_Example__protectedField(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_Example, - "com/github/dart_lang/jnigen/simple_package/Example"); - if (_c_Example == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Example, &_f_Example__protectedField, "protectedField", - "Ljava/util/Random;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_Example__protectedField, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.pkg2.C2 -jclass _c_C2 = NULL; - -jmethodID _m_C2__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult C2__new0() { - load_env(); - load_class_global_ref(&_c_C2, "com/github/dart_lang/jnigen/pkg2/C2"); - if (_c_C2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_C2, &_m_C2__new0, "", "()V"); - if (_m_C2__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_C2, _m_C2__new0); - return to_global_ref_result(_result); -} - -jfieldID _f_C2__CONSTANT = NULL; -FFI_PLUGIN_EXPORT -JniResult get_C2__CONSTANT() { - load_env(); - load_class_global_ref(&_c_C2, "com/github/dart_lang/jnigen/pkg2/C2"); - if (_c_C2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_C2, &_f_C2__CONSTANT, "CONSTANT", "I"); - int32_t _result = - (*jniEnv)->GetStaticIntField(jniEnv, _c_C2, _f_C2__CONSTANT); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_C2__CONSTANT(int32_t value) { - load_env(); - load_class_global_ref(&_c_C2, "com/github/dart_lang/jnigen/pkg2/C2"); - if (_c_C2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_C2, &_f_C2__CONSTANT, "CONSTANT", "I"); - (*jniEnv)->SetStaticIntField(jniEnv, _c_C2, _f_C2__CONSTANT, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.pkg2.Example -jclass _c_Example1 = NULL; - -jmethodID _m_Example1__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Example1__new0() { - load_env(); - load_class_global_ref(&_c_Example1, - "com/github/dart_lang/jnigen/pkg2/Example"); - if (_c_Example1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example1, &_m_Example1__new0, "", "()V"); - if (_m_Example1__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example1, _m_Example1__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_Example1__whichExample = NULL; -FFI_PLUGIN_EXPORT -JniResult Example1__whichExample(jobject self_) { - load_env(); - load_class_global_ref(&_c_Example1, - "com/github/dart_lang/jnigen/pkg2/Example"); - if (_c_Example1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example1, &_m_Example1__whichExample, "whichExample", "()I"); - if (_m_Example1__whichExample == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Example1__whichExample); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child -jclass _c_GrandParent_Parent_Child = NULL; - -jmethodID _m_GrandParent_Parent_Child__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent_Parent_Child__new0(jobject _parent, jobject newValue) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent_Parent_Child, &_m_GrandParent_Parent_Child__new0, - "", - "(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/" - "lang/Object;)V"); - if (_m_GrandParent_Parent_Child__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GrandParent_Parent_Child, - _m_GrandParent_Parent_Child__new0, - _parent, newValue); - return to_global_ref_result(_result); -} - -jfieldID _f_GrandParent_Parent_Child__grandParentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent_Child__grandParentValue(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent_Child, - &_f_GrandParent_Parent_Child__grandParentValue, "grandParentValue", - "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_Parent_Child__grandParentValue); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_Parent_Child__grandParentValue(jobject self_, - jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent_Child, - &_f_GrandParent_Parent_Child__grandParentValue, "grandParentValue", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField( - jniEnv, self_, _f_GrandParent_Parent_Child__grandParentValue, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_GrandParent_Parent_Child__parentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent_Child__parentValue(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent_Child, - &_f_GrandParent_Parent_Child__parentValue, "parentValue", - "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_Parent_Child__parentValue); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_Parent_Child__parentValue(jobject self_, - jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent_Child, - &_f_GrandParent_Parent_Child__parentValue, "parentValue", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, - _f_GrandParent_Parent_Child__parentValue, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_GrandParent_Parent_Child__value = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent_Child__value(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent_Child, &_f_GrandParent_Parent_Child__value, - "value", "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_Parent_Child__value); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_Parent_Child__value(jobject self_, jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); - if (_c_GrandParent_Parent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent_Child, &_f_GrandParent_Parent_Child__value, - "value", "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_GrandParent_Parent_Child__value, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.GrandParent$Parent -jclass _c_GrandParent_Parent = NULL; - -jmethodID _m_GrandParent_Parent__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent_Parent__new0(jobject _parent, jobject newValue) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent_Parent, &_m_GrandParent_Parent__new0, "", - "(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/" - "Object;)V"); - if (_m_GrandParent_Parent__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_GrandParent_Parent, - _m_GrandParent_Parent__new0, _parent, newValue); - return to_global_ref_result(_result); -} - -jfieldID _f_GrandParent_Parent__parentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent__parentValue(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent, &_f_GrandParent_Parent__parentValue, - "parentValue", "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_Parent__parentValue); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_Parent__parentValue(jobject self_, jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent, &_f_GrandParent_Parent__parentValue, - "parentValue", "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_GrandParent_Parent__parentValue, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_GrandParent_Parent__value = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent__value(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent, &_f_GrandParent_Parent__value, "value", - "Ljava/lang/Object;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_GrandParent_Parent__value); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_Parent__value(jobject self_, jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent, &_f_GrandParent_Parent__value, "value", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_GrandParent_Parent__value, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child -jclass _c_GrandParent_StaticParent_Child = NULL; - -jmethodID _m_GrandParent_StaticParent_Child__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent_StaticParent_Child__new0(jobject _parent, - jobject parentValue, - jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); - if (_c_GrandParent_StaticParent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_GrandParent_StaticParent_Child, - &_m_GrandParent_StaticParent_Child__new0, "", - "(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/" - "lang/Object;Ljava/lang/Object;)V"); - if (_m_GrandParent_StaticParent_Child__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_GrandParent_StaticParent_Child, - _m_GrandParent_StaticParent_Child__new0, _parent, parentValue, value); - return to_global_ref_result(_result); -} - -jfieldID _f_GrandParent_StaticParent_Child__parentValue = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_StaticParent_Child__parentValue(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); - if (_c_GrandParent_StaticParent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_StaticParent_Child, - &_f_GrandParent_StaticParent_Child__parentValue, "parentValue", - "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_StaticParent_Child__parentValue); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_StaticParent_Child__parentValue(jobject self_, - jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); - if (_c_GrandParent_StaticParent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_StaticParent_Child, - &_f_GrandParent_StaticParent_Child__parentValue, "parentValue", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField( - jniEnv, self_, _f_GrandParent_StaticParent_Child__parentValue, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_GrandParent_StaticParent_Child__value = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_StaticParent_Child__value(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); - if (_c_GrandParent_StaticParent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_StaticParent_Child, - &_f_GrandParent_StaticParent_Child__value, "value", - "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_StaticParent_Child__value); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_StaticParent_Child__value(jobject self_, - jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent_Child, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); - if (_c_GrandParent_StaticParent_Child == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_StaticParent_Child, - &_f_GrandParent_StaticParent_Child__value, "value", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, - _f_GrandParent_StaticParent_Child__value, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.GrandParent$StaticParent -jclass _c_GrandParent_StaticParent = NULL; - -jmethodID _m_GrandParent_StaticParent__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent_StaticParent__new0(jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - if (_c_GrandParent_StaticParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent_StaticParent, &_m_GrandParent_StaticParent__new0, - "", "(Ljava/lang/Object;)V"); - if (_m_GrandParent_StaticParent__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_GrandParent_StaticParent, - _m_GrandParent_StaticParent__new0, value); - return to_global_ref_result(_result); -} - -jfieldID _f_GrandParent_StaticParent__value = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent_StaticParent__value(jobject self_) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - if (_c_GrandParent_StaticParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_StaticParent, &_f_GrandParent_StaticParent__value, - "value", "Ljava/lang/Object;"); - jobject _result = (*jniEnv)->GetObjectField( - jniEnv, self_, _f_GrandParent_StaticParent__value); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent_StaticParent__value(jobject self_, jobject value) { - load_env(); - load_class_global_ref( - &_c_GrandParent_StaticParent, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - if (_c_GrandParent_StaticParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_StaticParent, &_f_GrandParent_StaticParent__value, - "value", "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_GrandParent_StaticParent__value, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.GrandParent -jclass _c_GrandParent = NULL; - -jmethodID _m_GrandParent__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent__new0(jobject value) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent, &_m_GrandParent__new0, "", - "(Ljava/lang/Object;)V"); - if (_m_GrandParent__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_GrandParent, _m_GrandParent__new0, value); - return to_global_ref_result(_result); -} - -jmethodID _m_GrandParent__stringParent = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent__stringParent(jobject self_) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent, &_m_GrandParent__stringParent, "stringParent", - "()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); - if (_m_GrandParent__stringParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_GrandParent__stringParent); - return to_global_ref_result(_result); -} - -jmethodID _m_GrandParent__varParent = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent__varParent(jobject self_, jobject nestedValue) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent, &_m_GrandParent__varParent, "varParent", - "(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/" - "GrandParent$Parent;"); - if (_m_GrandParent__varParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_GrandParent__varParent, nestedValue); - return to_global_ref_result(_result); -} - -jmethodID _m_GrandParent__stringStaticParent = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent__stringStaticParent() { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_GrandParent, &_m_GrandParent__stringStaticParent, "stringStaticParent", - "()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); - if (_m_GrandParent__stringStaticParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_GrandParent, _m_GrandParent__stringStaticParent); - return to_global_ref_result(_result); -} - -jmethodID _m_GrandParent__varStaticParent = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent__varStaticParent(jobject value) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_GrandParent, &_m_GrandParent__varStaticParent, - "varStaticParent", - "(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/" - "generics/GrandParent$StaticParent;"); - if (_m_GrandParent__varStaticParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_GrandParent, _m_GrandParent__varStaticParent, value); - return to_global_ref_result(_result); -} - -jmethodID _m_GrandParent__staticParentWithSameType = NULL; -FFI_PLUGIN_EXPORT -JniResult GrandParent__staticParentWithSameType(jobject self_) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_GrandParent, &_m_GrandParent__staticParentWithSameType, - "staticParentWithSameType", - "()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); - if (_m_GrandParent__staticParentWithSameType == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_GrandParent__staticParentWithSameType); - return to_global_ref_result(_result); -} - -jfieldID _f_GrandParent__value = NULL; -FFI_PLUGIN_EXPORT -JniResult get_GrandParent__value(jobject self_) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent, &_f_GrandParent__value, "value", - "Ljava/lang/Object;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_GrandParent__value); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_GrandParent__value(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent, &_f_GrandParent__value, "value", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_GrandParent__value, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.MyMap$MyEntry -jclass _c_MyMap_MyEntry = NULL; - -jmethodID _m_MyMap_MyEntry__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyMap_MyEntry__new0(jobject _parent, jobject key, jobject value) { - load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap_MyEntry, &_m_MyMap_MyEntry__new0, "", - "(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/" - "Object;Ljava/lang/Object;)V"); - if (_m_MyMap_MyEntry__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_MyMap_MyEntry, _m_MyMap_MyEntry__new0, _parent, key, value); - return to_global_ref_result(_result); -} - -jfieldID _f_MyMap_MyEntry__key = NULL; -FFI_PLUGIN_EXPORT -JniResult get_MyMap_MyEntry__key(jobject self_) { - load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__key, "key", - "Ljava/lang/Object;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyMap_MyEntry__key); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_MyMap_MyEntry__key(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__key, "key", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_MyMap_MyEntry__key, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_MyMap_MyEntry__value = NULL; -FFI_PLUGIN_EXPORT -JniResult get_MyMap_MyEntry__value(jobject self_) { - load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__value, "value", - "Ljava/lang/Object;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyMap_MyEntry__value); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_MyMap_MyEntry__value(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__value, "value", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_MyMap_MyEntry__value, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.MyMap -jclass _c_MyMap = NULL; - -jmethodID _m_MyMap__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyMap__new0() { - load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap, &_m_MyMap__new0, "", "()V"); - if (_m_MyMap__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyMap, _m_MyMap__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_MyMap__get0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyMap__get0(jobject self_, jobject key) { - load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap, &_m_MyMap__get0, "get", - "(Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_MyMap__get0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyMap__get0, key); - return to_global_ref_result(_result); -} - -jmethodID _m_MyMap__put = NULL; -FFI_PLUGIN_EXPORT -JniResult MyMap__put(jobject self_, jobject key, jobject value) { - load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap, &_m_MyMap__put, "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_MyMap__put == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyMap__put, key, value); - return to_global_ref_result(_result); -} - -jmethodID _m_MyMap__entryStack = NULL; -FFI_PLUGIN_EXPORT -JniResult MyMap__entryStack(jobject self_) { - load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap, &_m_MyMap__entryStack, "entryStack", - "()Lcom/github/dart_lang/jnigen/generics/MyStack;"); - if (_m_MyMap__entryStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyMap__entryStack); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.generics.MyStack -jclass _c_MyStack = NULL; - -jmethodID _m_MyStack__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__new0() { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyStack, &_m_MyStack__new0, "", "()V"); - if (_m_MyStack__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyStack, _m_MyStack__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__fromArray = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__fromArray(jobject arr) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_MyStack, &_m_MyStack__fromArray, "fromArray", - "([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - if (_m_MyStack__fromArray == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_MyStack, _m_MyStack__fromArray, arr); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__fromArrayOfArrayOfGrandParents = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__fromArrayOfArrayOfGrandParents(jobject arr) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_MyStack, &_m_MyStack__fromArrayOfArrayOfGrandParents, - "fromArrayOfArrayOfGrandParents", - "([[Lcom/github/dart_lang/jnigen/generics/GrandParent;)Lcom/github/" - "dart_lang/jnigen/generics/MyStack;"); - if (_m_MyStack__fromArrayOfArrayOfGrandParents == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_MyStack, _m_MyStack__fromArrayOfArrayOfGrandParents, arr); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__of = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__of() { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_MyStack, &_m_MyStack__of, "of", - "()Lcom/github/dart_lang/jnigen/generics/MyStack;"); - if (_m_MyStack__of == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_MyStack, _m_MyStack__of); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__of1 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__of1(jobject obj) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_MyStack, &_m_MyStack__of1, "of", - "(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - if (_m_MyStack__of1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_MyStack, - _m_MyStack__of1, obj); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__of2 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__of2(jobject obj, jobject obj2) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_MyStack, &_m_MyStack__of2, "of", - "(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/" - "dart_lang/jnigen/generics/MyStack;"); - if (_m_MyStack__of2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_MyStack, _m_MyStack__of2, obj, obj2); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__push = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__push(jobject self_, jobject item) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyStack, &_m_MyStack__push, "push", "(Ljava/lang/Object;)V"); - if (_m_MyStack__push == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyStack__push, item); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_MyStack__pop = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__pop(jobject self_) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyStack, &_m_MyStack__pop, "pop", "()Ljava/lang/Object;"); - if (_m_MyStack__pop == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyStack__pop); - return to_global_ref_result(_result); -} - -jmethodID _m_MyStack__size = NULL; -FFI_PLUGIN_EXPORT -JniResult MyStack__size(jobject self_) { - load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyStack, &_m_MyStack__size, "size", "()I"); - if (_m_MyStack__size == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod(jniEnv, self_, _m_MyStack__size); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.StringKeyedMap -jclass _c_StringKeyedMap = NULL; - -jmethodID _m_StringKeyedMap__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult StringKeyedMap__new0() { - load_env(); - load_class_global_ref(&_c_StringKeyedMap, - "com/github/dart_lang/jnigen/generics/StringKeyedMap"); - if (_c_StringKeyedMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringKeyedMap, &_m_StringKeyedMap__new0, "", "()V"); - if (_m_StringKeyedMap__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringKeyedMap, _m_StringKeyedMap__new0); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.generics.StringStack -jclass _c_StringStack = NULL; - -jmethodID _m_StringStack__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult StringStack__new0() { - load_env(); - load_class_global_ref(&_c_StringStack, - "com/github/dart_lang/jnigen/generics/StringStack"); - if (_c_StringStack == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringStack, &_m_StringStack__new0, "", "()V"); - if (_m_StringStack__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringStack, _m_StringStack__new0); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.generics.StringValuedMap -jclass _c_StringValuedMap = NULL; - -jmethodID _m_StringValuedMap__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult StringValuedMap__new0() { - load_env(); - load_class_global_ref(&_c_StringValuedMap, - "com/github/dart_lang/jnigen/generics/StringValuedMap"); - if (_c_StringValuedMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringValuedMap, &_m_StringValuedMap__new0, "", "()V"); - if (_m_StringValuedMap__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_StringValuedMap, - _m_StringValuedMap__new0); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.interfaces.MyInterface -jclass _c_MyInterface = NULL; - -jmethodID _m_MyInterface__voidCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterface__voidCallback(jobject self_, jobject s) { - load_env(); - load_class_global_ref(&_c_MyInterface, - "com/github/dart_lang/jnigen/interfaces/MyInterface"); - if (_c_MyInterface == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyInterface, &_m_MyInterface__voidCallback, "voidCallback", - "(Ljava/lang/String;)V"); - if (_m_MyInterface__voidCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyInterface__voidCallback, s); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_MyInterface__stringCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterface__stringCallback(jobject self_, jobject s) { - load_env(); - load_class_global_ref(&_c_MyInterface, - "com/github/dart_lang/jnigen/interfaces/MyInterface"); - if (_c_MyInterface == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyInterface, &_m_MyInterface__stringCallback, "stringCallback", - "(Ljava/lang/String;)Ljava/lang/String;"); - if (_m_MyInterface__stringCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_MyInterface__stringCallback, s); - return to_global_ref_result(_result); -} - -jmethodID _m_MyInterface__varCallback = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterface__varCallback(jobject self_, jobject t) { - load_env(); - load_class_global_ref(&_c_MyInterface, - "com/github/dart_lang/jnigen/interfaces/MyInterface"); - if (_c_MyInterface == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyInterface, &_m_MyInterface__varCallback, "varCallback", - "(Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_MyInterface__varCallback == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_MyInterface__varCallback, t); - return to_global_ref_result(_result); -} - -jmethodID _m_MyInterface__manyPrimitives = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterface__manyPrimitives(jobject self_, - int32_t a, - uint8_t b, - uint16_t c, - double d) { - load_env(); - load_class_global_ref(&_c_MyInterface, - "com/github/dart_lang/jnigen/interfaces/MyInterface"); - if (_c_MyInterface == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyInterface, &_m_MyInterface__manyPrimitives, "manyPrimitives", - "(IZCD)J"); - if (_m_MyInterface__manyPrimitives == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_MyInterface__manyPrimitives, a, b, c, d); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer -jclass _c_MyInterfaceConsumer = NULL; - -jmethodID _m_MyInterfaceConsumer__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterfaceConsumer__new0() { - load_env(); - load_class_global_ref( - &_c_MyInterfaceConsumer, - "com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer"); - if (_c_MyInterfaceConsumer == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyInterfaceConsumer, &_m_MyInterfaceConsumer__new0, "", - "()V"); - if (_m_MyInterfaceConsumer__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_MyInterfaceConsumer__consumeOnAnotherThread = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterfaceConsumer__consumeOnAnotherThread(jobject myInterface, - jobject s, - int32_t a, - uint8_t b, - uint16_t c, - double d, - jobject t) { - load_env(); - load_class_global_ref( - &_c_MyInterfaceConsumer, - "com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer"); - if (_c_MyInterfaceConsumer == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_MyInterfaceConsumer, - &_m_MyInterfaceConsumer__consumeOnAnotherThread, - "consumeOnAnotherThread", - "(Lcom/github/dart_lang/jnigen/interfaces/" - "MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V"); - if (_m_MyInterfaceConsumer__consumeOnAnotherThread == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod( - jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__consumeOnAnotherThread, myInterface, s, a, b, c, - d, t); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_MyInterfaceConsumer__consumeOnSameThread = NULL; -FFI_PLUGIN_EXPORT -JniResult MyInterfaceConsumer__consumeOnSameThread(jobject myInterface, - jobject s, - int32_t a, - uint8_t b, - uint16_t c, - double d, - jobject t) { - load_env(); - load_class_global_ref( - &_c_MyInterfaceConsumer, - "com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer"); - if (_c_MyInterfaceConsumer == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_MyInterfaceConsumer, - &_m_MyInterfaceConsumer__consumeOnSameThread, - "consumeOnSameThread", - "(Lcom/github/dart_lang/jnigen/interfaces/" - "MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V"); - if (_m_MyInterfaceConsumer__consumeOnSameThread == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__consumeOnSameThread, - myInterface, s, a, b, c, d, t); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.interfaces.MyRunnable -jclass _c_MyRunnable = NULL; - -jmethodID _m_MyRunnable__run = NULL; -FFI_PLUGIN_EXPORT -JniResult MyRunnable__run(jobject self_) { - load_env(); - load_class_global_ref(&_c_MyRunnable, - "com/github/dart_lang/jnigen/interfaces/MyRunnable"); - if (_c_MyRunnable == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyRunnable, &_m_MyRunnable__run, "run", "()V"); - if (_m_MyRunnable__run == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyRunnable__run); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.interfaces.MyRunnableRunner -jclass _c_MyRunnableRunner = NULL; - -jmethodID _m_MyRunnableRunner__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyRunnableRunner__new0(jobject runnable) { - load_env(); - load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyRunnableRunner, &_m_MyRunnableRunner__new0, "", - "(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V"); - if (_m_MyRunnableRunner__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyRunnableRunner, - _m_MyRunnableRunner__new0, runnable); - return to_global_ref_result(_result); -} - -jmethodID _m_MyRunnableRunner__runOnSameThread = NULL; -FFI_PLUGIN_EXPORT -JniResult MyRunnableRunner__runOnSameThread(jobject self_) { - load_env(); - load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyRunnableRunner, &_m_MyRunnableRunner__runOnSameThread, - "runOnSameThread", "()V"); - if (_m_MyRunnableRunner__runOnSameThread == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_MyRunnableRunner__runOnSameThread); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jmethodID _m_MyRunnableRunner__runOnAnotherThread = NULL; -FFI_PLUGIN_EXPORT -JniResult MyRunnableRunner__runOnAnotherThread(jobject self_) { - load_env(); - load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyRunnableRunner, &_m_MyRunnableRunner__runOnAnotherThread, - "runOnAnotherThread", "()V"); - if (_m_MyRunnableRunner__runOnAnotherThread == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_MyRunnableRunner__runOnAnotherThread); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_MyRunnableRunner__error = NULL; -FFI_PLUGIN_EXPORT -JniResult get_MyRunnableRunner__error(jobject self_) { - load_env(); - load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_MyRunnableRunner, &_f_MyRunnableRunner__error, "error", - "Ljava/lang/Throwable;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyRunnableRunner__error); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_MyRunnableRunner__error(jobject self_, jobject value) { - load_env(); - load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_MyRunnableRunner, &_f_MyRunnableRunner__error, "error", - "Ljava/lang/Throwable;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_MyRunnableRunner__error, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.annotations.JsonSerializable$Case -jclass _c_JsonSerializable_Case = NULL; - -jmethodID _m_JsonSerializable_Case__values = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonSerializable_Case__values() { - load_env(); - load_class_global_ref( - &_c_JsonSerializable_Case, - "com/github/dart_lang/jnigen/annotations/JsonSerializable$Case"); - if (_c_JsonSerializable_Case == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_JsonSerializable_Case, &_m_JsonSerializable_Case__values, "values", - "()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); - if (_m_JsonSerializable_Case__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonSerializable_Case, _m_JsonSerializable_Case__values); - return to_global_ref_result(_result); -} - -jmethodID _m_JsonSerializable_Case__valueOf = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonSerializable_Case__valueOf(jobject name) { - load_env(); - load_class_global_ref( - &_c_JsonSerializable_Case, - "com/github/dart_lang/jnigen/annotations/JsonSerializable$Case"); - if (_c_JsonSerializable_Case == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_JsonSerializable_Case, - &_m_JsonSerializable_Case__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/" - "annotations/JsonSerializable$Case;"); - if (_m_JsonSerializable_Case__valueOf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonSerializable_Case, _m_JsonSerializable_Case__valueOf, - name); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.annotations.JsonSerializable -jclass _c_JsonSerializable = NULL; - -jmethodID _m_JsonSerializable__value = NULL; -FFI_PLUGIN_EXPORT -JniResult JsonSerializable__value(jobject self_) { - load_env(); - load_class_global_ref( - &_c_JsonSerializable, - "com/github/dart_lang/jnigen/annotations/JsonSerializable"); - if (_c_JsonSerializable == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method( - _c_JsonSerializable, &_m_JsonSerializable__value, "value", - "()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); - if (_m_JsonSerializable__value == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_JsonSerializable__value); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.annotations.MyDataClass -jclass _c_MyDataClass = NULL; - -jmethodID _m_MyDataClass__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult MyDataClass__new0() { - load_env(); - load_class_global_ref(&_c_MyDataClass, - "com/github/dart_lang/jnigen/annotations/MyDataClass"); - if (_c_MyDataClass == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyDataClass, &_m_MyDataClass__new0, "", "()V"); - if (_m_MyDataClass__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_MyDataClass, _m_MyDataClass__new0); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.simple_package.Color -jclass _c_Color = NULL; - -jmethodID _m_Color__values = NULL; -FFI_PLUGIN_EXPORT -JniResult Color__values() { - load_env(); - load_class_global_ref(&_c_Color, - "com/github/dart_lang/jnigen/simple_package/Color"); - if (_c_Color == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Color, &_m_Color__values, "values", - "()[Lcom/github/dart_lang/jnigen/simple_package/Color;"); - if (_m_Color__values == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_Color, _m_Color__values); - return to_global_ref_result(_result); -} - -jmethodID _m_Color__valueOf = NULL; -FFI_PLUGIN_EXPORT -JniResult Color__valueOf(jobject name) { - load_env(); - load_class_global_ref(&_c_Color, - "com/github/dart_lang/jnigen/simple_package/Color"); - if (_c_Color == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method( - _c_Color, &_m_Color__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;"); - if (_m_Color__valueOf == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_Color, - _m_Color__valueOf, name); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.simple_package.Exceptions -jclass _c_Exceptions = NULL; - -jmethodID _m_Exceptions__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__new0() { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__new0, "", "()V"); - if (_m_Exceptions__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__new0); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__new1 = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__new1(float x) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__new1, "", "(F)V"); - if (_m_Exceptions__new1 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__new1, x); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__new2 = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__new2(int32_t a, - int32_t b, - int32_t c, - int32_t d, - int32_t e, - int32_t f) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__new2, "", "(IIIIII)V"); - if (_m_Exceptions__new2 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Exceptions, - _m_Exceptions__new2, a, b, c, d, e, f); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__staticObjectMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__staticObjectMethod() { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Exceptions, &_m_Exceptions__staticObjectMethod, - "staticObjectMethod", "()Ljava/lang/Object;"); - if (_m_Exceptions__staticObjectMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_Exceptions, _m_Exceptions__staticObjectMethod); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__staticIntMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__staticIntMethod() { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Exceptions, &_m_Exceptions__staticIntMethod, - "staticIntMethod", "()I"); - if (_m_Exceptions__staticIntMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallStaticIntMethod( - jniEnv, _c_Exceptions, _m_Exceptions__staticIntMethod); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Exceptions__staticObjectArrayMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__staticObjectArrayMethod() { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Exceptions, &_m_Exceptions__staticObjectArrayMethod, - "staticObjectArrayMethod", "()[Ljava/lang/Object;"); - if (_m_Exceptions__staticObjectArrayMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_Exceptions, _m_Exceptions__staticObjectArrayMethod); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__staticIntArrayMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__staticIntArrayMethod() { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Exceptions, &_m_Exceptions__staticIntArrayMethod, - "staticIntArrayMethod", "()[I"); - if (_m_Exceptions__staticIntArrayMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_Exceptions, _m_Exceptions__staticIntArrayMethod); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__objectMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__objectMethod(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__objectMethod, "objectMethod", - "()Ljava/lang/Object;"); - if (_m_Exceptions__objectMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Exceptions__objectMethod); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__intMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__intMethod(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__intMethod, "intMethod", "()I"); - if (_m_Exceptions__intMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Exceptions__intMethod); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Exceptions__objectArrayMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__objectArrayMethod(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__objectArrayMethod, - "objectArrayMethod", "()[Ljava/lang/Object;"); - if (_m_Exceptions__objectArrayMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Exceptions__objectArrayMethod); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__intArrayMethod = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__intArrayMethod(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__intArrayMethod, "intArrayMethod", - "()[I"); - if (_m_Exceptions__intArrayMethod == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Exceptions__intArrayMethod); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__throwNullPointerException = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__throwNullPointerException(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__throwNullPointerException, - "throwNullPointerException", "()I"); - if (_m_Exceptions__throwNullPointerException == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_Exceptions__throwNullPointerException); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Exceptions__throwFileNotFoundException = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__throwFileNotFoundException(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__throwFileNotFoundException, - "throwFileNotFoundException", "()Ljava/io/InputStream;"); - if (_m_Exceptions__throwFileNotFoundException == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Exceptions__throwFileNotFoundException); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__throwClassCastException = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__throwClassCastException(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__throwClassCastException, - "throwClassCastException", "()Ljava/io/FileInputStream;"); - if (_m_Exceptions__throwClassCastException == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Exceptions__throwClassCastException); - return to_global_ref_result(_result); -} - -jmethodID _m_Exceptions__throwArrayIndexException = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__throwArrayIndexException(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__throwArrayIndexException, - "throwArrayIndexException", "()I"); - if (_m_Exceptions__throwArrayIndexException == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_Exceptions__throwArrayIndexException); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Exceptions__throwArithmeticException = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__throwArithmeticException(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__throwArithmeticException, - "throwArithmeticException", "()I"); - if (_m_Exceptions__throwArithmeticException == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_Exceptions__throwArithmeticException); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -jmethodID _m_Exceptions__throwLoremIpsum = NULL; -FFI_PLUGIN_EXPORT -JniResult Exceptions__throwLoremIpsum() { - load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_Exceptions, &_m_Exceptions__throwLoremIpsum, - "throwLoremIpsum", "()V"); - if (_m_Exceptions__throwLoremIpsum == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Exceptions, - _m_Exceptions__throwLoremIpsum); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.simple_package.Fields -jclass _c_Fields = NULL; - -jmethodID _m_Fields__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Fields__new0() { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Fields, &_m_Fields__new0, "", "()V"); - if (_m_Fields__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Fields, _m_Fields__new0); - return to_global_ref_result(_result); -} - -jfieldID _f_Fields__amount = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__amount() { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__amount, "amount", "I"); - int32_t _result = - (*jniEnv)->GetStaticIntField(jniEnv, _c_Fields, _f_Fields__amount); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__amount(int32_t value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__amount, "amount", "I"); - (*jniEnv)->SetStaticIntField(jniEnv, _c_Fields, _f_Fields__amount, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__pi = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__pi() { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__pi, "pi", "D"); - double _result = - (*jniEnv)->GetStaticDoubleField(jniEnv, _c_Fields, _f_Fields__pi); - return (JniResult){.value = {.d = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__pi(double value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__pi, "pi", "D"); - (*jniEnv)->SetStaticDoubleField(jniEnv, _c_Fields, _f_Fields__pi, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__asterisk = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__asterisk() { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__asterisk, "asterisk", "C"); - uint16_t _result = - (*jniEnv)->GetStaticCharField(jniEnv, _c_Fields, _f_Fields__asterisk); - return (JniResult){.value = {.c = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__asterisk(uint16_t value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__asterisk, "asterisk", "C"); - (*jniEnv)->SetStaticCharField(jniEnv, _c_Fields, _f_Fields__asterisk, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__name = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__name() { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__name, "name", "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Fields, _f_Fields__name); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__name(jobject value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__name, "name", "Ljava/lang/String;"); - (*jniEnv)->SetStaticObjectField(jniEnv, _c_Fields, _f_Fields__name, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__i = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__i(jobject self_) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__i, "i", "Ljava/lang/Integer;"); - jobject _result = (*jniEnv)->GetObjectField(jniEnv, self_, _f_Fields__i); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__i(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__i, "i", "Ljava/lang/Integer;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_Fields__i, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__trillion = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__trillion(jobject self_) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__trillion, "trillion", "J"); - int64_t _result = (*jniEnv)->GetLongField(jniEnv, self_, _f_Fields__trillion); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__trillion(jobject self_, int64_t value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__trillion, "trillion", "J"); - (*jniEnv)->SetLongField(jniEnv, self_, _f_Fields__trillion, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__isAchillesDead = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__isAchillesDead(jobject self_) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__isAchillesDead, "isAchillesDead", "Z"); - uint8_t _result = - (*jniEnv)->GetBooleanField(jniEnv, self_, _f_Fields__isAchillesDead); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__isAchillesDead(jobject self_, uint8_t value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__isAchillesDead, "isAchillesDead", "Z"); - (*jniEnv)->SetBooleanField(jniEnv, self_, _f_Fields__isAchillesDead, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__bestFighterInGreece = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__bestFighterInGreece(jobject self_) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__bestFighterInGreece, "bestFighterInGreece", - "Ljava/lang/String;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_Fields__bestFighterInGreece); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__bestFighterInGreece(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__bestFighterInGreece, "bestFighterInGreece", - "Ljava/lang/String;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_Fields__bestFighterInGreece, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__random = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__random(jobject self_) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__random, "random", "Ljava/util/Random;"); - jobject _result = (*jniEnv)->GetObjectField(jniEnv, self_, _f_Fields__random); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__random(jobject self_, jobject value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields, &_f_Fields__random, "random", "Ljava/util/Random;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_Fields__random, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields__euroSymbol = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields__euroSymbol() { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__euroSymbol, "euroSymbol", "C"); - uint16_t _result = - (*jniEnv)->GetStaticCharField(jniEnv, _c_Fields, _f_Fields__euroSymbol); - return (JniResult){.value = {.c = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields__euroSymbol(uint16_t value) { - load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields, &_f_Fields__euroSymbol, "euroSymbol", "C"); - (*jniEnv)->SetStaticCharField(jniEnv, _c_Fields, _f_Fields__euroSymbol, - value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.simple_package.Fields$Nested -jclass _c_Fields_Nested = NULL; - -jmethodID _m_Fields_Nested__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult Fields_Nested__new0() { - load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Fields_Nested, &_m_Fields_Nested__new0, "", "()V"); - if (_m_Fields_Nested__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Fields_Nested, _m_Fields_Nested__new0); - return to_global_ref_result(_result); -} - -jfieldID _f_Fields_Nested__hundred = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields_Nested__hundred(jobject self_) { - load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields_Nested, &_f_Fields_Nested__hundred, "hundred", "J"); - int64_t _result = - (*jniEnv)->GetLongField(jniEnv, self_, _f_Fields_Nested__hundred); - return (JniResult){.value = {.j = _result}, .exception = check_exception()}; -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields_Nested__hundred(jobject self_, int64_t value) { - load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_Fields_Nested, &_f_Fields_Nested__hundred, "hundred", "J"); - (*jniEnv)->SetLongField(jniEnv, self_, _f_Fields_Nested__hundred, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -jfieldID _f_Fields_Nested__BEST_GOD = NULL; -FFI_PLUGIN_EXPORT -JniResult get_Fields_Nested__BEST_GOD() { - load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields_Nested, &_f_Fields_Nested__BEST_GOD, "BEST_GOD", - "Ljava/lang/String;"); - jobject _result = (*jniEnv)->GetStaticObjectField(jniEnv, _c_Fields_Nested, - _f_Fields_Nested__BEST_GOD); - return to_global_ref_result(_result); -} - -FFI_PLUGIN_EXPORT -JniResult set_Fields_Nested__BEST_GOD(jobject value) { - load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_field(_c_Fields_Nested, &_f_Fields_Nested__BEST_GOD, "BEST_GOD", - "Ljava/lang/String;"); - (*jniEnv)->SetStaticObjectField(jniEnv, _c_Fields_Nested, - _f_Fields_Nested__BEST_GOD, value); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; -} - -// com.github.dart_lang.jnigen.generics.GenericTypeParams -jclass _c_GenericTypeParams = NULL; - -jmethodID _m_GenericTypeParams__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult GenericTypeParams__new0() { - load_env(); - load_class_global_ref( - &_c_GenericTypeParams, - "com/github/dart_lang/jnigen/generics/GenericTypeParams"); - if (_c_GenericTypeParams == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GenericTypeParams, &_m_GenericTypeParams__new0, "", - "()V"); - if (_m_GenericTypeParams__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GenericTypeParams, - _m_GenericTypeParams__new0); - return to_global_ref_result(_result); -} - -// com.github.dart_lang.jnigen.generics.StringMap -jclass _c_StringMap = NULL; - -jmethodID _m_StringMap__new0 = NULL; -FFI_PLUGIN_EXPORT -JniResult StringMap__new0() { - load_env(); - load_class_global_ref(&_c_StringMap, - "com/github/dart_lang/jnigen/generics/StringMap"); - if (_c_StringMap == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringMap, &_m_StringMap__new0, "", "()V"); - if (_m_StringMap__new0 == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringMap, _m_StringMap__new0); - return to_global_ref_result(_result); -} diff --git a/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart deleted file mode 100644 index 4a4462331..000000000 --- a/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart +++ /dev/null @@ -1,4329 +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. - -// Autogenerated by jnigen. DO NOT EDIT! - -// ignore_for_file: annotate_overrides -// ignore_for_file: camel_case_extensions -// ignore_for_file: camel_case_types -// ignore_for_file: constant_identifier_names -// ignore_for_file: doc_directive_unknown -// ignore_for_file: file_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: overridden_fields -// ignore_for_file: unnecessary_cast -// ignore_for_file: unused_element -// ignore_for_file: unused_field -// ignore_for_file: unused_import -// ignore_for_file: unused_local_variable -// ignore_for_file: unused_shown_name -// ignore_for_file: use_super_parameters - -import "dart:isolate" show ReceivePort; -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; -import "package:jni/jni.dart" as jni; - -// Auto-generated initialization code. - -final ffi.Pointer Function(String sym) jniLookup = - ProtectedJniExtensions.initGeneratedLibrary("simple_package"); - -/// from: com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice -class Example_Nested_NestedTwice extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Example_Nested_NestedTwice.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $Example_Nested_NestedTwiceType(); - static final _get_ZERO = - jniLookup>( - "get_Example_Nested_NestedTwice__ZERO") - .asFunction(); - - static final _set_ZERO = - jniLookup>( - "set_Example_Nested_NestedTwice__ZERO") - .asFunction(); - - /// from: static public int ZERO - static int get ZERO => _get_ZERO().integer; - - /// from: static public int ZERO - static set ZERO(int value) => _set_ZERO(value).check(); - - static final _new0 = jniLookup>( - "Example_Nested_NestedTwice__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Example_Nested_NestedTwice() { - return Example_Nested_NestedTwice.fromReference(_new0().reference); - } -} - -final class $Example_Nested_NestedTwiceType - extends jni.JObjType { - const $Example_Nested_NestedTwiceType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;"; - - @override - Example_Nested_NestedTwice fromReference(jni.JReference reference) => - Example_Nested_NestedTwice.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($Example_Nested_NestedTwiceType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested_NestedTwiceType) && - other is $Example_Nested_NestedTwiceType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Example$Nested -class Example_Nested extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Example_Nested.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $Example_NestedType(); - static final _new0 = - jniLookup>( - "Example_Nested__new0") - .asFunction(); - - /// from: public void (boolean value) - /// The returned object must be released after use, by calling the [release] method. - factory Example_Nested( - bool value, - ) { - return Example_Nested.fromReference(_new0(value ? 1 : 0).reference); - } - - static final _usesAnonymousInnerClass = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example_Nested__usesAnonymousInnerClass") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public void usesAnonymousInnerClass() - void usesAnonymousInnerClass() { - _usesAnonymousInnerClass(reference.pointer).check(); - } - - static final _getValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example_Nested__getValue") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean getValue() - bool getValue() { - return _getValue(reference.pointer).boolean; - } - - static final _setValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("Example_Nested__setValue") - .asFunction, int)>(); - - /// from: public void setValue(boolean value) - void setValue( - bool value, - ) { - _setValue(reference.pointer, value ? 1 : 0).check(); - } -} - -final class $Example_NestedType extends jni.JObjType { - const $Example_NestedType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;"; - - @override - Example_Nested fromReference(jni.JReference reference) => - Example_Nested.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($Example_NestedType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($Example_NestedType) && - other is $Example_NestedType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested -class Example_NonStaticNested extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Example_NonStaticNested.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $Example_NonStaticNestedType(); - static final _get_ok = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Example_NonStaticNested__ok") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_ok = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Uint8)>>("set_Example_NonStaticNested__ok") - .asFunction(); - - /// from: public boolean ok - bool get ok => _get_ok(reference.pointer).boolean; - - /// from: public boolean ok - set ok(bool value) => _set_ok(reference.pointer, value ? 1 : 0).check(); - - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "Example_NonStaticNested__new0") - .asFunction)>(); - - /// from: public void (com.github.dart_lang.jnigen.simple_package.Example $parent) - /// The returned object must be released after use, by calling the [release] method. - factory Example_NonStaticNested( - Example $parent, - ) { - return Example_NonStaticNested.fromReference( - _new0($parent.reference.pointer).reference); - } -} - -final class $Example_NonStaticNestedType - extends jni.JObjType { - const $Example_NonStaticNestedType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;"; - - @override - Example_NonStaticNested fromReference(jni.JReference reference) => - Example_NonStaticNested.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($Example_NonStaticNestedType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($Example_NonStaticNestedType) && - other is $Example_NonStaticNestedType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Example -class Example extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Example.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $ExampleType(); - - /// from: static public final int ON - static const ON = 1; - - /// from: static public final int OFF - static const OFF = 0; - - /// from: static public final double PI - static const PI = 3.14159; - - /// from: static public final char SEMICOLON - static const SEMICOLON = 59; - static final _get_SEMICOLON_STRING = - jniLookup>( - "get_Example__SEMICOLON_STRING") - .asFunction(); - - /// from: static public final java.lang.String SEMICOLON_STRING - /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SEMICOLON_STRING => - _get_SEMICOLON_STRING().object(const jni.JStringType()); - - static final _get_unusedRandom = - jniLookup>( - "get_Example__unusedRandom") - .asFunction(); - - /// from: static public final java.util.Random unusedRandom - /// The returned object must be released after use, by calling the [release] method. - static jni.JObject get unusedRandom => - _get_unusedRandom().object(const jni.JObjectType()); - - static final _get_protectedField = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Example__protectedField") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_protectedField = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_Example__protectedField") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: protected java.util.Random protectedField - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get protectedField => - _get_protectedField(reference.pointer).object(const jni.JObjectType()); - - /// from: protected java.util.Random protectedField - /// The returned object must be released after use, by calling the [release] method. - set protectedField(jni.JObject value) => - _set_protectedField(reference.pointer, value.reference.pointer).check(); - - static final _getAmount = - jniLookup>( - "Example__getAmount") - .asFunction(); - - /// from: static public int getAmount() - static int getAmount() { - return _getAmount().integer; - } - - static final _getPi = - jniLookup>("Example__getPi") - .asFunction(); - - /// from: static public double getPi() - static double getPi() { - return _getPi().doubleFloat; - } - - static final _getAsterisk = - jniLookup>( - "Example__getAsterisk") - .asFunction(); - - /// from: static public char getAsterisk() - static int getAsterisk() { - return _getAsterisk().char; - } - - static final _getName = - jniLookup>( - "Example__getName") - .asFunction(); - - /// from: static public java.lang.String getName() - /// The returned object must be released after use, by calling the [release] method. - static jni.JString getName() { - return _getName().object(const jni.JStringType()); - } - - static final _getNestedInstance = - jniLookup>( - "Example__getNestedInstance") - .asFunction(); - - /// from: static public com.github.dart_lang.jnigen.simple_package.Example.Nested getNestedInstance() - /// The returned object must be released after use, by calling the [release] method. - static Example_Nested getNestedInstance() { - return _getNestedInstance().object(const $Example_NestedType()); - } - - static final _setAmount = - jniLookup>( - "Example__setAmount") - .asFunction(); - - /// from: static public void setAmount(int newAmount) - static void setAmount( - int newAmount, - ) { - _setAmount(newAmount).check(); - } - - static final _setName = jniLookup< - ffi - .NativeFunction)>>( - "Example__setName") - .asFunction)>(); - - /// from: static public void setName(java.lang.String newName) - static void setName( - jni.JString newName, - ) { - _setName(newName.reference.pointer).check(); - } - - static final _setNestedInstance = jniLookup< - ffi - .NativeFunction)>>( - "Example__setNestedInstance") - .asFunction)>(); - - /// from: static public void setNestedInstance(com.github.dart_lang.jnigen.simple_package.Example.Nested newNested) - static void setNestedInstance( - Example_Nested newNested, - ) { - _setNestedInstance(newNested.reference.pointer).check(); - } - - static final _max4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>("Example__max4") - .asFunction(); - - /// from: static public int max4(int a, int b, int c, int d) - static int max4( - int a, - int b, - int c, - int d, - ) { - return _max4(a, b, c, d).integer; - } - - static final _max8 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, - ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>("Example__max8") - .asFunction< - jni.JniResult Function(int, int, int, int, int, int, int, int)>(); - - /// from: static public int max8(int a, int b, int c, int d, int e, int f, int g, int h) - static int max8( - int a, - int b, - int c, - int d, - int e, - int f, - int g, - int h, - ) { - return _max8(a, b, c, d, e, f, g, h).integer; - } - - static final _getNumber = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getNumber") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int getNumber() - int getNumber() { - return _getNumber(reference.pointer).integer; - } - - static final _setNumber = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Int32)>>("Example__setNumber") - .asFunction, int)>(); - - /// from: public void setNumber(int number) - void setNumber( - int number, - ) { - _setNumber(reference.pointer, number).check(); - } - - static final _getIsUp = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getIsUp") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public boolean getIsUp() - bool getIsUp() { - return _getIsUp(reference.pointer).boolean; - } - - static final _setUp = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Uint8)>>("Example__setUp") - .asFunction, int)>(); - - /// from: public void setUp(boolean isUp) - void setUp( - bool isUp, - ) { - _setUp(reference.pointer, isUp ? 1 : 0).check(); - } - - static final _getCodename = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getCodename") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.String getCodename() - /// The returned object must be released after use, by calling the [release] method. - jni.JString getCodename() { - return _getCodename(reference.pointer).object(const jni.JStringType()); - } - - static final _setCodename = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("Example__setCodename") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void setCodename(java.lang.String codename) - void setCodename( - jni.JString codename, - ) { - _setCodename(reference.pointer, codename.reference.pointer).check(); - } - - static final _getRandom = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getRandom") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.util.Random getRandom() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject getRandom() { - return _getRandom(reference.pointer).object(const jni.JObjectType()); - } - - static final _setRandom = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("Example__setRandom") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void setRandom(java.util.Random random) - void setRandom( - jni.JObject random, - ) { - _setRandom(reference.pointer, random.reference.pointer).check(); - } - - static final _getRandomLong = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getRandomLong") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public long getRandomLong() - int getRandomLong() { - return _getRandomLong(reference.pointer).long; - } - - static final _add4Longs = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Int64, - ffi.Int64, ffi.Int64, ffi.Int64)>>("Example__add4Longs") - .asFunction< - jni.JniResult Function(ffi.Pointer, int, int, int, int)>(); - - /// from: public long add4Longs(long a, long b, long c, long d) - int add4Longs( - int a, - int b, - int c, - int d, - ) { - return _add4Longs(reference.pointer, a, b, c, d).long; - } - - static final _add8Longs = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64)>>("Example__add8Longs") - .asFunction< - jni.JniResult Function( - ffi.Pointer, int, int, int, int, int, int, int, int)>(); - - /// from: public long add8Longs(long a, long b, long c, long d, long e, long f, long g, long h) - int add8Longs( - int a, - int b, - int c, - int d, - int e, - int f, - int g, - int h, - ) { - return _add8Longs(reference.pointer, a, b, c, d, e, f, g, h).long; - } - - static final _getRandomNumericString = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("Example__getRandomNumericString") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public java.lang.String getRandomNumericString(java.util.Random random) - /// The returned object must be released after use, by calling the [release] method. - jni.JString getRandomNumericString( - jni.JObject random, - ) { - return _getRandomNumericString(reference.pointer, random.reference.pointer) - .object(const jni.JStringType()); - } - - static final _protectedMethod = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("Example__protectedMethod") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: protected void protectedMethod(java.lang.String a, java.lang.String b) - void protectedMethod( - jni.JString a, - jni.JString b, - ) { - _protectedMethod( - reference.pointer, a.reference.pointer, b.reference.pointer) - .check(); - } - - static final _finalMethod = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__finalMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public final void finalMethod() - void finalMethod() { - _finalMethod(reference.pointer).check(); - } - - static final _getList = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getList") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.util.List getList() - /// The returned object must be released after use, by calling the [release] method. - jni.JList getList() { - return _getList(reference.pointer) - .object(const jni.JListType(jni.JStringType())); - } - - static final _joinStrings = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("Example__joinStrings") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public java.lang.String joinStrings(java.util.List values, java.lang.String delim) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Joins the strings in the list using the given delimiter. - jni.JString joinStrings( - jni.JList values, - jni.JString delim, - ) { - return _joinStrings(reference.pointer, values.reference.pointer, - delim.reference.pointer) - .object(const jni.JStringType()); - } - - static final _methodWithSeveralParams = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Uint16, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("Example__methodWithSeveralParams") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - /// from: public void methodWithSeveralParams(char ch, java.lang.String s, int[] a, T t, java.util.List lt, java.util.Map wm) - void methodWithSeveralParams<$T extends jni.JObject>( - int ch, - jni.JString s, - jni.JArray a, - $T t, - jni.JList<$T> lt, - jni.JMap wm, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - (lt.$type as jni.JListType).E, - t.$type, - ]) as jni.JObjType<$T>; - _methodWithSeveralParams( - reference.pointer, - ch, - s.reference.pointer, - a.reference.pointer, - t.reference.pointer, - lt.reference.pointer, - wm.reference.pointer) - .check(); - } - - static final _new0 = - jniLookup>("Example__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Example() { - return Example.fromReference(_new0().reference); - } - - static final _new1 = - jniLookup>( - "Example__new1") - .asFunction(); - - /// from: public void (int number) - /// The returned object must be released after use, by calling the [release] method. - factory Example.new1( - int number, - ) { - return Example.fromReference(_new1(number).reference); - } - - static final _new2 = jniLookup< - ffi.NativeFunction>( - "Example__new2") - .asFunction(); - - /// from: public void (int number, boolean isUp) - /// The returned object must be released after use, by calling the [release] method. - factory Example.new2( - int number, - bool isUp, - ) { - return Example.fromReference(_new2(number, isUp ? 1 : 0).reference); - } - - static final _new3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Int32, ffi.Uint8, - ffi.Pointer)>>("Example__new3") - .asFunction)>(); - - /// from: public void (int number, boolean isUp, java.lang.String codename) - /// The returned object must be released after use, by calling the [release] method. - factory Example.new3( - int number, - bool isUp, - jni.JString codename, - ) { - return Example.fromReference( - _new3(number, isUp ? 1 : 0, codename.reference.pointer).reference); - } - - static final _new4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, - ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>("Example__new4") - .asFunction< - jni.JniResult Function(int, int, int, int, int, int, int, int)>(); - - /// from: public void (int a, int b, int c, int d, int e, int f, int g, int h) - /// The returned object must be released after use, by calling the [release] method. - factory Example.new4( - int a, - int b, - int c, - int d, - int e, - int f, - int g, - int h, - ) { - return Example.fromReference(_new4(a, b, c, d, e, f, g, h).reference); - } - - static final _whichExample = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__whichExample") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int whichExample() - int whichExample() { - return _whichExample(reference.pointer).integer; - } - - static final _addInts = jniLookup< - ffi.NativeFunction>( - "Example__addInts") - .asFunction(); - - /// from: static public int addInts(int a, int b) - static int addInts( - int a, - int b, - ) { - return _addInts(a, b).integer; - } - - static final _getArr = - jniLookup>("Example__getArr") - .asFunction(); - - /// from: static public int[] getArr() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray getArr() { - return _getArr().object(const jni.JArrayType(jni.jintType())); - } - - static final _addAll = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("Example__addAll") - .asFunction)>(); - - /// from: static public int addAll(int[] arr) - static int addAll( - jni.JArray arr, - ) { - return _addAll(arr.reference.pointer).integer; - } - - static final _getSelf = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__getSelf") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.github.dart_lang.jnigen.simple_package.Example getSelf() - /// The returned object must be released after use, by calling the [release] method. - Example getSelf() { - return _getSelf(reference.pointer).object(const $ExampleType()); - } - - static final _throwException = - jniLookup>( - "Example__throwException") - .asFunction(); - - /// from: static public void throwException() - static void throwException() { - _throwException().check(); - } - - static final _overloaded = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example__overloaded") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public void overloaded() - void overloaded() { - _overloaded(reference.pointer).check(); - } - - static final _overloaded1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Int32, - ffi.Pointer)>>("Example__overloaded1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, int, ffi.Pointer)>(); - - /// from: public void overloaded(int a, java.lang.String b) - void overloaded1( - int a, - jni.JString b, - ) { - _overloaded1(reference.pointer, a, b.reference.pointer).check(); - } - - static final _overloaded2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Int32)>>("Example__overloaded2") - .asFunction, int)>(); - - /// from: public void overloaded(int a) - void overloaded2( - int a, - ) { - _overloaded2(reference.pointer, a).check(); - } - - static final _overloaded3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("Example__overloaded3") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public void overloaded(java.util.List a, java.lang.String b) - void overloaded3( - jni.JList a, - jni.JString b, - ) { - _overloaded3(reference.pointer, a.reference.pointer, b.reference.pointer) - .check(); - } - - static final _overloaded4 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("Example__overloaded4") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void overloaded(java.util.List a) - void overloaded4( - jni.JList a, - ) { - _overloaded4(reference.pointer, a.reference.pointer).check(); - } -} - -final class $ExampleType extends jni.JObjType { - const $ExampleType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example;"; - - @override - Example fromReference(jni.JReference reference) => - Example.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($ExampleType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($ExampleType) && other is $ExampleType; - } -} - -/// from: com.github.dart_lang.jnigen.pkg2.C2 -class C2 extends jni.JObject { - @override - late final jni.JObjType $type = type; - - C2.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $C2Type(); - static final _get_CONSTANT = - jniLookup>( - "get_C2__CONSTANT") - .asFunction(); - - static final _set_CONSTANT = - jniLookup>( - "set_C2__CONSTANT") - .asFunction(); - - /// from: static public int CONSTANT - static int get CONSTANT => _get_CONSTANT().integer; - - /// from: static public int CONSTANT - static set CONSTANT(int value) => _set_CONSTANT(value).check(); - - static final _new0 = - jniLookup>("C2__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory C2() { - return C2.fromReference(_new0().reference); - } -} - -final class $C2Type extends jni.JObjType { - const $C2Type(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/C2;"; - - @override - C2 fromReference(jni.JReference reference) => C2.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($C2Type).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($C2Type) && other is $C2Type; - } -} - -/// from: com.github.dart_lang.jnigen.pkg2.Example -class Example1 extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Example1.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $Example1Type(); - static final _new0 = - jniLookup>("Example1__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Example1() { - return Example1.fromReference(_new0().reference); - } - - static final _whichExample = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Example1__whichExample") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int whichExample() - int whichExample() { - return _whichExample(reference.pointer).integer; - } -} - -final class $Example1Type extends jni.JObjType { - const $Example1Type(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/Example;"; - - @override - Example1 fromReference(jni.JReference reference) => - Example1.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($Example1Type).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($Example1Type) && other is $Example1Type; - } -} - -/// from: com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child -class GrandParent_Parent_Child<$T extends jni.JObject, $S extends jni.JObject, - $U extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = - type(T, S, U); - - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; - - GrandParent_Parent_Child.fromReference( - this.T, - this.S, - this.U, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $GrandParent_Parent_ChildType<$T, $S, $U> type<$T extends jni.JObject, - $S extends jni.JObject, $U extends jni.JObject>( - jni.JObjType<$T> T, - jni.JObjType<$S> S, - jni.JObjType<$U> U, - ) { - return $GrandParent_Parent_ChildType( - T, - S, - U, - ); - } - - static final _get_grandParentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_Parent_Child__grandParentValue") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_grandParentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_Parent_Child__grandParentValue") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public T grandParentValue - /// The returned object must be released after use, by calling the [release] method. - $T get grandParentValue => _get_grandParentValue(reference.pointer).object(T); - - /// from: public T grandParentValue - /// The returned object must be released after use, by calling the [release] method. - set grandParentValue($T value) => - _set_grandParentValue(reference.pointer, value.reference.pointer).check(); - - static final _get_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_Parent_Child__parentValue") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_Parent_Child__parentValue") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => _get_parentValue(reference.pointer).object(S); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => - _set_parentValue(reference.pointer, value.reference.pointer).check(); - - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_Parent_Child__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_Parent_Child__value") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - $U get value => _get_value(reference.pointer).object(U); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - set value($U value) => - _set_value(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("GrandParent_Parent_Child__new0") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $parent, U newValue) - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_Parent_Child( - GrandParent_Parent<$T, $S> $parent, - $U newValue, { - jni.JObjType<$T>? T, - jni.JObjType<$S>? S, - jni.JObjType<$U>? U, - }) { - T ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParent_ParentType).T, - ]) as jni.JObjType<$T>; - S ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParent_ParentType).S, - ]) as jni.JObjType<$S>; - U ??= jni.lowestCommonSuperType([ - newValue.$type, - ]) as jni.JObjType<$U>; - return GrandParent_Parent_Child.fromReference(T, S, U, - _new0($parent.reference.pointer, newValue.reference.pointer).reference); - } -} - -final class $GrandParent_Parent_ChildType<$T extends jni.JObject, - $S extends jni.JObject, $U extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; - - const $GrandParent_Parent_ChildType( - this.T, - this.S, - this.U, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;"; - - @override - GrandParent_Parent_Child<$T, $S, $U> fromReference( - jni.JReference reference) => - GrandParent_Parent_Child.fromReference(T, S, U, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GrandParent_Parent_ChildType, T, S, U); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_Parent_ChildType<$T, $S, $U>) && - other is $GrandParent_Parent_ChildType<$T, $S, $U> && - T == other.T && - S == other.S && - U == other.U; - } -} - -/// from: com.github.dart_lang.jnigen.generics.GrandParent$Parent -class GrandParent_Parent<$T extends jni.JObject, $S extends jni.JObject> - extends jni.JObject { - @override - late final jni.JObjType> $type = type(T, S); - - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - - GrandParent_Parent.fromReference( - this.T, - this.S, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $GrandParent_ParentType<$T, $S> - type<$T extends jni.JObject, $S extends jni.JObject>( - jni.JObjType<$T> T, - jni.JObjType<$S> S, - ) { - return $GrandParent_ParentType( - T, - S, - ); - } - - static final _get_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_Parent__parentValue") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_Parent__parentValue") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public T parentValue - /// The returned object must be released after use, by calling the [release] method. - $T get parentValue => _get_parentValue(reference.pointer).object(T); - - /// from: public T parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($T value) => - _set_parentValue(reference.pointer, value.reference.pointer).check(); - - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_Parent__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_GrandParent_Parent__value") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - $S get value => _get_value(reference.pointer).object(S); - - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - set value($S value) => - _set_value(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("GrandParent_Parent__new0") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void (com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue) - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_Parent( - GrandParent<$T> $parent, - $S newValue, { - jni.JObjType<$T>? T, - jni.JObjType<$S>? S, - }) { - T ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParentType).T, - ]) as jni.JObjType<$T>; - S ??= jni.lowestCommonSuperType([ - newValue.$type, - ]) as jni.JObjType<$S>; - return GrandParent_Parent.fromReference(T, S, - _new0($parent.reference.pointer, newValue.reference.pointer).reference); - } -} - -final class $GrandParent_ParentType<$T extends jni.JObject, - $S extends jni.JObject> extends jni.JObjType> { - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - - const $GrandParent_ParentType( - this.T, - this.S, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"; - - @override - GrandParent_Parent<$T, $S> fromReference(jni.JReference reference) => - GrandParent_Parent.fromReference(T, S, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GrandParent_ParentType, T, S); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_ParentType<$T, $S>) && - other is $GrandParent_ParentType<$T, $S> && - T == other.T && - S == other.S; - } -} - -/// from: com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child -class GrandParent_StaticParent_Child<$S extends jni.JObject, - $U extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = - type(S, U); - - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; - - GrandParent_StaticParent_Child.fromReference( - this.S, - this.U, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $GrandParent_StaticParent_ChildType<$S, $U> - type<$S extends jni.JObject, $U extends jni.JObject>( - jni.JObjType<$S> S, - jni.JObjType<$U> U, - ) { - return $GrandParent_StaticParent_ChildType( - S, - U, - ); - } - - static final _get_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_StaticParent_Child__parentValue") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_StaticParent_Child__parentValue") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => _get_parentValue(reference.pointer).object(S); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => - _set_parentValue(reference.pointer, value.reference.pointer).check(); - - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_StaticParent_Child__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_StaticParent_Child__value") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - $U get value => _get_value(reference.pointer).object(U); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - set value($U value) => - _set_value(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>( - "GrandParent_StaticParent_Child__new0") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $parent, S parentValue, U value) - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_StaticParent_Child( - GrandParent_StaticParent<$S> $parent, - $S parentValue, - $U value, { - jni.JObjType<$S>? S, - jni.JObjType<$U>? U, - }) { - S ??= jni.lowestCommonSuperType([ - parentValue.$type, - ($parent.$type as $GrandParent_StaticParentType).S, - ]) as jni.JObjType<$S>; - U ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$U>; - return GrandParent_StaticParent_Child.fromReference( - S, - U, - _new0($parent.reference.pointer, parentValue.reference.pointer, - value.reference.pointer) - .reference); - } -} - -final class $GrandParent_StaticParent_ChildType<$S extends jni.JObject, - $U extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; - - const $GrandParent_StaticParent_ChildType( - this.S, - this.U, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;"; - - @override - GrandParent_StaticParent_Child<$S, $U> fromReference( - jni.JReference reference) => - GrandParent_StaticParent_Child.fromReference(S, U, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GrandParent_StaticParent_ChildType, S, U); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_StaticParent_ChildType<$S, $U>) && - other is $GrandParent_StaticParent_ChildType<$S, $U> && - S == other.S && - U == other.U; - } -} - -/// from: com.github.dart_lang.jnigen.generics.GrandParent$StaticParent -class GrandParent_StaticParent<$S extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(S); - - final jni.JObjType<$S> S; - - GrandParent_StaticParent.fromReference( - this.S, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $GrandParent_StaticParentType<$S> type<$S extends jni.JObject>( - jni.JObjType<$S> S, - ) { - return $GrandParent_StaticParentType( - S, - ); - } - - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_StaticParent__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_StaticParent__value") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - $S get value => _get_value(reference.pointer).object(S); - - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - set value($S value) => - _set_value(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "GrandParent_StaticParent__new0") - .asFunction)>(); - - /// from: public void (S value) - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_StaticParent( - $S value, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$S>; - return GrandParent_StaticParent.fromReference( - S, _new0(value.reference.pointer).reference); - } -} - -final class $GrandParent_StaticParentType<$S extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$S> S; - - const $GrandParent_StaticParentType( - this.S, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"; - - @override - GrandParent_StaticParent<$S> fromReference(jni.JReference reference) => - GrandParent_StaticParent.fromReference(S, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GrandParent_StaticParentType, S); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_StaticParentType<$S>) && - other is $GrandParent_StaticParentType<$S> && - S == other.S; - } -} - -/// from: com.github.dart_lang.jnigen.generics.GrandParent -class GrandParent<$T extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(T); - - final jni.JObjType<$T> T; - - GrandParent.fromReference( - this.T, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $GrandParentType<$T> type<$T extends jni.JObject>( - jni.JObjType<$T> T, - ) { - return $GrandParentType( - T, - ); - } - - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_GrandParent__value") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public T value - /// The returned object must be released after use, by calling the [release] method. - $T get value => _get_value(reference.pointer).object(T); - - /// from: public T value - /// The returned object must be released after use, by calling the [release] method. - set value($T value) => - _set_value(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "GrandParent__new0") - .asFunction)>(); - - /// from: public void (T value) - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent( - $T value, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$T>; - return GrandParent.fromReference( - T, _new0(value.reference.pointer).reference); - } - - static final _stringParent = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("GrandParent__stringParent") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent() - /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent stringParent() { - return _stringParent(reference.pointer).object( - const $GrandParent_ParentType(jni.JObjectType(), jni.JStringType())); - } - - static final _varParent = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("GrandParent__varParent") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S nestedValue) - /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent varParent<$S extends jni.JObject>( - $S nestedValue, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - nestedValue.$type, - ]) as jni.JObjType<$S>; - return _varParent(reference.pointer, nestedValue.reference.pointer) - .object($GrandParent_ParentType(const jni.JObjectType(), S)); - } - - static final _stringStaticParent = - jniLookup>( - "GrandParent__stringStaticParent") - .asFunction(); - - /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent stringStaticParent() - /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent stringStaticParent() { - return _stringStaticParent() - .object(const $GrandParent_StaticParentType(jni.JStringType())); - } - - static final _varStaticParent = jniLookup< - ffi - .NativeFunction)>>( - "GrandParent__varStaticParent") - .asFunction)>(); - - /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent varStaticParent(S value) - /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent<$S> varStaticParent<$S extends jni.JObject>( - $S value, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$S>; - return _varStaticParent(value.reference.pointer) - .object($GrandParent_StaticParentType(S)); - } - - static final _staticParentWithSameType = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("GrandParent__staticParentWithSameType") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent staticParentWithSameType() - /// The returned object must be released after use, by calling the [release] method. - GrandParent_StaticParent<$T> staticParentWithSameType() { - return _staticParentWithSameType(reference.pointer) - .object($GrandParent_StaticParentType(T)); - } -} - -final class $GrandParentType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - - const $GrandParentType( - this.T, - ); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/GrandParent;"; - - @override - GrandParent<$T> fromReference(jni.JReference reference) => - GrandParent.fromReference(T, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GrandParentType, T); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($GrandParentType<$T>) && - other is $GrandParentType<$T> && - T == other.T; - } -} - -/// from: com.github.dart_lang.jnigen.generics.MyMap$MyEntry -class MyMap_MyEntry<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObject { - @override - late final jni.JObjType> $type = type(K, V); - - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; - - MyMap_MyEntry.fromReference( - this.K, - this.V, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $MyMap_MyEntryType<$K, $V> - type<$K extends jni.JObject, $V extends jni.JObject>( - jni.JObjType<$K> K, - jni.JObjType<$V> V, - ) { - return $MyMap_MyEntryType( - K, - V, - ); - } - - static final _get_key = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_MyMap_MyEntry__key") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_key = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_MyMap_MyEntry__key") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public K key - /// The returned object must be released after use, by calling the [release] method. - $K get key => _get_key(reference.pointer).object(K); - - /// from: public K key - /// The returned object must be released after use, by calling the [release] method. - set key($K value) => - _set_key(reference.pointer, value.reference.pointer).check(); - - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_MyMap_MyEntry__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_MyMap_MyEntry__value") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public V value - /// The returned object must be released after use, by calling the [release] method. - $V get value => _get_value(reference.pointer).object(V); - - /// from: public V value - /// The returned object must be released after use, by calling the [release] method. - set value($V value) => - _set_value(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("MyMap_MyEntry__new0") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public void (com.github.dart_lang.jnigen.generics.MyMap $parent, K key, V value) - /// The returned object must be released after use, by calling the [release] method. - factory MyMap_MyEntry( - MyMap<$K, $V> $parent, - $K key, - $V value, { - jni.JObjType<$K>? K, - jni.JObjType<$V>? V, - }) { - K ??= jni.lowestCommonSuperType([ - key.$type, - ($parent.$type as $MyMapType).K, - ]) as jni.JObjType<$K>; - V ??= jni.lowestCommonSuperType([ - value.$type, - ($parent.$type as $MyMapType).V, - ]) as jni.JObjType<$V>; - return MyMap_MyEntry.fromReference( - K, - V, - _new0($parent.reference.pointer, key.reference.pointer, - value.reference.pointer) - .reference); - } -} - -final class $MyMap_MyEntryType<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; - - const $MyMap_MyEntryType( - this.K, - this.V, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;"; - - @override - MyMap_MyEntry<$K, $V> fromReference(jni.JReference reference) => - MyMap_MyEntry.fromReference(K, V, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($MyMap_MyEntryType, K, V); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyMap_MyEntryType<$K, $V>) && - other is $MyMap_MyEntryType<$K, $V> && - K == other.K && - V == other.V; - } -} - -/// from: com.github.dart_lang.jnigen.generics.MyMap -class MyMap<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObject { - @override - late final jni.JObjType> $type = type(K, V); - - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; - - MyMap.fromReference( - this.K, - this.V, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $MyMapType<$K, $V> - type<$K extends jni.JObject, $V extends jni.JObject>( - jni.JObjType<$K> K, - jni.JObjType<$V> V, - ) { - return $MyMapType( - K, - V, - ); - } - - static final _new0 = - jniLookup>("MyMap__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory MyMap({ - required jni.JObjType<$K> K, - required jni.JObjType<$V> V, - }) { - return MyMap.fromReference(K, V, _new0().reference); - } - - static final _get0 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>("MyMap__get0") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public V get(K key) - /// The returned object must be released after use, by calling the [release] method. - $V get0( - $K key, - ) { - return _get0(reference.pointer, key.reference.pointer).object(V); - } - - static final _put = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>("MyMap__put") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - /// from: public V put(K key, V value) - /// The returned object must be released after use, by calling the [release] method. - $V put( - $K key, - $V value, - ) { - return _put( - reference.pointer, key.reference.pointer, value.reference.pointer) - .object(V); - } - - static final _entryStack = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("MyMap__entryStack") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public com.github.dart_lang.jnigen.generics.MyStack.MyEntry> entryStack() - /// The returned object must be released after use, by calling the [release] method. - MyStack> entryStack() { - return _entryStack(reference.pointer).object(const $MyStackType( - $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType()))); - } -} - -final class $MyMapType<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; - - const $MyMapType( - this.K, - this.V, - ); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyMap;"; - - @override - MyMap<$K, $V> fromReference(jni.JReference reference) => - MyMap.fromReference(K, V, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($MyMapType, K, V); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyMapType<$K, $V>) && - other is $MyMapType<$K, $V> && - K == other.K && - V == other.V; - } -} - -/// from: com.github.dart_lang.jnigen.generics.MyStack -class MyStack<$T extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(T); - - final jni.JObjType<$T> T; - - MyStack.fromReference( - this.T, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $MyStackType<$T> type<$T extends jni.JObject>( - jni.JObjType<$T> T, - ) { - return $MyStackType( - T, - ); - } - - static final _new0 = - jniLookup>("MyStack__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory MyStack({ - required jni.JObjType<$T> T, - }) { - return MyStack.fromReference(T, _new0().reference); - } - - static final _fromArray = jniLookup< - ffi - .NativeFunction)>>( - "MyStack__fromArray") - .asFunction)>(); - - /// from: static public com.github.dart_lang.jnigen.generics.MyStack fromArray(T[] arr) - /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> fromArray<$T extends jni.JObject>( - jni.JArray<$T> arr, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - ((arr.$type as jni.JArrayType).elementType as jni.JObjType), - ]) as jni.JObjType<$T>; - return _fromArray(arr.reference.pointer).object($MyStackType(T)); - } - - static final _fromArrayOfArrayOfGrandParents = jniLookup< - ffi - .NativeFunction)>>( - "MyStack__fromArrayOfArrayOfGrandParents") - .asFunction)>(); - - /// from: static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(com.github.dart_lang.jnigen.generics.GrandParent[][] arr) - /// The returned object must be released after use, by calling the [release] method. - static MyStack<$S> fromArrayOfArrayOfGrandParents<$S extends jni.JObject>( - jni.JArray>> arr, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - (((((arr.$type as jni.JArrayType).elementType as jni.JObjType) - as jni.JArrayType) - .elementType as jni.JObjType) as $GrandParentType) - .T, - ]) as jni.JObjType<$S>; - return _fromArrayOfArrayOfGrandParents(arr.reference.pointer) - .object($MyStackType(S)); - } - - static final _of = - jniLookup>("MyStack__of") - .asFunction(); - - /// from: static public com.github.dart_lang.jnigen.generics.MyStack of() - /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of<$T extends jni.JObject>({ - required jni.JObjType<$T> T, - }) { - return _of().object($MyStackType(T)); - } - - static final _of1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("MyStack__of1") - .asFunction)>(); - - /// from: static public com.github.dart_lang.jnigen.generics.MyStack of(T obj) - /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of1<$T extends jni.JObject>( - $T obj, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - obj.$type, - ]) as jni.JObjType<$T>; - return _of1(obj.reference.pointer).object($MyStackType(T)); - } - - static final _of2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyStack__of2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: static public com.github.dart_lang.jnigen.generics.MyStack of(T obj, T obj2) - /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of2<$T extends jni.JObject>( - $T obj, - $T obj2, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - obj2.$type, - obj.$type, - ]) as jni.JObjType<$T>; - return _of2(obj.reference.pointer, obj2.reference.pointer) - .object($MyStackType(T)); - } - - static final _push = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyStack__push") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public void push(T item) - void push( - $T item, - ) { - _push(reference.pointer, item.reference.pointer).check(); - } - - static final _pop = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("MyStack__pop") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public T pop() - /// The returned object must be released after use, by calling the [release] method. - $T pop() { - return _pop(reference.pointer).object(T); - } - - static final _size = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("MyStack__size") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int size() - int size() { - return _size(reference.pointer).integer; - } -} - -final class $MyStackType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - - const $MyStackType( - this.T, - ); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyStack;"; - - @override - MyStack<$T> fromReference(jni.JReference reference) => - MyStack.fromReference(T, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($MyStackType, T); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyStackType<$T>) && - other is $MyStackType<$T> && - T == other.T; - } -} - -/// from: com.github.dart_lang.jnigen.generics.StringKeyedMap -class StringKeyedMap<$V extends jni.JObject> extends MyMap { - @override - late final jni.JObjType> $type = type(V); - - final jni.JObjType<$V> V; - - StringKeyedMap.fromReference( - this.V, - jni.JReference reference, - ) : super.fromReference(const jni.JStringType(), V, reference); - - /// The type which includes information such as the signature of this class. - static $StringKeyedMapType<$V> type<$V extends jni.JObject>( - jni.JObjType<$V> V, - ) { - return $StringKeyedMapType( - V, - ); - } - - static final _new0 = jniLookup>( - "StringKeyedMap__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringKeyedMap({ - required jni.JObjType<$V> V, - }) { - return StringKeyedMap.fromReference(V, _new0().reference); - } -} - -final class $StringKeyedMapType<$V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$V> V; - - const $StringKeyedMapType( - this.V, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;"; - - @override - StringKeyedMap<$V> fromReference(jni.JReference reference) => - StringKeyedMap.fromReference(V, reference); - - @override - jni.JObjType get superType => $MyMapType(const jni.JStringType(), V); - - @override - final superCount = 2; - - @override - int get hashCode => Object.hash($StringKeyedMapType, V); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringKeyedMapType<$V>) && - other is $StringKeyedMapType<$V> && - V == other.V; - } -} - -/// from: com.github.dart_lang.jnigen.generics.StringStack -class StringStack extends MyStack { - @override - late final jni.JObjType $type = type; - - StringStack.fromReference( - jni.JReference reference, - ) : super.fromReference(const jni.JStringType(), reference); - - /// The type which includes information such as the signature of this class. - static const type = $StringStackType(); - static final _new0 = jniLookup>( - "StringStack__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringStack() { - return StringStack.fromReference(_new0().reference); - } -} - -final class $StringStackType extends jni.JObjType { - const $StringStackType(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringStack;"; - - @override - StringStack fromReference(jni.JReference reference) => - StringStack.fromReference(reference); - - @override - jni.JObjType get superType => const $MyStackType(jni.JStringType()); - - @override - final superCount = 2; - - @override - int get hashCode => ($StringStackType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringStackType) && other is $StringStackType; - } -} - -/// from: com.github.dart_lang.jnigen.generics.StringValuedMap -class StringValuedMap<$K extends jni.JObject> extends MyMap<$K, jni.JString> { - @override - late final jni.JObjType> $type = type(K); - - final jni.JObjType<$K> K; - - StringValuedMap.fromReference( - this.K, - jni.JReference reference, - ) : super.fromReference(K, const jni.JStringType(), reference); - - /// The type which includes information such as the signature of this class. - static $StringValuedMapType<$K> type<$K extends jni.JObject>( - jni.JObjType<$K> K, - ) { - return $StringValuedMapType( - K, - ); - } - - static final _new0 = jniLookup>( - "StringValuedMap__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringValuedMap({ - required jni.JObjType<$K> K, - }) { - return StringValuedMap.fromReference(K, _new0().reference); - } -} - -final class $StringValuedMapType<$K extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - - const $StringValuedMapType( - this.K, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/StringValuedMap;"; - - @override - StringValuedMap<$K> fromReference(jni.JReference reference) => - StringValuedMap.fromReference(K, reference); - - @override - jni.JObjType get superType => $MyMapType(K, const jni.JStringType()); - - @override - final superCount = 2; - - @override - int get hashCode => Object.hash($StringValuedMapType, K); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringValuedMapType<$K>) && - other is $StringValuedMapType<$K> && - K == other.K; - } -} - -/// from: com.github.dart_lang.jnigen.interfaces.MyInterface -class MyInterface<$T extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(T); - - final jni.JObjType<$T> T; - - MyInterface.fromReference( - this.T, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $MyInterfaceType<$T> type<$T extends jni.JObject>( - jni.JObjType<$T> T, - ) { - return $MyInterfaceType( - T, - ); - } - - static final _voidCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyInterface__voidCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract void voidCallback(java.lang.String s) - void voidCallback( - jni.JString s, - ) { - _voidCallback(reference.pointer, s.reference.pointer).check(); - } - - static final _stringCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyInterface__stringCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract java.lang.String stringCallback(java.lang.String s) - /// The returned object must be released after use, by calling the [release] method. - jni.JString stringCallback( - jni.JString s, - ) { - return _stringCallback(reference.pointer, s.reference.pointer) - .object(const jni.JStringType()); - } - - static final _varCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyInterface__varCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract T varCallback(T t) - /// The returned object must be released after use, by calling the [release] method. - $T varCallback( - $T t, - ) { - return _varCallback(reference.pointer, t.reference.pointer).object(T); - } - - static final _manyPrimitives = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Int32, - ffi.Uint8, - ffi.Uint16, - ffi.Double)>>("MyInterface__manyPrimitives") - .asFunction< - jni.JniResult Function( - ffi.Pointer, int, int, int, double)>(); - - /// from: public abstract long manyPrimitives(int a, boolean b, char c, double d) - int manyPrimitives( - int a, - bool b, - int c, - double d, - ) { - return _manyPrimitives(reference.pointer, a, b ? 1 : 0, c, d).long; - } - - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } - - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, - ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == r"voidCallback(Ljava/lang/String;)V") { - _$impls[$p]!.voidCallback( - $a[0].castTo(const jni.JStringType(), releaseOriginal: true), - ); - return jni.nullptr; - } - if ($d == r"stringCallback(Ljava/lang/String;)Ljava/lang/String;") { - final $r = _$impls[$p]!.stringCallback( - $a[0].castTo(const jni.JStringType(), releaseOriginal: true), - ); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); - } - if ($d == r"varCallback(Ljava/lang/Object;)Ljava/lang/Object;") { - final $r = _$impls[$p]!.varCallback( - $a[0].castTo(_$impls[$p]!.T, releaseOriginal: true), - ); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); - } - if ($d == r"manyPrimitives(IZCD)J") { - final $r = _$impls[$p]!.manyPrimitives( - $a[0] - .castTo(const jni.JIntegerType(), releaseOriginal: true) - .intValue(releaseOriginal: true), - $a[1] - .castTo(const jni.JBooleanType(), releaseOriginal: true) - .booleanValue(releaseOriginal: true), - $a[2] - .castTo(const jni.JCharacterType(), releaseOriginal: true) - .charValue(releaseOriginal: true), - $a[3] - .castTo(const jni.JDoubleType(), releaseOriginal: true) - .doubleValue(releaseOriginal: true), - ); - return jni.JLong($r).reference.toPointer(); - } - } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); - } - return jni.nullptr; - } - - factory MyInterface.implement( - $MyInterfaceImpl<$T> $impl, - ) { - final $p = ReceivePort(); - final $x = MyInterface.fromReference( - $impl.T, - ProtectedJniExtensions.newPortProxy( - r"com.github.dart_lang.jnigen.interfaces.MyInterface", - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; - } - static Map get $impls => _$impls; -} - -abstract interface class $MyInterfaceImpl<$T extends jni.JObject> { - factory $MyInterfaceImpl({ - required jni.JObjType<$T> T, - required void Function(jni.JString s) voidCallback, - required jni.JString Function(jni.JString s) stringCallback, - required $T Function($T t) varCallback, - required int Function(int a, bool b, int c, double d) manyPrimitives, - }) = _$MyInterfaceImpl; - - jni.JObjType<$T> get T; - - void voidCallback(jni.JString s); - jni.JString stringCallback(jni.JString s); - $T varCallback($T t); - int manyPrimitives(int a, bool b, int c, double d); -} - -class _$MyInterfaceImpl<$T extends jni.JObject> - implements $MyInterfaceImpl<$T> { - _$MyInterfaceImpl({ - required this.T, - required void Function(jni.JString s) voidCallback, - required jni.JString Function(jni.JString s) stringCallback, - required $T Function($T t) varCallback, - required int Function(int a, bool b, int c, double d) manyPrimitives, - }) : _voidCallback = voidCallback, - _stringCallback = stringCallback, - _varCallback = varCallback, - _manyPrimitives = manyPrimitives; - - @override - final jni.JObjType<$T> T; - - final void Function(jni.JString s) _voidCallback; - final jni.JString Function(jni.JString s) _stringCallback; - final $T Function($T t) _varCallback; - final int Function(int a, bool b, int c, double d) _manyPrimitives; - - void voidCallback(jni.JString s) { - return _voidCallback(s); - } - - jni.JString stringCallback(jni.JString s) { - return _stringCallback(s); - } - - $T varCallback($T t) { - return _varCallback(t); - } - - int manyPrimitives(int a, bool b, int c, double d) { - return _manyPrimitives(a, b, c, d); - } -} - -final class $MyInterfaceType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - - const $MyInterfaceType( - this.T, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyInterface;"; - - @override - MyInterface<$T> fromReference(jni.JReference reference) => - MyInterface.fromReference(T, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($MyInterfaceType, T); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceType<$T>) && - other is $MyInterfaceType<$T> && - T == other.T; - } -} - -/// from: com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer -class MyInterfaceConsumer extends jni.JObject { - @override - late final jni.JObjType $type = type; - - MyInterfaceConsumer.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $MyInterfaceConsumerType(); - static final _new0 = jniLookup>( - "MyInterfaceConsumer__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory MyInterfaceConsumer() { - return MyInterfaceConsumer.fromReference(_new0().reference); - } - - static final _consumeOnAnotherThread = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Uint8, - ffi.Uint16, - ffi.Double, - ffi.Pointer)>>( - "MyInterfaceConsumer__consumeOnAnotherThread") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - int, int, int, double, ffi.Pointer)>(); - - /// from: static public void consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String s, int a, boolean b, char c, double d, T t) - static void consumeOnAnotherThread<$T extends jni.JObject>( - MyInterface<$T> myInterface, - jni.JString s, - int a, - bool b, - int c, - double d, - $T t, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - t.$type, - (myInterface.$type as $MyInterfaceType).T, - ]) as jni.JObjType<$T>; - _consumeOnAnotherThread(myInterface.reference.pointer, s.reference.pointer, - a, b ? 1 : 0, c, d, t.reference.pointer) - .check(); - } - - static final _consumeOnSameThread = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Uint8, - ffi.Uint16, - ffi.Double, - ffi.Pointer)>>( - "MyInterfaceConsumer__consumeOnSameThread") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - int, int, int, double, ffi.Pointer)>(); - - /// from: static public void consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String s, int a, boolean b, char c, double d, T t) - static void consumeOnSameThread<$T extends jni.JObject>( - MyInterface<$T> myInterface, - jni.JString s, - int a, - bool b, - int c, - double d, - $T t, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - t.$type, - (myInterface.$type as $MyInterfaceType).T, - ]) as jni.JObjType<$T>; - _consumeOnSameThread(myInterface.reference.pointer, s.reference.pointer, a, - b ? 1 : 0, c, d, t.reference.pointer) - .check(); - } -} - -final class $MyInterfaceConsumerType extends jni.JObjType { - const $MyInterfaceConsumerType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;"; - - @override - MyInterfaceConsumer fromReference(jni.JReference reference) => - MyInterfaceConsumer.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($MyInterfaceConsumerType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceConsumerType) && - other is $MyInterfaceConsumerType; - } -} - -/// from: com.github.dart_lang.jnigen.interfaces.MyRunnable -class MyRunnable extends jni.JObject { - @override - late final jni.JObjType $type = type; - - MyRunnable.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $MyRunnableType(); - static final _run = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("MyRunnable__run") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract void run() - void run() { - _run(reference.pointer).check(); - } - - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } - - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, - ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == r"run()V") { - _$impls[$p]!.run(); - return jni.nullptr; - } - } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); - } - return jni.nullptr; - } - - factory MyRunnable.implement( - $MyRunnableImpl $impl, - ) { - final $p = ReceivePort(); - final $x = MyRunnable.fromReference( - ProtectedJniExtensions.newPortProxy( - r"com.github.dart_lang.jnigen.interfaces.MyRunnable", - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; - } -} - -abstract interface class $MyRunnableImpl { - factory $MyRunnableImpl({ - required void Function() run, - }) = _$MyRunnableImpl; - - void run(); -} - -class _$MyRunnableImpl implements $MyRunnableImpl { - _$MyRunnableImpl({ - required void Function() run, - }) : _run = run; - - final void Function() _run; - - void run() { - return _run(); - } -} - -final class $MyRunnableType extends jni.JObjType { - const $MyRunnableType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;"; - - @override - MyRunnable fromReference(jni.JReference reference) => - MyRunnable.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($MyRunnableType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableType) && other is $MyRunnableType; - } -} - -/// from: com.github.dart_lang.jnigen.interfaces.MyRunnableRunner -class MyRunnableRunner extends jni.JObject { - @override - late final jni.JObjType $type = type; - - MyRunnableRunner.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $MyRunnableRunnerType(); - static final _get_error = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_MyRunnableRunner__error") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_error = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_MyRunnableRunner__error") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public java.lang.Throwable error - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get error => - _get_error(reference.pointer).object(const jni.JObjectType()); - - /// from: public java.lang.Throwable error - /// The returned object must be released after use, by calling the [release] method. - set error(jni.JObject value) => - _set_error(reference.pointer, value.reference.pointer).check(); - - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "MyRunnableRunner__new0") - .asFunction)>(); - - /// from: public void (com.github.dart_lang.jnigen.interfaces.MyRunnable runnable) - /// The returned object must be released after use, by calling the [release] method. - factory MyRunnableRunner( - MyRunnable runnable, - ) { - return MyRunnableRunner.fromReference( - _new0(runnable.reference.pointer).reference); - } - - static final _runOnSameThread = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("MyRunnableRunner__runOnSameThread") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public void runOnSameThread() - void runOnSameThread() { - _runOnSameThread(reference.pointer).check(); - } - - static final _runOnAnotherThread = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("MyRunnableRunner__runOnAnotherThread") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public void runOnAnotherThread() - void runOnAnotherThread() { - _runOnAnotherThread(reference.pointer).check(); - } -} - -final class $MyRunnableRunnerType extends jni.JObjType { - const $MyRunnableRunnerType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;"; - - @override - MyRunnableRunner fromReference(jni.JReference reference) => - MyRunnableRunner.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($MyRunnableRunnerType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableRunnerType) && - other is $MyRunnableRunnerType; - } -} - -/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable$Case -class JsonSerializable_Case extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonSerializable_Case.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonSerializable_CaseType(); - static final _values = - jniLookup>( - "JsonSerializable_Case__values") - .asFunction(); - - /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case[] values() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values().object(const jni.JArrayType($JsonSerializable_CaseType())); - } - - static final _valueOf = jniLookup< - ffi - .NativeFunction)>>( - "JsonSerializable_Case__valueOf") - .asFunction)>(); - - /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case valueOf(java.lang.String name) - /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case valueOf( - jni.JString name, - ) { - return _valueOf(name.reference.pointer) - .object(const $JsonSerializable_CaseType()); - } -} - -final class $JsonSerializable_CaseType - extends jni.JObjType { - const $JsonSerializable_CaseType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"; - - @override - JsonSerializable_Case fromReference(jni.JReference reference) => - JsonSerializable_Case.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonSerializable_CaseType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_CaseType) && - other is $JsonSerializable_CaseType; - } -} - -/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable -class JsonSerializable extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonSerializable.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $JsonSerializableType(); - static final _value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("JsonSerializable__value") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public abstract com.github.dart_lang.jnigen.annotations.JsonSerializable$Case value() - /// The returned object must be released after use, by calling the [release] method. - JsonSerializable_Case value() { - return _value(reference.pointer).object(const $JsonSerializable_CaseType()); - } - - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } - - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, - ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == - r"value()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;") { - final $r = _$impls[$p]!.value(); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); - } - } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); - } - return jni.nullptr; - } - - factory JsonSerializable.implement( - $JsonSerializableImpl $impl, - ) { - final $p = ReceivePort(); - final $x = JsonSerializable.fromReference( - ProtectedJniExtensions.newPortProxy( - r"com.github.dart_lang.jnigen.annotations.JsonSerializable", - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; - } -} - -abstract interface class $JsonSerializableImpl { - factory $JsonSerializableImpl({ - required JsonSerializable_Case Function() value, - }) = _$JsonSerializableImpl; - - JsonSerializable_Case value(); -} - -class _$JsonSerializableImpl implements $JsonSerializableImpl { - _$JsonSerializableImpl({ - required JsonSerializable_Case Function() value, - }) : _value = value; - - final JsonSerializable_Case Function() _value; - - JsonSerializable_Case value() { - return _value(); - } -} - -final class $JsonSerializableType extends jni.JObjType { - const $JsonSerializableType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;"; - - @override - JsonSerializable fromReference(jni.JReference reference) => - JsonSerializable.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($JsonSerializableType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializableType) && - other is $JsonSerializableType; - } -} - -/// from: com.github.dart_lang.jnigen.annotations.MyDataClass -class MyDataClass extends jni.JObject { - @override - late final jni.JObjType $type = type; - - MyDataClass.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $MyDataClassType(); - static final _new0 = jniLookup>( - "MyDataClass__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory MyDataClass() { - return MyDataClass.fromReference(_new0().reference); - } -} - -final class $MyDataClassType extends jni.JObjType { - const $MyDataClassType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/annotations/MyDataClass;"; - - @override - MyDataClass fromReference(jni.JReference reference) => - MyDataClass.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($MyDataClassType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyDataClassType) && other is $MyDataClassType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Color -class Color extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Color.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $ColorType(); - static final _values = - jniLookup>("Color__values") - .asFunction(); - - /// from: static public com.github.dart_lang.jnigen.simple_package.Color[] values() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values().object(const jni.JArrayType($ColorType())); - } - - static final _valueOf = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("Color__valueOf") - .asFunction)>(); - - /// from: static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name) - /// The returned object must be released after use, by calling the [release] method. - static Color valueOf( - jni.JString name, - ) { - return _valueOf(name.reference.pointer).object(const $ColorType()); - } -} - -final class $ColorType extends jni.JObjType { - const $ColorType(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/simple_package/Color;"; - - @override - Color fromReference(jni.JReference reference) => - Color.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($ColorType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($ColorType) && other is $ColorType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Exceptions -class Exceptions extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Exceptions.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $ExceptionsType(); - static final _new0 = jniLookup>( - "Exceptions__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Exceptions() { - return Exceptions.fromReference(_new0().reference); - } - - static final _new1 = - jniLookup>( - "Exceptions__new1") - .asFunction(); - - /// from: public void (float x) - /// The returned object must be released after use, by calling the [release] method. - factory Exceptions.new1( - double x, - ) { - return Exceptions.fromReference(_new1(x).reference); - } - - static final _new2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, - ffi.Int32, ffi.Int32)>>("Exceptions__new2") - .asFunction(); - - /// from: public void (int a, int b, int c, int d, int e, int f) - /// The returned object must be released after use, by calling the [release] method. - factory Exceptions.new2( - int a, - int b, - int c, - int d, - int e, - int f, - ) { - return Exceptions.fromReference(_new2(a, b, c, d, e, f).reference); - } - - static final _staticObjectMethod = - jniLookup>( - "Exceptions__staticObjectMethod") - .asFunction(); - - /// from: static public java.lang.Object staticObjectMethod() - /// The returned object must be released after use, by calling the [release] method. - static jni.JObject staticObjectMethod() { - return _staticObjectMethod().object(const jni.JObjectType()); - } - - static final _staticIntMethod = - jniLookup>( - "Exceptions__staticIntMethod") - .asFunction(); - - /// from: static public int staticIntMethod() - static int staticIntMethod() { - return _staticIntMethod().integer; - } - - static final _staticObjectArrayMethod = - jniLookup>( - "Exceptions__staticObjectArrayMethod") - .asFunction(); - - /// from: static public java.lang.Object[] staticObjectArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray staticObjectArrayMethod() { - return _staticObjectArrayMethod() - .object(const jni.JArrayType(jni.JObjectType())); - } - - static final _staticIntArrayMethod = - jniLookup>( - "Exceptions__staticIntArrayMethod") - .asFunction(); - - /// from: static public int[] staticIntArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray staticIntArrayMethod() { - return _staticIntArrayMethod().object(const jni.JArrayType(jni.jintType())); - } - - static final _objectMethod = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__objectMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object objectMethod() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject objectMethod() { - return _objectMethod(reference.pointer).object(const jni.JObjectType()); - } - - static final _intMethod = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__intMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int intMethod() - int intMethod() { - return _intMethod(reference.pointer).integer; - } - - static final _objectArrayMethod = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__objectArrayMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.lang.Object[] objectArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - jni.JArray objectArrayMethod() { - return _objectArrayMethod(reference.pointer) - .object(const jni.JArrayType(jni.JObjectType())); - } - - static final _intArrayMethod = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__intArrayMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int[] intArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - jni.JArray intArrayMethod() { - return _intArrayMethod(reference.pointer) - .object(const jni.JArrayType(jni.jintType())); - } - - static final _throwNullPointerException = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__throwNullPointerException") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int throwNullPointerException() - int throwNullPointerException() { - return _throwNullPointerException(reference.pointer).integer; - } - - static final _throwFileNotFoundException = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__throwFileNotFoundException") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.io.InputStream throwFileNotFoundException() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwFileNotFoundException() { - return _throwFileNotFoundException(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _throwClassCastException = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__throwClassCastException") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public java.io.FileInputStream throwClassCastException() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwClassCastException() { - return _throwClassCastException(reference.pointer) - .object(const jni.JObjectType()); - } - - static final _throwArrayIndexException = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__throwArrayIndexException") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int throwArrayIndexException() - int throwArrayIndexException() { - return _throwArrayIndexException(reference.pointer).integer; - } - - static final _throwArithmeticException = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - )>>("Exceptions__throwArithmeticException") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - )>(); - - /// from: public int throwArithmeticException() - int throwArithmeticException() { - return _throwArithmeticException(reference.pointer).integer; - } - - static final _throwLoremIpsum = - jniLookup>( - "Exceptions__throwLoremIpsum") - .asFunction(); - - /// from: static public void throwLoremIpsum() - static void throwLoremIpsum() { - _throwLoremIpsum().check(); - } -} - -final class $ExceptionsType extends jni.JObjType { - const $ExceptionsType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Exceptions;"; - - @override - Exceptions fromReference(jni.JReference reference) => - Exceptions.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($ExceptionsType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($ExceptionsType) && other is $ExceptionsType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Fields -class Fields extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Fields.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $FieldsType(); - static final _get_amount = - jniLookup>( - "get_Fields__amount") - .asFunction(); - - static final _set_amount = - jniLookup>( - "set_Fields__amount") - .asFunction(); - - /// from: static public int amount - static int get amount => _get_amount().integer; - - /// from: static public int amount - static set amount(int value) => _set_amount(value).check(); - - static final _get_pi = - jniLookup>("get_Fields__pi") - .asFunction(); - - static final _set_pi = - jniLookup>( - "set_Fields__pi") - .asFunction(); - - /// from: static public double pi - static double get pi => _get_pi().doubleFloat; - - /// from: static public double pi - static set pi(double value) => _set_pi(value).check(); - - static final _get_asterisk = - jniLookup>( - "get_Fields__asterisk") - .asFunction(); - - static final _set_asterisk = - jniLookup>( - "set_Fields__asterisk") - .asFunction(); - - /// from: static public char asterisk - static int get asterisk => _get_asterisk().char; - - /// from: static public char asterisk - static set asterisk(int value) => _set_asterisk(value).check(); - - static final _get_name = - jniLookup>( - "get_Fields__name") - .asFunction(); - - static final _set_name = jniLookup< - ffi - .NativeFunction)>>( - "set_Fields__name") - .asFunction)>(); - - /// from: static public java.lang.String name - /// The returned object must be released after use, by calling the [release] method. - static jni.JString get name => _get_name().object(const jni.JStringType()); - - /// from: static public java.lang.String name - /// The returned object must be released after use, by calling the [release] method. - static set name(jni.JString value) => - _set_name(value.reference.pointer).check(); - - static final _get_i = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__i") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_i = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>("set_Fields__i") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public java.lang.Integer i - /// The returned object must be released after use, by calling the [release] method. - jni.JInteger get i => - _get_i(reference.pointer).object(const jni.JIntegerType()); - - /// from: public java.lang.Integer i - /// The returned object must be released after use, by calling the [release] method. - set i(jni.JInteger value) => - _set_i(reference.pointer, value.reference.pointer).check(); - - static final _get_trillion = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__trillion") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_trillion = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Int64)>>("set_Fields__trillion") - .asFunction(); - - /// from: public long trillion - int get trillion => _get_trillion(reference.pointer).long; - - /// from: public long trillion - set trillion(int value) => _set_trillion(reference.pointer, value).check(); - - static final _get_isAchillesDead = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__isAchillesDead") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_isAchillesDead = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Uint8)>>("set_Fields__isAchillesDead") - .asFunction(); - - /// from: public boolean isAchillesDead - bool get isAchillesDead => _get_isAchillesDead(reference.pointer).boolean; - - /// from: public boolean isAchillesDead - set isAchillesDead(bool value) => - _set_isAchillesDead(reference.pointer, value ? 1 : 0).check(); - - static final _get_bestFighterInGreece = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__bestFighterInGreece") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_bestFighterInGreece = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_Fields__bestFighterInGreece") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public java.lang.String bestFighterInGreece - /// The returned object must be released after use, by calling the [release] method. - jni.JString get bestFighterInGreece => - _get_bestFighterInGreece(reference.pointer) - .object(const jni.JStringType()); - - /// from: public java.lang.String bestFighterInGreece - /// The returned object must be released after use, by calling the [release] method. - set bestFighterInGreece(jni.JString value) => - _set_bestFighterInGreece(reference.pointer, value.reference.pointer) - .check(); - - static final _get_random = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__random") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_random = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>("set_Fields__random") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - - /// from: public java.util.Random random - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get random => - _get_random(reference.pointer).object(const jni.JObjectType()); - - /// from: public java.util.Random random - /// The returned object must be released after use, by calling the [release] method. - set random(jni.JObject value) => - _set_random(reference.pointer, value.reference.pointer).check(); - - static final _get_euroSymbol = - jniLookup>( - "get_Fields__euroSymbol") - .asFunction(); - - static final _set_euroSymbol = - jniLookup>( - "set_Fields__euroSymbol") - .asFunction(); - - /// from: static public char euroSymbol - static int get euroSymbol => _get_euroSymbol().char; - - /// from: static public char euroSymbol - static set euroSymbol(int value) => _set_euroSymbol(value).check(); - - static final _new0 = - jniLookup>("Fields__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Fields() { - return Fields.fromReference(_new0().reference); - } -} - -final class $FieldsType extends jni.JObjType { - const $FieldsType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Fields;"; - - @override - Fields fromReference(jni.JReference reference) => - Fields.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($FieldsType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($FieldsType) && other is $FieldsType; - } -} - -/// from: com.github.dart_lang.jnigen.simple_package.Fields$Nested -class Fields_Nested extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Fields_Nested.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static const type = $Fields_NestedType(); - static final _get_hundred = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields_Nested__hundred") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); - - static final _set_hundred = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Int64)>>("set_Fields_Nested__hundred") - .asFunction(); - - /// from: public long hundred - int get hundred => _get_hundred(reference.pointer).long; - - /// from: public long hundred - set hundred(int value) => _set_hundred(reference.pointer, value).check(); - - static final _get_BEST_GOD = - jniLookup>( - "get_Fields_Nested__BEST_GOD") - .asFunction(); - - static final _set_BEST_GOD = jniLookup< - ffi - .NativeFunction)>>( - "set_Fields_Nested__BEST_GOD") - .asFunction)>(); - - /// from: static public java.lang.String BEST_GOD - /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BEST_GOD => - _get_BEST_GOD().object(const jni.JStringType()); - - /// from: static public java.lang.String BEST_GOD - /// The returned object must be released after use, by calling the [release] method. - static set BEST_GOD(jni.JString value) => - _set_BEST_GOD(value.reference.pointer).check(); - - static final _new0 = jniLookup>( - "Fields_Nested__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Fields_Nested() { - return Fields_Nested.fromReference(_new0().reference); - } -} - -final class $Fields_NestedType extends jni.JObjType { - const $Fields_NestedType(); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;"; - - @override - Fields_Nested fromReference(jni.JReference reference) => - Fields_Nested.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($Fields_NestedType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($Fields_NestedType) && - other is $Fields_NestedType; - } -} - -/// from: com.github.dart_lang.jnigen.generics.GenericTypeParams -class GenericTypeParams<$S extends jni.JObject, $K extends jni.JObject> - extends jni.JObject { - @override - late final jni.JObjType> $type = type(S, K); - - final jni.JObjType<$S> S; - final jni.JObjType<$K> K; - - GenericTypeParams.fromReference( - this.S, - this.K, - jni.JReference reference, - ) : super.fromReference(reference); - - /// The type which includes information such as the signature of this class. - static $GenericTypeParamsType<$S, $K> - type<$S extends jni.JObject, $K extends jni.JObject>( - jni.JObjType<$S> S, - jni.JObjType<$K> K, - ) { - return $GenericTypeParamsType( - S, - K, - ); - } - - static final _new0 = jniLookup>( - "GenericTypeParams__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory GenericTypeParams({ - required jni.JObjType<$S> S, - required jni.JObjType<$K> K, - }) { - return GenericTypeParams.fromReference(S, K, _new0().reference); - } -} - -final class $GenericTypeParamsType<$S extends jni.JObject, - $K extends jni.JObject> extends jni.JObjType> { - final jni.JObjType<$S> S; - final jni.JObjType<$K> K; - - const $GenericTypeParamsType( - this.S, - this.K, - ); - - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;"; - - @override - GenericTypeParams<$S, $K> fromReference(jni.JReference reference) => - GenericTypeParams.fromReference(S, K, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GenericTypeParamsType, S, K); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($GenericTypeParamsType<$S, $K>) && - other is $GenericTypeParamsType<$S, $K> && - S == other.S && - K == other.K; - } -} - -/// from: com.github.dart_lang.jnigen.generics.StringMap -class StringMap extends StringKeyedMap { - @override - late final jni.JObjType $type = type; - - StringMap.fromReference( - jni.JReference reference, - ) : super.fromReference(const jni.JStringType(), reference); - - /// The type which includes information such as the signature of this class. - static const type = $StringMapType(); - static final _new0 = - jniLookup>("StringMap__new0") - .asFunction(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringMap() { - return StringMap.fromReference(_new0().reference); - } -} - -final class $StringMapType extends jni.JObjType { - const $StringMapType(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringMap;"; - - @override - StringMap fromReference(jni.JReference reference) => - StringMap.fromReference(reference); - - @override - jni.JObjType get superType => const $StringKeyedMapType(jni.JStringType()); - - @override - final superCount = 3; - - @override - int get hashCode => ($StringMapType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringMapType) && other is $StringMapType; - } -} diff --git a/pkgs/jnigen/test/simple_package_test/generate.dart b/pkgs/jnigen/test/simple_package_test/generate.dart index 9f5988880..afabf9746 100644 --- a/pkgs/jnigen/test/simple_package_test/generate.dart +++ b/pkgs/jnigen/test/simple_package_test/generate.dart @@ -48,12 +48,10 @@ void compileJavaSources(String workingDir, List files) async { } } -Config getConfig([BindingsType bindingsType = BindingsType.cBased]) { +Config getConfig() { compileJavaSources(javaPath, javaFiles); - final typeDir = bindingsType.getConfigString(); - final cWrapperDir = Uri.directory(join(testRoot, typeDir, "c_bindings")); final dartWrappersRoot = Uri.directory( - join(testRoot, typeDir, "dart_bindings"), + join(testRoot, "bindings"), ); final config = Config( sourcePath: [Uri.directory(javaPath)], @@ -72,11 +70,6 @@ Config getConfig([BindingsType bindingsType = BindingsType.cBased]) { ''' }, outputConfig: OutputConfig( - bindingsType: bindingsType, - cConfig: CCodeOutputConfig( - path: cWrapperDir, - libraryName: 'simple_package', - ), dartConfig: DartCodeOutputConfig( path: dartWrappersRoot.resolve('simple_package.dart'), structure: OutputStructure.singleFile, @@ -89,6 +82,5 @@ Config getConfig([BindingsType bindingsType = BindingsType.cBased]) { } void main() async { - await generateJniBindings(getConfig(BindingsType.cBased)); - await generateJniBindings(getConfig(BindingsType.dartOnly)); + await generateJniBindings(getConfig()); } diff --git a/pkgs/jnigen/test/simple_package_test/generated_files_test.dart b/pkgs/jnigen/test/simple_package_test/generated_files_test.dart index 0f595d2ff..a0c5b974a 100644 --- a/pkgs/jnigen/test/simple_package_test/generated_files_test.dart +++ b/pkgs/jnigen/test/simple_package_test/generated_files_test.dart @@ -2,25 +2,14 @@ // 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 'package:jnigen/jnigen.dart'; -import 'package:test/test.dart'; - import 'generate.dart'; import '../test_util/test_util.dart'; void main() async { await checkLocallyBuiltDependencies(); - generateAndCompareBothModes( + generateAndCompare( 'Generate and compare bindings for simple_package java files', - getConfig(BindingsType.cBased), - getConfig(BindingsType.dartOnly), + getConfig(), ); - - test("Generate and analyze bindings for simple_package - pure dart", - () async { - await generateAndAnalyzeBindings( - getConfig(BindingsType.dartOnly), - ); - }); // test if generated file == expected file } diff --git a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart index 9c31e9dfb..a3386aebc 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart @@ -10,7 +10,7 @@ import 'package:jni/jni.dart'; import '../test_util/callback_types.dart'; -import 'c_based/dart_bindings/simple_package.dart'; +import 'bindings/simple_package.dart'; const pi = 3.14159; const fpDelta = 0.001; diff --git a/pkgs/jnigen/test/test_util/bindings_test_setup.dart b/pkgs/jnigen/test/test_util/bindings_test_setup.dart index 2800aa1e7..0f1baefdb 100644 --- a/pkgs/jnigen/test/test_util/bindings_test_setup.dart +++ b/pkgs/jnigen/test/test_util/bindings_test_setup.dart @@ -30,14 +30,6 @@ Future bindingsTestSetup() async { await runCommand('dart', [ 'run', 'jni:setup', - '-p', - 'jni', - '-s', - join(simplePackageTest, 'c_based', 'c_bindings'), - '-s', - join(kotlinTest, 'c_based', 'c_bindings'), - '-s', - join(jacksonCoreTest, 'third_party', 'c_based', 'c_bindings'), ]); tempClassDir = Directory.current.createTempSync("jnigen_runtime_test_classpath_"); diff --git a/pkgs/jnigen/test/test_util/summary_util.dart b/pkgs/jnigen/test/test_util/summary_util.dart index 0d445837c..9218e9113 100644 --- a/pkgs/jnigen/test/test_util/summary_util.dart +++ b/pkgs/jnigen/test/test_util/summary_util.dart @@ -48,7 +48,6 @@ Config getSummaryGenerationConfig( {List? sourcePath, List? classPath}) { return Config( outputConfig: OutputConfig( - bindingsType: BindingsType.dartOnly, dartConfig: DartCodeOutputConfig( path: Uri.file('unused.dart'), structure: OutputStructure.singleFile, diff --git a/pkgs/jnigen/test/test_util/test_util.dart b/pkgs/jnigen/test/test_util/test_util.dart index 2a52b75c4..85a1cca2a 100644 --- a/pkgs/jnigen/test/test_util/test_util.dart +++ b/pkgs/jnigen/test/test_util/test_util.dart @@ -100,15 +100,11 @@ void comparePaths(String path1, String path2) { } Future _generateTempBindings(Config config, Directory tempDir) async { - final tempSrc = tempDir.uri.resolve("src/"); final singleFile = config.outputConfig.dartConfig.structure == OutputStructure.singleFile; final tempLib = singleFile ? tempDir.uri.resolve("generated.dart") : tempDir.uri.resolve("lib/"); - if (config.outputConfig.bindingsType == BindingsType.cBased) { - config.outputConfig.cConfig!.path = tempSrc; - } config.outputConfig.dartConfig.path = tempLib; config.logLevel = Level.WARNING; await generateJniBindings(config); @@ -118,16 +114,11 @@ Future _generateTempBindings(Config config, Directory tempDir) async { /// /// [dartReferenceBindings] can be directory or file depending on output /// configuration. -/// -/// If the config generates C code, [cReferenceBindings] must be a non-null -/// directory path. Future generateAndCompareBindings(Config config) async { final dartReferenceBindings = config.outputConfig.dartConfig.path.toFilePath(); - final cReferenceBindings = config.outputConfig.cConfig?.path.toFilePath(); final currentDir = Directory.current; final tempDir = currentDir.createTempSync("jnigen_test_temp"); - final tempSrc = tempDir.uri.resolve("src/"); final singleFile = config.outputConfig.dartConfig.structure == OutputStructure.singleFile; final tempLib = singleFile @@ -136,9 +127,6 @@ Future generateAndCompareBindings(Config config) async { try { await _generateTempBindings(config, tempDir); comparePaths(dartReferenceBindings, tempLib.toFilePath()); - if (config.outputConfig.bindingsType == BindingsType.cBased) { - comparePaths(cReferenceBindings!, tempSrc.toFilePath()); - } } finally { tempDir.deleteSync(recursive: true); } @@ -184,50 +172,19 @@ const bindingTests = [ ]; const registrantName = 'runtime_test_registrant.dart'; -const replicaName = 'runtime_test_registrant_dartonly_generated.dart'; - -void warnIfRuntimeTestsAreOutdated() { - final runtimeTests = join('test', 'generated_runtime_test.dart'); - if (!File(runtimeTests).existsSync()) { - log.fatal('Runtime test files not found. To run binding ' - 'runtime tests, please generate them by running ' - '`dart run tool/generate_runtime_tests.dart`'); - } - const regenInstr = 'Please run `dart run tool/generate_runtime_tests.dart` ' - 'and try again.'; - for (var testName in bindingTests) { - final registrant = File(join('test', testName, registrantName)); - final replica = File(join('test', testName, replicaName)); - if (!replica.existsSync()) { - log.fatal( - 'One or more generated runtime tests do not exist. $regenInstr', - ); - } - if (replica.lastModifiedSync().isBefore(registrant.lastModifiedSync())) { - log.fatal( - 'One or more generated runtime tests are not up-to-date. $regenInstr', - ); - } - } -} /// Verifies if locally built dependencies (currently `ApiSummarizer`) /// are up-to-date. Future checkLocallyBuiltDependencies() async { await failIfSummarizerNotBuilt(); - warnIfRuntimeTestsAreOutdated(); } -void generateAndCompareBothModes( +void generateAndCompare( String description, - Config cBasedConfig, - Config dartOnlyConfig, + Config config, ) { - test('$description (cBased)', () async { - await generateAndCompareBindings(cBasedConfig); - }, timeout: const Timeout(Duration(minutes: 2))); - test('$description (dartOnly)', () async { - await generateAndCompareBindings(dartOnlyConfig); + test(description, () async { + await generateAndCompareBindings(config); }, timeout: const Timeout(Duration(minutes: 2))); } diff --git a/pkgs/jnigen/tool/generate_runtime_tests.dart b/pkgs/jnigen/tool/generate_runtime_tests.dart deleted file mode 100644 index a95e414c1..000000000 --- a/pkgs/jnigen/tool/generate_runtime_tests.dart +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) 2023, 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:path/path.dart'; -import 'package:args/args.dart'; - -import 'package:jnigen/src/logging/logging.dart'; - -final lineBreak = Platform.isWindows ? '\r\n' : '\n'; - -void runCommand(String exec, List args) { - final proc = Process.runSync(exec, args, runInShell: true); - log.info('Execute $exec ${args.join(" ")}'); - if (proc.exitCode != 0) { - exitCode = proc.exitCode; - printError(proc.stdout); - printError(proc.stderr); - throw Exception('Command failed: $exec ${args.join(" ")}'); - } -} - -const testPath = 'test'; -const registrantFileName = 'runtime_test_registrant.dart'; -const dartOnlyRegistrantFileName = - 'runtime_test_registrant_dartonly_generated.dart'; - -// Paths of generated files, should not be checked in. -// If you change this, add the corresponding entry to .gitignore as well. -const replicaSuffix = '_dartonly_generated.dart'; -final runnerFilePath = join(testPath, 'generated_runtime_test.dart'); -final androidRunnerFilePath = - join('android_test_runner', 'integration_test', 'runtime_test.dart'); - -final generatedComment = - '// Generated file. Do not edit or check-in to version control.$lineBreak'; -const copyright = ''' -// Copyright (c) 2023, 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. -'''; - -const bindingTests = [ - 'jackson_core_test', - 'simple_package_test', - 'kotlin_test', -]; - -const hasThirdPartyDir = {'jackson_core_test'}; - -final _generatedFiles = [ - for (var testName in bindingTests) - join(testPath, testName, dartOnlyRegistrantFileName), - runnerFilePath, - androidRunnerFilePath, -]; - -void generateReplicasAndRunner() { - final imports = {}; - for (var testName in bindingTests) { - final registrant = join(testName, registrantFileName); - final registrantFile = File(join(testPath, registrant)); - final contents = registrantFile - .readAsStringSync() - .replaceAll('c_based/dart_bindings/', 'dart_only/dart_bindings/'); - - final replica = registrant.replaceAll('.dart', replicaSuffix); - final replicaFile = File(join(testPath, replica)); - replicaFile.writeAsStringSync('$generatedComment$lineBreak$contents'); - log.info('Generated $replica'); - imports['${testName}_c_based'] = - Uri.file(registrant).toFilePath(windows: false); - imports['${testName}_dart_only'] = - Uri.file(replica).toFilePath(windows: false); - } - final importStrings = imports.entries - .map((e) => 'import "${e.value}" as ${e.key};') - .join(lineBreak); - final androidImportStrings = imports.entries - .map((e) => 'import "../../test/${e.value}" as ${e.key};') - .join(lineBreak); - final runStrings = imports.keys - .map((name) => '$name.registerTests("$name", test);') - .join('$lineBreak '); - final runnerProgram = ''' -$generatedComment -$copyright -import 'package:test/test.dart'; -import 'test_util/bindings_test_setup.dart' as setup; - -$importStrings - -void main() { - setUpAll(setup.bindingsTestSetup); - $runStrings - tearDownAll(setup.bindingsTestTeardown); -} -'''; - final runnerFile = File(runnerFilePath); - runnerFile.writeAsStringSync(runnerProgram); - log.info('Generated runner $runnerFilePath'); - - final androidRunnerProgram = ''' -$generatedComment -$copyright -import "package:flutter_test/flutter_test.dart"; -import "package:jni/jni.dart"; - -$androidImportStrings - -typedef TestCaseCallback = void Function(); - -void test(String description, TestCaseCallback testCase) { - testWidgets(description, (widgetTester) async => testCase()); -} - -void main() { - $runStrings -} -'''; - File(androidRunnerFilePath).writeAsStringSync(androidRunnerProgram); - log.info('Generated android runner: $androidRunnerFilePath'); - - final cMakePath = - join('android_test_runner', 'android', 'app', 'CMakeLists.txt'); - - final cmakeSubdirs = bindingTests.map((testName) { - final indirect = hasThirdPartyDir.contains(testName) ? '/third_party' : ''; - return 'add_subdirectory' - '(../../../test/$testName$indirect/c_based/c_bindings ' - '${testName}_build)'; - }).join(lineBreak); - final cMakeConfig = ''' -## Parent CMake for Android native build target. This will build -## all C bindings from tests. - -cmake_minimum_required(VERSION 3.10) - -project(simple_package VERSION 0.0.1 LANGUAGES C) - -$cmakeSubdirs -'''; - File(cMakePath).writeAsStringSync(cMakeConfig); - log.info('Wrote Android CMake file: $cMakePath'); -} - -void cleanup() { - for (var path in _generatedFiles) { - File(path).deleteSync(); - log.info('Deleted $path'); - } -} - -void main(List args) async { - final parser = ArgParser() - ..addFlag( - 'help', - abbr: 'h', - help: 'show help', - negatable: false, - ) - ..addFlag( - 'clean', - abbr: 'c', - help: 'clear generated files', - negatable: false, - ); - final argResults = parser.parse(args); - if (argResults['help']) { - stderr.writeln( - 'Generates runtime tests for both Dart-only and C based bindings.'); - stderr.writeln(parser.usage); - return; - } else if (argResults['clean']) { - cleanup(); - } else { - generateReplicasAndRunner(); - runCommand('dart', ['format', ..._generatedFiles]); - } -} diff --git a/pkgs/jnigen/tool/pr_checks.dart b/pkgs/jnigen/tool/pr_checks.dart deleted file mode 100644 index 3e983c244..000000000 --- a/pkgs/jnigen/tool/pr_checks.dart +++ /dev/null @@ -1,180 +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. - -// This is a script to run a subset of CI checks on development machine before -// submitting PR. This prevents from accidentally forgetting to format or -// remove an unused import. - -// This is rough around the edges. This script may give false positives such -// as some gitignore'd temporary files failing the comparison. - -// On windows, please install 'diffutils' using your favorite package installer -// for this script to work correctly. Also ensure that clang-format is on your -// PATH. - -import 'dart:async'; -import 'dart:io'; - -import 'package:args/args.dart'; - -import 'command_runner.dart'; - -// Flags -const _clone = 'clone'; - -void main(List arguments) async { - final parser = ArgParser() - ..addFlag( - _clone, - help: 'Run checks in a cloned copy of the project.', - defaultsTo: true, - negatable: true, - ); - final argResults = parser.parse(arguments); - final shouldClone = argResults[_clone] as bool; - final gitRoot = getRepositoryRoot(); - - // change to project root - Directory.current = gitRoot.toFilePath(); - - var tempDir = Directory.current; - if (shouldClone) { - tempDir = Directory.current.createTempSync('jnigen_checks_clone_'); - final gitClone = Runner("Clone jni", Directory.current.uri) - ..chainCommand('git', ['clone', '.', tempDir.path]); - await gitClone.run(); - } - - final jniPath = tempDir.uri.resolve("jni/"); - final jnigenPath = tempDir.uri.resolve("jnigen/"); - final pubGet = Runner("Pub get", tempDir.uri) - ..chainCommand("flutter", ["pub", "get", "--offline"], - workingDirectory: jniPath) - ..chainCommand("dart", ["pub", "get", "--offline"], - workingDirectory: jnigenPath); - await pubGet.run(); - - final jniAnalyze = Runner("Analyze JNI", jniPath); - jniAnalyze - ..chainCommand("dart", ["analyze", "--fatal-infos"]) - ..chainCommand( - "dart", ["format", "--output=none", "--set-exit-if-changed", "."]) - ..chainCommand( - "clang-format", - [ - "--dry-run", - "-Werror", - "dartjni.c", - "dartjni.h", - "third_party/global_jni_env.c", - "third_party/global_jni_env.h", - ], - workingDirectory: jniPath.resolve("src/")); - final jniTest = Runner("Test JNI", jniPath) - ..chainCommand("dart", ["run", "jni:setup"]) - ..chainCommand("dart", ["test", "-j", "1"]); - unawaited(jniAnalyze.run().then((f) => jniTest.run())); - - List getJavaFiles(String relativePath) => - Directory.fromUri(jnigenPath.resolve(relativePath)) - .listSync(recursive: true) - .where((file) => file.path.endsWith(".java")) - .map((file) => file.path) - .toList(); - - final javaFiles = getJavaFiles("java/") + - getJavaFiles("test/simple_package_test") + - getJavaFiles("example/in_app_java") + - getJavaFiles("example/notification_plugin"); - - final checkJavaFormat = Runner("Check java format", jnigenPath) - ..chainCommand( - "google-java-format", ["-n", "--set-exit-if-changed", ...javaFiles]); - - unawaited(checkJavaFormat.run()); - - final ffigenBindingsPath = getRepositoryRoot() - .resolve("jni/lib/src/third_party/jni_bindings_generated.dart"); - final ffigenBindings = File.fromUri(ffigenBindingsPath); - final oldBindingsText = ffigenBindings.readAsStringSync(); - final ffigenCompare = Runner("Generate & Compare FFIGEN bindings", jniPath) - ..chainCommand("dart", ["run", "ffigen", "--config", "ffigen.yaml"]) - ..chainCallback("compare bindings", () async { - final newBindingsText = await ffigenBindings.readAsString(); - if (newBindingsText != oldBindingsText) { - await ffigenBindings.writeAsString(oldBindingsText); - throw "new JNI.h bindings differ from old bindings"; - } - }); - unawaited(ffigenCompare.run()); - - final jnigenAnalyze = Runner("Analyze jnigen", jnigenPath) - ..chainCommand("dart", ["analyze", "--fatal-infos"]) - ..chainCommand( - "dart", ["format", "--output=none", "--set-exit-if-changed", "."]) - ..chainCommand("dart", ["run", "jnigen:setup"]); - - // Tests may need more time when running on systems with less cores. - // So '--timeout 2x' is specified. - final jnigenTest = Runner("Test jnigen", gitRoot.resolve("jnigen/")) - ..chainCommand("dart", ["test", "--timeout", "2x"]); - - // Note: Running in_app_java and notification_plugin checks on source dir - // itself, because running flutter build in cloned dir will take time. - final compareInAppJavaBindings = Runner( - "Generate & compare InAppJava bindings", - gitRoot.resolve("jnigen/example/in_app_java")) - ..chainCommand("dart", [ - "run", - "jnigen", - "--config", - "jnigen.yaml", - "-Doutput.c.path=src_temp/", - "-Doutput.dart.path=_temp.dart", - ]) - ..chainCommand("diff", ["lib/android_utils.dart", "_temp.dart"]) - ..chainCommand("diff", ["-qr", "src/android_utils/", "src_temp/"]) - ..chainCleanupCommand("rm", ["-r", "_temp.dart", "src_temp"]); - - final comparePdfboxBindings = Runner("Generate & compare PdfBox Bindings", - gitRoot.resolve("jnigen/example/pdfbox_plugin")) - ..chainCommand("dart", [ - "run", - "jnigen", - "--config", - "jnigen.yaml", - "-Doutput.c.path=src_temp/", - "-Doutput.dart.path=lib_temp/", - ]) - ..chainCommand("diff", ["-qr", "lib/src/third_party/", "lib_temp/"]) - ..chainCommand("diff", ["-qr", "src/", "src_temp/"]) - ..chainCleanupCommand("rm", ["-r", "lib_temp", "src_temp"]); - - final compareNotificationPluginBindings = Runner( - "Generate & compare NotificationPlugin Bindings", - gitRoot.resolve("jnigen/example/notification_plugin")) - ..chainCommand("dart", [ - "run", - "jnigen", - "--config", - "jnigen.yaml", - "-Doutput.c.path=src_temp/", - "-Doutput.dart.path=_temp.dart", - ]) - ..chainCommand("diff", ["lib/notifications.dart", "_temp.dart"]) - ..chainCommand("diff", ["-qr", "src/", "src_temp/"]) - ..chainCleanupCommand("rm", ["-r", "_temp.dart", "src_temp"]); - - unawaited(jnigenAnalyze.run().then((_) { - final test = jnigenTest.run(); - final inAppJava = compareInAppJavaBindings.run(); - final pdfBox = comparePdfboxBindings.run(); - final notificationPlugin = compareNotificationPluginBindings.run(); - return Future.wait([test, inAppJava, pdfBox, notificationPlugin]); - }).then((_) { - if (shouldClone) { - tempDir.deleteSync(recursive: true); - } - })); -}