diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml index cf486c7627..48ec557e57 100644 --- a/.github/workflows/jnigen.yaml +++ b/.github/workflows/jnigen.yaml @@ -408,7 +408,7 @@ jobs: run: | dart pub get dart run jni:setup - wget 'https://dart.dev/guides/language/specifications/DartLangSpec-v2.2.pdf' + wget 'https://raw.githubusercontent.com/dart-lang/site-www/a7f170389e210adc2aef810cc9a6fdbfa78059a5/src/guides/language/specifications/DartLangSpec-v2.2.pdf' dart run bin/pdf_info.dart DartLangSpec-v2.2.pdf working-directory: ./pkgs/jnigen/example/pdfbox_plugin/dart_example - name: Build flutter example for pdfbox_plugin diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 9a7e8dbb14..7fe46187d3 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -5,6 +5,8 @@ - **Breaking Change** ([#792](https://github.com/dart-lang/native/issues/792)]): `static final String` fields get converted to `JString` getters instead of `static const String` fields in Dart. +- Fixed a bug where a package would either be searched from sources or classes + but not both. ## 0.7.0 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 6f6340d11e..0be99f71c4 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -27,43 +27,31 @@ import "package:jni/jni.dart" as jni; final ffi.Pointer Function(String sym) jniLookup = ProtectedJniExtensions.initGeneratedLibrary("android_utils"); -/// from: com.example.in_app_java.AndroidUtils -class AndroidUtils extends jni.JObject { +/// from: androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult +class EmojiCompat_CodepointSequenceMatchResult extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = + type; - AndroidUtils.fromRef( + EmojiCompat_CodepointSequenceMatchResult.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $AndroidUtilsType(); - static final _showToast = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>("AndroidUtils__showToast") - .asFunction< - jni.JniResult Function( - 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, - ) { - return _showToast(mainActivity.reference, text.reference, duration).check(); - } + static const type = $EmojiCompat_CodepointSequenceMatchResultType(); } -final class $AndroidUtilsType extends jni.JObjType { - const $AndroidUtilsType(); +final class $EmojiCompat_CodepointSequenceMatchResultType + extends jni.JObjType { + const $EmojiCompat_CodepointSequenceMatchResultType(); @override - String get signature => r"Lcom/example/in_app_java/AndroidUtils;"; + String get signature => + r"Landroidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult;"; @override - AndroidUtils fromRef(jni.JObjectPtr ref) => AndroidUtils.fromRef(ref); + EmojiCompat_CodepointSequenceMatchResult fromRef(jni.JObjectPtr ref) => + EmojiCompat_CodepointSequenceMatchResult.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -72,980 +60,827 @@ final class $AndroidUtilsType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($AndroidUtilsType).hashCode; + int get hashCode => ($EmojiCompat_CodepointSequenceMatchResultType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($AndroidUtilsType) && - other is $AndroidUtilsType; + return other.runtimeType == + ($EmojiCompat_CodepointSequenceMatchResultType) && + other is $EmojiCompat_CodepointSequenceMatchResultType; } } -/// from: androidx.emoji2.text.EmojiCompat -/// -/// Main class to keep Android devices up to date with the newest emojis by adding EmojiSpans -/// to a given CharSequence. -///

-/// By default, EmojiCompat is initialized by EmojiCompatInitializer, which performs -/// deferred font loading to avoid potential app startup delays. The default behavior is to load -/// the font shortly after the first Activity resumes. EmojiCompatInitializer will configure -/// EmojiCompat to use the system emoji font provider via DefaultEmojiCompatConfig and -/// always creates a new background thread for font loading. -///

-/// EmojiCompat will only allow one instance to be initialized and any calls to -/// \#init(Config) after the first one will have no effect. As a result, configuration options -/// may not be provided when using EmojiCompatInitializer. To provide a custom configuration, -/// disable EmojiCompatInitializer in the manifest with: -/// -///

-///     <provider
-///         android:name="androidx.startup.InitializationProvider"
-///         android:authorities="${applicationId}.androidx-startup"
-///         android:exported="false"
-///         tools:node="merge">
-///         <meta-data android:name="androidx.emoji2.text.EmojiCompatInitializer"
-///                   tools:node="remove" />
-///     </provider>
-/// 
+/// from: androidx.emoji2.text.EmojiCompat$Config /// -/// When not using EmojiCompatInitializer, EmojiCompat must to be initialized manually using -/// \#init(EmojiCompat.Config). It is recommended to make the initialization as early as -/// possible in your app, such as from Application\#onCreate(). -///

-/// \#init(Config) is fast and may be called from the main thread on the path to -/// displaying the first activity. However, loading the emoji font takes significant resources on a -/// background thread, so it is suggested to use \#LOAD_STRATEGY_MANUAL in all manual -/// configurations to defer font loading until after the first screen displays. Font loading may -/// be started by calling \#load()}. See the implementation EmojiCompatInitializer -/// for ideas when building a manual configuration. -///

-/// After initialization the \#get() function can be used to get the configured instance and -/// the \#process(CharSequence) function can be used to update a CharSequence with emoji -/// EmojiSpans. -///

-///

CharSequence processedSequence = EmojiCompat.get().process("some string")
-///

-/// During loading information about emojis is not available. Before the -/// EmojiCompat instance has finished loading, calls to functions such as EmojiCompat\#process(CharSequence) will throw an exception. It is safe to call process when -/// \#getLoadState() returns \#LOAD_STATE_SUCCEEDED. To register a callback when -/// loading completes use InitCallback. -///

-class EmojiCompat extends jni.JObject { +/// Configuration class for EmojiCompat. Changes to the values will be ignored after +/// \#init(Config) is called. +///@see \#init(EmojiCompat.Config) +class EmojiCompat_Config extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - EmojiCompat.fromRef( + EmojiCompat_Config.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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 const type = $EmojiCompat_ConfigType(); + static final _new0 = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat_Config__new0") + .asFunction)>(); - /// from: static public final java.lang.String EDITOR_INFO_METAVERSION_KEY + /// from: protected void (androidx.emoji2.text.EmojiCompat.MetadataRepoLoader metadataLoader) /// The returned object must be released after use, by calling the [release] method. /// - /// Key in EditorInfo\#extras that represents the emoji metadata version used by the - /// widget. The existence of the value means that the widget is using EmojiCompat. - ///

- /// If exists, the value for the key is an {@code int} and can be used to query EmojiCompat to - /// see whether the widget has the ability to display a certain emoji using - /// \#hasEmojiGlyph(CharSequence, int). - static jni.JString get EDITOR_INFO_METAVERSION_KEY => const jni.JStringType() - .fromRef(_get_EDITOR_INFO_METAVERSION_KEY().object); + /// Default constructor. + ///@param metadataLoader MetadataRepoLoader instance, cannot be {@code null} + factory EmojiCompat_Config( + EmojiCompat_MetadataRepoLoader metadataLoader, + ) { + return EmojiCompat_Config.fromRef(_new0(metadataLoader.reference).object); + } - static final _get_EDITOR_INFO_REPLACE_ALL_KEY = - jniLookup>( - "get_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY") - .asFunction(); + static final _registerInitCallback = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "EmojiCompat_Config__registerInitCallback") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>(); - /// from: static public final java.lang.String EDITOR_INFO_REPLACE_ALL_KEY + /// 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. /// - /// 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 => const jni.JStringType() - .fromRef(_get_EDITOR_INFO_REPLACE_ALL_KEY().object); - - /// from: static public final int LOAD_STATE_DEFAULT - /// - /// EmojiCompat instance is constructed, however the initialization did not start yet. - ///@see \#getLoadState() - static const LOAD_STATE_DEFAULT = 3; + /// Registers an initialization callback. + ///@param initCallback the initialization callback to register, cannot be {@code null} + ///@return EmojiCompat.Config instance + EmojiCompat_Config registerInitCallback( + EmojiCompat_InitCallback initCallback, + ) { + return const $EmojiCompat_ConfigType().fromRef( + _registerInitCallback(reference, initCallback.reference).object); + } - /// from: static public final int LOAD_STATE_LOADING - /// - /// EmojiCompat is initializing. - ///@see \#getLoadState() - static const LOAD_STATE_LOADING = 0; + static final _unregisterInitCallback = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "EmojiCompat_Config__unregisterInitCallback") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>(); - /// from: static public final int LOAD_STATE_SUCCEEDED + /// 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. /// - /// EmojiCompat successfully initialized. - ///@see \#getLoadState() - static const LOAD_STATE_SUCCEEDED = 1; + /// Unregisters a callback that was added before. + ///@param initCallback the initialization callback to be removed, cannot be {@code null} + ///@return EmojiCompat.Config instance + EmojiCompat_Config unregisterInitCallback( + EmojiCompat_InitCallback initCallback, + ) { + return const $EmojiCompat_ConfigType().fromRef( + _unregisterInitCallback(reference, initCallback.reference).object); + } - /// from: static public final int LOAD_STATE_FAILED - /// - /// An unrecoverable error occurred during initialization of EmojiCompat. Calls to functions - /// such as \#process(CharSequence) will fail. - ///@see \#getLoadState() - static const LOAD_STATE_FAILED = 2; + static final _setReplaceAll = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Uint8)>>("EmojiCompat_Config__setReplaceAll") + .asFunction, int)>(); - /// from: static public final int REPLACE_STRATEGY_DEFAULT + /// from: public androidx.emoji2.text.EmojiCompat.Config setReplaceAll(boolean replaceAll) + /// The returned object must be released after use, by calling the [release] method. /// - /// Replace strategy that uses the value given in EmojiCompat.Config. - ///@see \#process(CharSequence, int, int, int, int) - static const REPLACE_STRATEGY_DEFAULT = 0; + /// Determines whether EmojiCompat should replace all the emojis it finds with the + /// EmojiSpans. By default EmojiCompat tries its best to understand if the system already + /// can render an emoji and do not replace those emojis. + ///@param replaceAll replace all emojis found with EmojiSpans + ///@return EmojiCompat.Config instance + EmojiCompat_Config setReplaceAll( + bool replaceAll, + ) { + return const $EmojiCompat_ConfigType() + .fromRef(_setReplaceAll(reference, replaceAll ? 1 : 0).object); + } - /// from: static public final int REPLACE_STRATEGY_ALL - /// - /// Replace strategy to add EmojiSpans for all emoji that were found. - ///@see \#process(CharSequence, int, int, int, int) - static const REPLACE_STRATEGY_ALL = 1; + static final _setUseEmojiAsDefaultStyle = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Uint8)>>("EmojiCompat_Config__setUseEmojiAsDefaultStyle") + .asFunction, int)>(); - /// from: static public final int REPLACE_STRATEGY_NON_EXISTENT + /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle) + /// The returned object must be released after use, by calling the [release] method. /// - /// Replace strategy to add EmojiSpans only for emoji that do not exist in the system. - static const REPLACE_STRATEGY_NON_EXISTENT = 2; + /// Determines whether EmojiCompat should use the emoji presentation style for emojis + /// that have text style as default. By default, the text style would be used, unless these + /// are followed by the U+FE0F variation selector. + /// Details about emoji presentation and text presentation styles can be found here: + /// http://unicode.org/reports/tr51/\#Presentation_Style + /// If useEmojiAsDefaultStyle is true, the emoji presentation style will be used for all + /// emojis, including potentially unexpected ones (such as digits or other keycap emojis). If + /// this is not the expected behaviour, method + /// \#setUseEmojiAsDefaultStyle(boolean, List) can be used to specify the + /// exception emojis that should be still presented as text style. + ///@param useEmojiAsDefaultStyle whether to use the emoji style presentation for all emojis + /// that would be presented as text style by default + EmojiCompat_Config setUseEmojiAsDefaultStyle( + bool useEmojiAsDefaultStyle, + ) { + return const $EmojiCompat_ConfigType().fromRef( + _setUseEmojiAsDefaultStyle(reference, useEmojiAsDefaultStyle ? 1 : 0) + .object); + } - /// from: static public final int LOAD_STRATEGY_DEFAULT - /// - /// EmojiCompat will start loading metadata when \#init(Config) is called. - ///@see Config\#setMetadataLoadStrategy(int) - static const LOAD_STRATEGY_DEFAULT = 0; + static final _setUseEmojiAsDefaultStyle1 = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, ffi.Uint8, + ffi.Pointer)>>( + "EmojiCompat_Config__setUseEmojiAsDefaultStyle1") + .asFunction< + jni.JniResult Function( + ffi.Pointer, int, ffi.Pointer)>(); - /// from: static public final int LOAD_STRATEGY_MANUAL + /// 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. /// - /// EmojiCompat will wait for \#load() to be called by developer in order to - /// start loading metadata. - ///@see Config\#setMetadataLoadStrategy(int) - static const LOAD_STRATEGY_MANUAL = 1; + /// @see \#setUseEmojiAsDefaultStyle(boolean) + ///@param emojiAsDefaultStyleExceptions Contains the exception emojis which will be still + /// presented as text style even if the + /// useEmojiAsDefaultStyle flag is set to {@code true}. + /// This list will be ignored if useEmojiAsDefaultStyle + /// is {@code false}. Note that emojis with default + /// emoji style presentation will remain emoji style + /// regardless the value of useEmojiAsDefaultStyle or + /// whether they are included in the exceptions list or + /// not. When no exception is wanted, the method + /// \#setUseEmojiAsDefaultStyle(boolean) should + /// be used instead. + EmojiCompat_Config setUseEmojiAsDefaultStyle1( + bool useEmojiAsDefaultStyle, + jni.JList emojiAsDefaultStyleExceptions, + ) { + return const $EmojiCompat_ConfigType().fromRef(_setUseEmojiAsDefaultStyle1( + reference, + useEmojiAsDefaultStyle ? 1 : 0, + emojiAsDefaultStyleExceptions.reference) + .object); + } - /// from: static public final int EMOJI_UNSUPPORTED - /// - /// Result of \#getEmojiMatch(CharSequence, int) that means no part of this codepoint - /// sequence will ever generate an EmojiSpan at the requested metadata level. - /// - /// This return value implies: - /// - EmojiCompat will always defer to system emoji font - /// - System emoji font may or may not support this emoji - /// - This application MAY render this emoji - /// - /// This can be used by keyboards to learn that EmojiCompat does not support this codepoint - /// sequence at this metadata version. The system emoji font is not checked by this method, - /// and this result will be returned even if the system emoji font supports the emoji. This may - /// happen if the application is using an older version of the emoji compat font than the - /// system emoji font. - /// - /// Keyboards may optionally determine that the system emoji font will support the emoji, for - /// example by building a internal lookup table or calling - /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) to query the system - /// emoji font. Keyboards may use a lookup table to optimize this check, however they should be - /// aware that OEMs may add or remove emoji from the system emoji font. - /// - /// Keyboards may finally decide: - /// - If the system emoji font DOES NOT support the emoji, then the emoji IS NOT supported by - /// this application. - /// - If the system emoji font DOES support the emoji, then the emoji IS supported by this - /// application. - /// - If system emoji font is support is UNKNOWN, then assume the emoji IS NOT supported by - /// this application. - static const EMOJI_UNSUPPORTED = 0; + static final _setEmojiSpanIndicatorEnabled = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, ffi.Uint8)>>( + "EmojiCompat_Config__setEmojiSpanIndicatorEnabled") + .asFunction, int)>(); - /// from: static public final int EMOJI_SUPPORTED - /// - /// Result of \#getEmojiMatch(CharSequence, int) that means this codepoint can be drawn - /// by an EmojiSpan at this metadata level. - /// - /// No further checks are required by keyboards for this result. The emoji is always supported - /// by this application. - /// - /// This return value implies: - /// - EmojiCompat can draw this emoji - /// - System emoji font may or may not support this emoji - /// - This application WILL render this emoji - /// - /// This result implies that EmojiCompat can successfully display this emoji. The system emoji - /// font is not checked by this method, and this result may be returned even if the platform - /// also supports the emoji sequence. - /// - /// If the application passes EmojiCompat\#REPLACE_STRATEGY_ALL of true, then an - /// EmojiSpan will always be generated for this emoji. + /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorEnabled(boolean emojiSpanIndicatorEnabled) + /// The returned object must be released after use, by calling the [release] method. /// - /// If the application passes EmojiCompat\#REPLACE_STRATEGY_ALL of false, then an - /// EmojiSpan will only be generated if - /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) - /// returns false for this emoji. - static const EMOJI_SUPPORTED = 1; + /// Determines whether a background will be drawn for the emojis that are found and + /// replaced by EmojiCompat. Should be used only for debugging purposes. The indicator color + /// can be set using \#setEmojiSpanIndicatorColor(int). + ///@param emojiSpanIndicatorEnabled when {@code true} a background is drawn for each emoji + /// that is replaced + EmojiCompat_Config setEmojiSpanIndicatorEnabled( + bool emojiSpanIndicatorEnabled, + ) { + return const $EmojiCompat_ConfigType().fromRef( + _setEmojiSpanIndicatorEnabled( + reference, emojiSpanIndicatorEnabled ? 1 : 0) + .object); + } - /// from: static public final int EMOJI_FALLBACK - /// - /// Result of \#getEmojiMatch(CharSequence, int) that means the full codepoint sequence - /// is not known to emojicompat, but at least one subsequence is an emoji that is known at - /// this metadata level. - /// - /// Keyboards may decide that this emoji is not supported by the application when this result is - /// returned, with no further processing. - /// - /// This return value implies: - /// - EmojiCompat will decompose this ZWJ sequence into multiple glyphs when replaceAll=true - /// - EmojiCompat MAY defer to platform when replaceAll=false - /// - System emoji font may or may not support this emoji - /// - This application MAY render this emoji - /// - /// This return value is only ever returned for ZWJ sequences. To understand this result - /// consider when it may be returned for the multi-skin-tone handshake introduced in emoji 14. - /// - ///

-  ///     U+1FAF1 // unknown @ requested metadata level
-  ///     U+1F3FB // metadata level 1
-  ///     U+200D  // not displayed (ZWJ)
-  ///     U+1FAF2 // unknown @ requested metadata level
-  ///     U+1F3FD // metadata level 1
-  /// 
- /// - /// In this codepoint sequence, U+1F3FB and U+1F3FD are known from metadata level 1. When an - /// application is using a metadata level that doesn't understand this ZWJ and provides - /// EmojiCompat\#REPLACE_STRATEGY_ALL true, the color emoji are matched and replaced - /// with EmojiSpan. The system emoji font, even if it supports this ZWJ sequence, is - /// never queried and the added EmojiSpans force fallback rendering for the ZWJ sequence. - /// - /// The glyph will only display correctly for this application if ALL of the following - /// requirements are met: - /// - EmojiCompat\#REPLACE_STRATEGY_ALL is false - /// - androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) returns true for each - /// emoji subsequence known at this metadata level - /// - androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) returns true for the - /// full sequence - /// - /// Given this return value for the multi-skin-tone handshake above, if - /// EmojiCompat\#REPLACE_STRATEGY_ALL is false then the emoji will display if the - /// entire emoji sequence is matched by - /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) because U+1F3FB and - /// U+1F3FD are both in the system emoji font. - /// - /// Keyboards that wish to determine if the glyph will display correctly by the application in - /// response to this return value should consider building an internal lookup for new ZWJ - /// sequences instead of repeatedly calling - /// 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 _setEmojiSpanIndicatorColor = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Int32)>>("EmojiCompat_Config__setEmojiSpanIndicatorColor") + .asFunction, int)>(); - /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context) + /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorColor(int color) /// The returned object must be released after use, by calling the [release] method. /// - /// Initialize the singleton instance with the default system-provided configuration. - /// - /// This is the recommended configuration for most applications. For more details see - /// DefaultEmojiCompatConfig. - /// - /// - /// This call will use DefaultEmojiCompatConfig to lookup the default emoji font - /// provider installed on the system and use that, if present. If there is no default font - /// provider onthe system, this call will have no effect. + /// Sets the color used as emoji span indicator. The default value is + /// Color\#GREEN Color.GREEN. + ///@see \#setEmojiSpanIndicatorEnabled(boolean) + EmojiCompat_Config setEmojiSpanIndicatorColor( + int color, + ) { + return const $EmojiCompat_ConfigType() + .fromRef(_setEmojiSpanIndicatorColor(reference, color).object); + } + + static final _setMetadataLoadStrategy = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Int32)>>("EmojiCompat_Config__setMetadataLoadStrategy") + .asFunction, int)>(); + + /// from: public androidx.emoji2.text.EmojiCompat.Config setMetadataLoadStrategy(int strategy) + /// The returned object must be released after use, by calling the [release] method. /// + /// Determines the strategy to start loading the metadata. By default EmojiCompat + /// will start loading the metadata during EmojiCompat\#init(Config). When set to + /// EmojiCompat\#LOAD_STRATEGY_MANUAL, you should call EmojiCompat\#load() to + /// initiate metadata loading. + ///

+ /// Default implementations of EmojiCompat.MetadataRepoLoader start a thread + /// during their EmojiCompat.MetadataRepoLoader\#load functions. Just instantiating + /// and starting a thread might take time especially in older devices. Since + /// EmojiCompat\#init(Config) has to be called before any EmojiCompat widgets are + /// inflated, this results in time spent either on your Application.onCreate or Activity + /// .onCreate. If you'd like to gain more control on when to start loading the metadata + /// and be able to call EmojiCompat\#init(Config) with absolute minimum time cost you + /// can use EmojiCompat\#LOAD_STRATEGY_MANUAL. + ///

+ /// When set to EmojiCompat\#LOAD_STRATEGY_MANUAL, EmojiCompat will wait + /// for \#load() to be called by the developer in order to start loading metadata, + /// therefore you should call EmojiCompat\#load() to initiate metadata loading. + /// \#load() can be called from any thread. + ///

+  /// EmojiCompat.Config config = new FontRequestEmojiCompatConfig(context, fontRequest)
+  ///         .setMetadataLoadStrategy(EmojiCompat.LOAD_STRATEGY_MANUAL);
   ///
-  /// Note: EmojiCompat may only be initialized once, and will return the same instance
-  /// afterwords.
+  /// // EmojiCompat will not start loading metadata and MetadataRepoLoader\#load(...)
+  /// // will not be called
+  /// EmojiCompat.init(config);
   ///
-  ///@return Default EmojiCompat for this device, or null if there is no provider on the system.
-  static EmojiCompat init(
-    jni.JObject context,
+  /// // At any time (i.e. idle time or executorService is ready)
+  /// // call EmojiCompat\#load() to start loading metadata.
+  /// executorService.execute(() -> EmojiCompat.get().load());
+  /// 
+ ///@param strategy one of EmojiCompat\#LOAD_STRATEGY_DEFAULT, + /// EmojiCompat\#LOAD_STRATEGY_MANUAL + EmojiCompat_Config setMetadataLoadStrategy( + int strategy, ) { - return const $EmojiCompatType().fromRef(_init(context.reference).object); + return const $EmojiCompat_ConfigType() + .fromRef(_setMetadataLoadStrategy(reference, strategy).object); } - static final _init1 = jniLookup< + static final _setSpanFactory = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__init1") + ffi.Pointer)>>("EmojiCompat_Config__setSpanFactory") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigFactory defaultFactory) + /// 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. /// - /// @hide - static EmojiCompat init1( - jni.JObject context, - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory defaultFactory, + /// Set the span factory used to actually draw emoji replacements. + ///@param factory custum span factory that can draw the emoji replacements + ///@return this + EmojiCompat_Config setSpanFactory( + EmojiCompat_SpanFactory factory0, ) { - return const $EmojiCompatType() - .fromRef(_init1(context.reference, defaultFactory.reference).object); + return const $EmojiCompat_ConfigType() + .fromRef(_setSpanFactory(reference, factory0.reference).object); } - static final _init2 = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__init2") - .asFunction)>(); - - /// from: static public androidx.emoji2.text.EmojiCompat init(androidx.emoji2.text.EmojiCompat.Config config) + static final _setGlyphChecker = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "EmojiCompat_Config__setGlyphChecker") + .asFunction< + jni.JniResult Function( + ffi.Pointer, 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. /// - /// Initialize the singleton instance with a configuration. When used on devices running API 18 - /// or below, the singleton instance is immediately moved into \#LOAD_STATE_SUCCEEDED - /// state without loading any metadata. When called for the first time, the library will create - /// the singleton instance and any call after that will not create a new instance and return - /// immediately. - ///@see EmojiCompat.Config - static EmojiCompat init2( - EmojiCompat_Config config, + /// The interface that is used by EmojiCompat in order to check if a given emoji can be + /// rendered by the system. + ///@param glyphChecker GlyphChecker instance to be used. + EmojiCompat_Config setGlyphChecker( + EmojiCompat_GlyphChecker glyphChecker, ) { - return const $EmojiCompatType().fromRef(_init2(config.reference).object); - } - - static final _isConfigured = - jniLookup>( - "EmojiCompat__isConfigured") - .asFunction(); - - /// from: static public boolean isConfigured() - /// - /// Return true if EmojiCompat has been configured by a successful call to - /// EmojiCompat\#init. - /// - /// You can use this to check if EmojiCompat\#get() will return a valid EmojiCompat - /// instance. - /// - /// This function does not check the \#getLoadState() and will return true even if the - /// font is still loading, or has failed to load. - ///@return true if EmojiCompat has been successfully initialized. - static bool isConfigured() { - return _isConfigured().boolean; + return const $EmojiCompat_ConfigType() + .fromRef(_setGlyphChecker(reference, glyphChecker.reference).object); } - static final _reset = jniLookup< + static final _getMetadataRepoLoader = jniLookup< ffi .NativeFunction)>>( - "EmojiCompat__reset") + "EmojiCompat_Config__getMetadataRepoLoader") .asFunction)>(); - /// from: static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat.Config config) + /// from: protected final androidx.emoji2.text.EmojiCompat.MetadataRepoLoader getMetadataRepoLoader() /// The returned object must be released after use, by calling the [release] method. /// - /// Used by the tests to reset EmojiCompat with a new configuration. Every time it is called a - /// new instance is created with the new configuration. - ///@hide - static EmojiCompat reset( - EmojiCompat_Config config, - ) { - return const $EmojiCompatType().fromRef(_reset(config.reference).object); + /// Returns the MetadataRepoLoader. + EmojiCompat_MetadataRepoLoader getMetadataRepoLoader() { + return const $EmojiCompat_MetadataRepoLoaderType() + .fromRef(_getMetadataRepoLoader(reference).object); } +} - static final _reset1 = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__reset1") - .asFunction)>(); +final class $EmojiCompat_ConfigType extends jni.JObjType { + const $EmojiCompat_ConfigType(); - /// 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. - /// - /// Used by the tests to reset EmojiCompat with a new singleton instance. - ///@hide - static EmojiCompat reset1( - EmojiCompat emojiCompat, - ) { - return const $EmojiCompatType() - .fromRef(_reset1(emojiCompat.reference).object); - } + @override + String get signature => r"Landroidx/emoji2/text/EmojiCompat$Config;"; - static final _skipDefaultConfigurationLookup = - jniLookup>( - "EmojiCompat__skipDefaultConfigurationLookup") - .asFunction(); + @override + EmojiCompat_Config fromRef(jni.JObjectPtr ref) => + EmojiCompat_Config.fromRef(ref); - /// from: static public void skipDefaultConfigurationLookup(boolean shouldSkip) - /// - /// Reset default configuration lookup flag, for tests. - ///@hide - static void skipDefaultConfigurationLookup( - bool shouldSkip, - ) { - return _skipDefaultConfigurationLookup(shouldSkip ? 1 : 0).check(); - } + @override + jni.JObjType get superType => const jni.JObjectType(); - static final _get0 = jniLookup>( - "EmojiCompat__get0") - .asFunction(); + @override + final superCount = 1; - /// from: static public androidx.emoji2.text.EmojiCompat get() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Return singleton EmojiCompat instance. Should be called after - /// \#init(EmojiCompat.Config) is called to initialize the singleton instance. - ///@return EmojiCompat instance - ///@throws IllegalStateException if called before \#init(EmojiCompat.Config) - static EmojiCompat get0() { - return const $EmojiCompatType().fromRef(_get0().object); + @override + int get hashCode => ($EmojiCompat_ConfigType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_ConfigType) && + other is $EmojiCompat_ConfigType; } +} - static final _load = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__load") - .asFunction)>(); +/// from: androidx.emoji2.text.EmojiCompat$DefaultSpanFactory +/// +/// @hide +class EmojiCompat_DefaultSpanFactory extends jni.JObject { + @override + late final jni.JObjType $type = type; - /// from: public void load() - /// - /// When Config\#setMetadataLoadStrategy(int) is set to \#LOAD_STRATEGY_MANUAL, - /// this function starts loading the metadata. Calling the function when - /// Config\#setMetadataLoadStrategy(int) is {@code not} set to - /// \#LOAD_STRATEGY_MANUAL will throw an exception. The load will {@code not} start if: - ///
    - ///
  • the metadata is already loaded successfully and \#getLoadState() is - /// \#LOAD_STATE_SUCCEEDED. - ///
  • - ///
  • a previous load attempt is not finished yet and \#getLoadState() is - /// \#LOAD_STATE_LOADING.
  • - ///
- ///@throws IllegalStateException when Config\#setMetadataLoadStrategy(int) is not set - /// to \#LOAD_STRATEGY_MANUAL - void load() { - return _load(reference).check(); - } + EmojiCompat_DefaultSpanFactory.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); - static final _registerInitCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__registerInitCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + /// 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(); - /// from: public void registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) - /// - /// Registers an initialization callback. If the initialization is already completed by the time - /// the listener is added, the callback functions are called immediately. Callbacks are called on - /// the main looper. - ///

- /// When used on devices running API 18 or below, InitCallback\#onInitialized() is called - /// without loading any metadata. In such cases InitCallback\#onFailed(Throwable) is never - /// called. - ///@param initCallback the initialization callback to register, cannot be {@code null} - ///@see \#unregisterInitCallback(InitCallback) - void registerInitCallback( - EmojiCompat_InitCallback initCallback, - ) { - return _registerInitCallback(reference, initCallback.reference).check(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory EmojiCompat_DefaultSpanFactory() { + return EmojiCompat_DefaultSpanFactory.fromRef(_new0().object); } - static final _unregisterInitCallback = jniLookup< + static final _createSpan = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat__unregisterInitCallback") + "EmojiCompat_DefaultSpanFactory__createSpan") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) + /// 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. /// - /// Unregisters a callback that was added before. - ///@param initCallback the callback to be removed, cannot be {@code null} - void unregisterInitCallback( - EmojiCompat_InitCallback initCallback, + /// Returns a TypefaceEmojiSpan. + ///@param rasterizer TypefaceEmojiRasterizer instance, which can draw the emoji onto a + /// Canvas. + ///@return TypefaceEmojiSpan + jni.JObject createSpan( + jni.JObject rasterizer, ) { - return _unregisterInitCallback(reference, initCallback.reference).check(); + return const jni.JObjectType() + .fromRef(_createSpan(reference, rasterizer.reference).object); } +} - static final _getLoadState = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__getLoadState") - .asFunction)>(); +final class $EmojiCompat_DefaultSpanFactoryType + extends jni.JObjType { + const $EmojiCompat_DefaultSpanFactoryType(); - /// from: public int getLoadState() - /// - /// Returns loading state of the EmojiCompat instance. When used on devices running API 18 or - /// below always returns \#LOAD_STATE_SUCCEEDED. - ///@return one of \#LOAD_STATE_DEFAULT, \#LOAD_STATE_LOADING, - /// \#LOAD_STATE_SUCCEEDED, \#LOAD_STATE_FAILED - int getLoadState() { - return _getLoadState(reference).integer; - } + @override + String get signature => + r"Landroidx/emoji2/text/EmojiCompat$DefaultSpanFactory;"; - static final _isEmojiSpanIndicatorEnabled = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__isEmojiSpanIndicatorEnabled") - .asFunction)>(); + @override + EmojiCompat_DefaultSpanFactory fromRef(jni.JObjectPtr ref) => + EmojiCompat_DefaultSpanFactory.fromRef(ref); - /// from: public boolean isEmojiSpanIndicatorEnabled() - /// - /// @return whether a background should be drawn for the emoji for debugging - ///@hide - bool isEmojiSpanIndicatorEnabled() { - return _isEmojiSpanIndicatorEnabled(reference).boolean; - } + @override + jni.JObjType get superType => const jni.JObjectType(); - static final _getEmojiSpanIndicatorColor = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__getEmojiSpanIndicatorColor") - .asFunction)>(); + @override + final superCount = 1; - /// from: public int getEmojiSpanIndicatorColor() - /// - /// @return color of background drawn if EmojiCompat\#isEmojiSpanIndicatorEnabled is true - ///@hide - int getEmojiSpanIndicatorColor() { - return _getEmojiSpanIndicatorColor(reference).integer; + @override + int get hashCode => ($EmojiCompat_DefaultSpanFactoryType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_DefaultSpanFactoryType) && + other is $EmojiCompat_DefaultSpanFactoryType; } +} - static final _getEmojiStart = jniLookup< +/// from: androidx.emoji2.text.EmojiCompat$GlyphChecker +/// +/// Interface to check if a given emoji exists on the system. +class EmojiCompat_GlyphChecker extends jni.JObject { + @override + late final jni.JObjType $type = type; + + EmojiCompat_GlyphChecker.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// The type which includes information such as the signature of this class. + static const type = $EmojiCompat_GlyphCheckerType(); + static final _hasGlyph = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer, - ffi.Int32)>>("EmojiCompat__getEmojiStart") + ffi.Int32, + ffi.Int32, + ffi.Int32)>>("EmojiCompat_GlyphChecker__hasGlyph") .asFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int, int, int)>(); - /// from: public int getEmojiStart(java.lang.CharSequence charSequence, int offset) + /// from: public abstract boolean hasGlyph(java.lang.CharSequence charSequence, int start, int end, int sdkAdded) /// - /// Together with \#getEmojiEnd(CharSequence, int), if the character at {@code offset} is - /// part of an emoji, returns the index range of that emoji, start index inclusively/end index - /// exclusively so that {@code charSequence.subSequence(start, end)} will return that emoji. - /// E.g., getEmojiStart/End("AB\ud83d\ude00", 1) will return (-1,-1) since 'B' is not part an emoji; - /// getEmojiStart/End("AB\ud83d\ude00", 3) will return [2,4), note that "\ud83d\ude00" contains 2 Chars. - /// Returns -1 otherwise. - ///@param charSequence the whole sequence - ///@param offset index of the emoji to look up - ///@return the start index inclusively/end index exclusively - int getEmojiStart( + /// Return {@code true} if the emoji that is in {@code charSequence} between + /// {@code start}(inclusive) and {@code end}(exclusive) can be rendered on the system + /// using the default Typeface. + /// + /// This function is called after an emoji is identified in the given {@code charSequence} + /// and EmojiCompat wants to know if that emoji can be rendered on the system. The result + /// of this call will be cached and the same emoji sequence won't be asked for the same + /// EmojiCompat instance. + /// + /// When the function returns {@code true}, it will mean that the system can render the + /// emoji. In that case if Config\#setReplaceAll is set to {@code false}, then no + /// EmojiSpan will be added in the final emoji processing result. + /// + /// When the function returns {@code false}, it will mean that the system cannot render + /// the given emoji, therefore an EmojiSpan will be added to the final emoji + /// processing result. + /// + /// The default implementation of this class uses + /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) function to check + /// if the emoji can be rendered on the system. This is required even if EmojiCompat + /// knows about the SDK Version that the emoji was added on AOSP. Just the {@code sdkAdded} + /// information is not enough to reliably decide if emoji can be rendered since this + /// information may not be consistent across all the OEMs and all the Android versions. + /// + /// With this interface you can apply your own heuristics to check if the emoji can be + /// rendered on the system. For example, if you'd like to rely on the {@code sdkAdded} + /// information, and some predefined OEMs, it is possible to write the following code + /// snippet. + /// + /// {@sample frameworks/support/samples/SupportEmojiDemos/src/main/java/com/example/android/support/text/emoji/sample/GlyphCheckerSample.java glyphchecker} + ///@param charSequence the CharSequence that is being processed + ///@param start the inclusive starting offset for the emoji in the {@code charSequence} + ///@param end the exclusive end offset for the emoji in the {@code charSequence} + ///@param sdkAdded the API version that the emoji was added in AOSP + ///@return true if the given sequence can be rendered as a single glyph, otherwise false. + bool hasGlyph( jni.JObject charSequence, - int offset, + int start, + int end, + int sdkAdded, ) { - return _getEmojiStart(reference, charSequence.reference, offset).integer; + return _hasGlyph(reference, charSequence.reference, start, end, sdkAdded) + .boolean; } +} - static final _getEmojiEnd = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__getEmojiEnd") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); +final class $EmojiCompat_GlyphCheckerType + extends jni.JObjType { + const $EmojiCompat_GlyphCheckerType(); - /// from: public int getEmojiEnd(java.lang.CharSequence charSequence, int offset) - /// - /// see \#getEmojiStart(CharSequence, int). - int getEmojiEnd( - jni.JObject charSequence, - int offset, - ) { - return _getEmojiEnd(reference, charSequence.reference, offset).integer; + @override + String get signature => r"Landroidx/emoji2/text/EmojiCompat$GlyphChecker;"; + + @override + EmojiCompat_GlyphChecker fromRef(jni.JObjectPtr ref) => + EmojiCompat_GlyphChecker.fromRef(ref); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($EmojiCompat_GlyphCheckerType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_GlyphCheckerType) && + other is $EmojiCompat_GlyphCheckerType; } +} - static final _handleOnKeyDown = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Int32, - ffi.Pointer)>>("EmojiCompat__handleOnKeyDown") - .asFunction< - jni.JniResult Function( - ffi.Pointer, int, ffi.Pointer)>(); +/// from: androidx.emoji2.text.EmojiCompat$InitCallback +/// +/// Listener class for the initialization of the EmojiCompat. +class EmojiCompat_InitCallback extends jni.JObject { + @override + late final jni.JObjType $type = type; - /// from: static public boolean handleOnKeyDown(android.text.Editable editable, int keyCode, android.view.KeyEvent event) - /// - /// Handles onKeyDown commands from a KeyListener and if {@code keyCode} is one of - /// KeyEvent\#KEYCODE_DEL or KeyEvent\#KEYCODE_FORWARD_DEL it tries to delete an - /// EmojiSpan from an Editable. Returns {@code true} if an EmojiSpan is - /// deleted with the characters it covers. - ///

- /// If there is a selection where selection start is not equal to selection end, does not - /// delete. - ///

- /// When used on devices running API 18 or below, always returns {@code false}. - ///@param editable Editable instance passed to KeyListener\#onKeyDown(android.view.View, - /// Editable, int, KeyEvent) - ///@param keyCode keyCode passed to KeyListener\#onKeyDown(android.view.View, Editable, - /// int, KeyEvent) - ///@param event KeyEvent passed to KeyListener\#onKeyDown(android.view.View, Editable, - /// int, KeyEvent) - ///@return {@code true} if an EmojiSpan is deleted - static bool handleOnKeyDown( - jni.JObject editable, - int keyCode, - jni.JObject event, - ) { - return _handleOnKeyDown(editable.reference, keyCode, event.reference) - .boolean; + EmojiCompat_InitCallback.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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(); + + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory EmojiCompat_InitCallback() { + return EmojiCompat_InitCallback.fromRef(_new0().object); } - static final _handleDeleteSurroundingText = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Uint8)>>("EmojiCompat__handleDeleteSurroundingText") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); + static final _onInitialized = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat_InitCallback__onInitialized") + .asFunction)>(); - /// from: static public boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection inputConnection, android.text.Editable editable, int beforeLength, int afterLength, boolean inCodePoints) + /// from: public void onInitialized() /// - /// Handles deleteSurroundingText commands from InputConnection and tries to delete an - /// EmojiSpan from an Editable. Returns {@code true} if an EmojiSpan is - /// deleted. - ///

- /// If there is a selection where selection start is not equal to selection end, does not - /// delete. - ///

- /// When used on devices running API 18 or below, always returns {@code false}. - ///@param inputConnection InputConnection instance - ///@param editable TextView.Editable instance - ///@param beforeLength the number of characters before the cursor to be deleted - ///@param afterLength the number of characters after the cursor to be deleted - ///@param inCodePoints {@code true} if length parameters are in codepoints - ///@return {@code true} if an EmojiSpan is deleted - static bool handleDeleteSurroundingText( - jni.JObject inputConnection, - jni.JObject editable, - int beforeLength, - int afterLength, - bool inCodePoints, - ) { - return _handleDeleteSurroundingText(inputConnection.reference, - editable.reference, beforeLength, afterLength, inCodePoints ? 1 : 0) - .boolean; + /// 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() { + return _onInitialized(reference).check(); } - static final _hasEmojiGlyph = jniLookup< + static final _onFailed = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__hasEmojiGlyph") + ffi.Pointer)>>("EmojiCompat_InitCallback__onFailed") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: public boolean hasEmojiGlyph(java.lang.CharSequence sequence) + /// from: public void onFailed(java.lang.Throwable throwable) /// - /// Returns {@code true} if EmojiCompat is capable of rendering an emoji. When used on devices - /// running API 18 or below, always returns {@code false}. - ///@deprecated use getEmojiMatch which returns more accurate lookup information. - ///@param sequence CharSequence representing the emoji - ///@return {@code true} if EmojiCompat can render given emoji, cannot be {@code null} - ///@throws IllegalStateException if not initialized yet - bool hasEmojiGlyph( - jni.JObject sequence, + /// Called when an unrecoverable error occurs during EmojiCompat initialization. When used on + /// devices running API 18 or below, this function is never called. + void onFailed( + jni.JObject throwable, ) { - return _hasEmojiGlyph(reference, sequence.reference).boolean; + return _onFailed(reference, throwable.reference).check(); } +} - static final _hasEmojiGlyph1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__hasEmojiGlyph1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); +final class $EmojiCompat_InitCallbackType + extends jni.JObjType { + const $EmojiCompat_InitCallbackType(); - /// from: public boolean hasEmojiGlyph(java.lang.CharSequence sequence, int metadataVersion) - /// - /// Returns {@code true} if EmojiCompat is capable of rendering an emoji at the given metadata - /// version. When used on devices running API 18 or below, always returns {@code false}. - ///@deprecated use getEmojiMatch which returns more accurate lookup information. - ///@param sequence CharSequence representing the emoji - ///@param metadataVersion the metadata version to check against, should be greater than or - /// equal to {@code 0}, - ///@return {@code true} if EmojiCompat can render given emoji, cannot be {@code null} - ///@throws IllegalStateException if not initialized yet - bool hasEmojiGlyph1( - jni.JObject sequence, - int metadataVersion, - ) { - return _hasEmojiGlyph1(reference, sequence.reference, metadataVersion) - .boolean; + @override + String get signature => r"Landroidx/emoji2/text/EmojiCompat$InitCallback;"; + + @override + EmojiCompat_InitCallback fromRef(jni.JObjectPtr ref) => + EmojiCompat_InitCallback.fromRef(ref); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($EmojiCompat_InitCallbackType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_InitCallbackType) && + other is $EmojiCompat_InitCallbackType; } +} - static final _getEmojiMatch = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>("EmojiCompat__getEmojiMatch") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int)>(); +/// from: androidx.emoji2.text.EmojiCompat$LoadStrategy +class EmojiCompat_LoadStrategy extends jni.JObject { + @override + late final jni.JObjType $type = type; - /// from: public int getEmojiMatch(java.lang.CharSequence sequence, int metadataVersion) - /// - /// Attempts to lookup the entire sequence at the specified metadata version and returns what - /// the runtime match behavior would be. - /// - /// To be used by keyboards to show or hide emoji in response to specific metadata support. - ///@see \#EMOJI_SUPPORTED - ///@see \#EMOJI_UNSUPPORTED - ///@see \#EMOJI_FALLBACK - ///@param sequence CharSequence representing an emoji - ///@param metadataVersion the metada version to check against, should be greater than or - /// equal to {@code 0}, - ///@return A match result, or decomposes if replaceAll would cause partial subsequence matches. - int getEmojiMatch( - jni.JObject sequence, - int metadataVersion, - ) { - return _getEmojiMatch(reference, sequence.reference, metadataVersion) - .integer; + EmojiCompat_LoadStrategy.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// The type which includes information such as the signature of this class. + static const type = $EmojiCompat_LoadStrategyType(); +} + +final class $EmojiCompat_LoadStrategyType + extends jni.JObjType { + const $EmojiCompat_LoadStrategyType(); + + @override + String get signature => r"Landroidx/emoji2/text/EmojiCompat$LoadStrategy;"; + + @override + EmojiCompat_LoadStrategy fromRef(jni.JObjectPtr ref) => + EmojiCompat_LoadStrategy.fromRef(ref); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($EmojiCompat_LoadStrategyType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_LoadStrategyType) && + other is $EmojiCompat_LoadStrategyType; } +} - static final _process = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__process") +/// from: androidx.emoji2.text.EmojiCompat$MetadataRepoLoader +/// +/// Interface to load emoji metadata. +class EmojiCompat_MetadataRepoLoader extends jni.JObject { + @override + late final jni.JObjType $type = type; + + EmojiCompat_MetadataRepoLoader.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// The type which includes information such as the signature of this class. + static const type = $EmojiCompat_MetadataRepoLoaderType(); + static final _load = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "EmojiCompat_MetadataRepoLoader__load") .asFunction< jni.JniResult Function( ffi.Pointer, 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. + /// from: public abstract void load(androidx.emoji2.text.EmojiCompat.MetadataRepoLoaderCallback loaderCallback) /// - /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. When - /// used on devices running API 18 or below, returns the given {@code charSequence} without - /// processing it. - ///@param charSequence CharSequence to add the EmojiSpans - ///@throws IllegalStateException if not initialized yet - ///@see \#process(CharSequence, int, int) - jni.JObject process( - jni.JObject charSequence, + /// Start loading the metadata. When the loading operation is finished MetadataRepoLoaderCallback\#onLoaded(MetadataRepo) or + /// MetadataRepoLoaderCallback\#onFailed(Throwable) should be called. When used on + /// devices running API 18 or below, this function is never called. + ///@param loaderCallback callback to signal the loading state + void load( + EmojiCompat_MetadataRepoLoaderCallback loaderCallback, ) { - return const jni.JObjectType() - .fromRef(_process(reference, charSequence.reference).object); + return _load(reference, loaderCallback.reference).check(); } +} - static final _process1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32)>>("EmojiCompat__process1") +final class $EmojiCompat_MetadataRepoLoaderType + extends jni.JObjType { + const $EmojiCompat_MetadataRepoLoaderType(); + + @override + String get signature => + r"Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;"; + + @override + EmojiCompat_MetadataRepoLoader fromRef(jni.JObjectPtr ref) => + EmojiCompat_MetadataRepoLoader.fromRef(ref); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($EmojiCompat_MetadataRepoLoaderType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderType) && + other is $EmojiCompat_MetadataRepoLoaderType; + } +} + +/// from: androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback +/// +/// Callback to inform EmojiCompat about the state of the metadata load. Passed to +/// MetadataRepoLoader during MetadataRepoLoader\#load(MetadataRepoLoaderCallback) call. +class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { + @override + late final jni.JObjType $type = type; + + EmojiCompat_MetadataRepoLoaderCallback.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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(); + + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory EmojiCompat_MetadataRepoLoaderCallback() { + return EmojiCompat_MetadataRepoLoaderCallback.fromRef(_new0().object); + } + + static final _onLoaded = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "EmojiCompat_MetadataRepoLoaderCallback__onLoaded") .asFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int)>(); + ffi.Pointer, ffi.Pointer)>(); - /// 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. - /// - /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. + /// from: public abstract void onLoaded(androidx.emoji2.text.MetadataRepo metadataRepo) /// - ///

    - ///
  • If no emojis are found, {@code charSequence} given as the input is returned without - /// any changes. i.e. charSequence is a String, and no emojis are found, the same String is - /// returned.
  • - ///
  • If the given input is not a Spannable (such as String), and at least one emoji is found - /// a new android.text.Spannable instance is returned.
  • - ///
  • If the given input is a Spannable, the same instance is returned.
  • - ///
- /// When used on devices running API 18 or below, returns the given {@code charSequence} without - /// processing it. - ///@param charSequence CharSequence to add the EmojiSpans, cannot be {@code null} - ///@param start start index in the charSequence to look for emojis, should be greater than or - /// equal to {@code 0}, also less than or equal to {@code charSequence.length()} - ///@param end end index in the charSequence to look for emojis, should be greater than or equal - /// to {@code start} parameter, also less than or equal to - /// {@code charSequence.length()} - ///@throws IllegalStateException if not initialized yet - ///@throws IllegalArgumentException in the following cases: - /// {@code start < 0}, {@code end < 0}, {@code end < start}, - /// {@code start > charSequence.length()}, - /// {@code end > charSequence.length()} - jni.JObject process1( - jni.JObject charSequence, - int start, - int end, + /// Called by MetadataRepoLoader when metadata is loaded successfully. + ///@param metadataRepo MetadataRepo instance, cannot be {@code null} + void onLoaded( + jni.JObject metadataRepo, ) { - return const jni.JObjectType().fromRef( - _process1(reference, charSequence.reference, start, end).object); + return _onLoaded(reference, metadataRepo.reference).check(); } - static final _process2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("EmojiCompat__process2") + static final _onFailed = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "EmojiCompat_MetadataRepoLoaderCallback__onFailed") .asFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); + ffi.Pointer, ffi.Pointer)>(); - /// 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. + /// from: public abstract void onFailed(java.lang.Throwable throwable) /// - /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. - /// - ///
    - ///
  • If no emojis are found, {@code charSequence} given as the input is returned without - /// any changes. i.e. charSequence is a String, and no emojis are found, the same String is - /// returned.
  • - ///
  • If the given input is not a Spannable (such as String), and at least one emoji is found - /// a new android.text.Spannable instance is returned.
  • - ///
  • If the given input is a Spannable, the same instance is returned.
  • - ///
- /// When used on devices running API 18 or below, returns the given {@code charSequence} without - /// processing it. - ///@param charSequence CharSequence to add the EmojiSpans, cannot be {@code null} - ///@param start start index in the charSequence to look for emojis, should be greater than or - /// equal to {@code 0}, also less than or equal to {@code charSequence.length()} - ///@param end end index in the charSequence to look for emojis, should be greater than or - /// equal to {@code start} parameter, also less than or equal to - /// {@code charSequence.length()} - ///@param maxEmojiCount maximum number of emojis in the {@code charSequence}, should be greater - /// than or equal to {@code 0} - ///@throws IllegalStateException if not initialized yet - ///@throws IllegalArgumentException in the following cases: - /// {@code start < 0}, {@code end < 0}, {@code end < start}, - /// {@code start > charSequence.length()}, - /// {@code end > charSequence.length()} - /// {@code maxEmojiCount < 0} - jni.JObject process2( - jni.JObject charSequence, - int start, - int end, - int maxEmojiCount, + /// Called by MetadataRepoLoader if an error occurs while loading the metadata. + ///@param throwable the exception that caused the failure, {@code nullable} + void onFailed( + jni.JObject throwable, ) { - return const jni.JObjectType().fromRef( - _process2(reference, charSequence.reference, start, end, maxEmojiCount) - .object); + return _onFailed(reference, throwable.reference).check(); } +} - static final _process3 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("EmojiCompat__process3") - .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - int, int, int, int)>(); +final class $EmojiCompat_MetadataRepoLoaderCallbackType + extends jni.JObjType { + const $EmojiCompat_MetadataRepoLoaderCallbackType(); - /// 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. - /// - /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. - /// - ///
    - ///
  • If no emojis are found, {@code charSequence} given as the input is returned without - /// any changes. i.e. charSequence is a String, and no emojis are found, the same String is - /// returned.
  • - ///
  • If the given input is not a Spannable (such as String), and at least one emoji is found - /// a new android.text.Spannable instance is returned.
  • - ///
  • If the given input is a Spannable, the same instance is returned.
  • - ///
- /// When used on devices running API 18 or below, returns the given {@code charSequence} without - /// processing it. - ///@param charSequence CharSequence to add the EmojiSpans, cannot be {@code null} - ///@param start start index in the charSequence to look for emojis, should be greater than or - /// equal to {@code 0}, also less than or equal to {@code charSequence.length()} - ///@param end end index in the charSequence to look for emojis, should be greater than or - /// equal to {@code start} parameter, also less than or equal to - /// {@code charSequence.length()} - ///@param maxEmojiCount maximum number of emojis in the {@code charSequence}, should be greater - /// than or equal to {@code 0} - ///@param replaceStrategy whether to replace all emoji with EmojiSpans, should be one of - /// \#REPLACE_STRATEGY_DEFAULT, - /// \#REPLACE_STRATEGY_NON_EXISTENT, - /// \#REPLACE_STRATEGY_ALL - ///@throws IllegalStateException if not initialized yet - ///@throws IllegalArgumentException in the following cases: - /// {@code start < 0}, {@code end < 0}, {@code end < start}, - /// {@code start > charSequence.length()}, - /// {@code end > charSequence.length()} - /// {@code maxEmojiCount < 0} - jni.JObject process3( - jni.JObject charSequence, - int start, - int end, - int maxEmojiCount, - int replaceStrategy, - ) { - return const jni.JObjectType().fromRef(_process3(reference, - charSequence.reference, start, end, maxEmojiCount, replaceStrategy) - .object); - } + @override + String get signature => + r"Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;"; - static final _getAssetSignature = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat__getAssetSignature") - .asFunction)>(); + @override + EmojiCompat_MetadataRepoLoaderCallback fromRef(jni.JObjectPtr ref) => + EmojiCompat_MetadataRepoLoaderCallback.fromRef(ref); - /// from: public java.lang.String getAssetSignature() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Returns signature for the currently loaded emoji assets. The signature is a SHA that is - /// constructed using emoji assets. Can be used to detect if currently loaded asset is different - /// 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 const jni.JStringType() - .fromRef(_getAssetSignature(reference).object); - } + @override + jni.JObjType get superType => const jni.JObjectType(); - static final _updateEditorInfo = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat__updateEditorInfo") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + @override + final superCount = 1; - /// from: public void updateEditorInfo(android.view.inputmethod.EditorInfo outAttrs) - /// - /// Updates the EditorInfo attributes in order to communicate information to Keyboards. When - /// used on devices running API 18 or below, does not update EditorInfo attributes. - /// - /// This is called from EditText integrations that use EmojiEditTextHelper. Custom - /// widgets that allow IME not subclassing EditText should call this method when creating an - /// input connection. - /// - /// When EmojiCompat is not in \#LOAD_STATE_SUCCEEDED, this method has no effect. - /// - /// Calling this method on API levels below API 19 will have no effect, as EmojiCompat may - /// never be configured. However, it is always safe to call, even on older API levels. - ///@param outAttrs EditorInfo instance passed to - /// android.widget.TextView\#onCreateInputConnection(EditorInfo) - ///@see \#EDITOR_INFO_METAVERSION_KEY - ///@see \#EDITOR_INFO_REPLACE_ALL_KEY - void updateEditorInfo( - jni.JObject outAttrs, - ) { - return _updateEditorInfo(reference, outAttrs.reference).check(); + @override + int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallbackType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderCallbackType) && + other is $EmojiCompat_MetadataRepoLoaderCallbackType; } } -final class $EmojiCompatType extends jni.JObjType { - const $EmojiCompatType(); +/// from: androidx.emoji2.text.EmojiCompat$ReplaceStrategy +class EmojiCompat_ReplaceStrategy extends jni.JObject { + @override + late final jni.JObjType $type = type; + + EmojiCompat_ReplaceStrategy.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// The type which includes information such as the signature of this class. + static const type = $EmojiCompat_ReplaceStrategyType(); +} + +final class $EmojiCompat_ReplaceStrategyType + extends jni.JObjType { + const $EmojiCompat_ReplaceStrategyType(); @override - String get signature => r"Landroidx/emoji2/text/EmojiCompat;"; + String get signature => r"Landroidx/emoji2/text/EmojiCompat$ReplaceStrategy;"; @override - EmojiCompat fromRef(jni.JObjectPtr ref) => EmojiCompat.fromRef(ref); + EmojiCompat_ReplaceStrategy fromRef(jni.JObjectPtr ref) => + EmojiCompat_ReplaceStrategy.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1054,814 +889,1049 @@ final class $EmojiCompatType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($EmojiCompatType).hashCode; + int get hashCode => ($EmojiCompat_ReplaceStrategyType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompatType) && other is $EmojiCompatType; + return other.runtimeType == ($EmojiCompat_ReplaceStrategyType) && + other is $EmojiCompat_ReplaceStrategyType; } } -/// from: androidx.emoji2.text.EmojiCompat$Config +/// from: androidx.emoji2.text.EmojiCompat$SpanFactory /// -/// Configuration class for EmojiCompat. Changes to the values will be ignored after -/// \#init(Config) is called. -///@see \#init(EmojiCompat.Config) -class EmojiCompat_Config extends jni.JObject { +/// Factory class that creates the EmojiSpans. +/// +/// By default it creates TypefaceEmojiSpan. +/// +/// Apps should use this only if they want to control the drawing of EmojiSpans for non-standard +/// emoji display (for example, resizing or repositioning emoji). +class EmojiCompat_SpanFactory extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - EmojiCompat_Config.fromRef( + EmojiCompat_SpanFactory.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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)>(); - - /// from: protected void (androidx.emoji2.text.EmojiCompat.MetadataRepoLoader metadataLoader) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Default constructor. - ///@param metadataLoader MetadataRepoLoader instance, cannot be {@code null} - factory EmojiCompat_Config( - EmojiCompat_MetadataRepoLoader metadataLoader, - ) { - return EmojiCompat_Config.fromRef(_new0(metadataLoader.reference).object); - } - - static final _registerInitCallback = jniLookup< + static const type = $EmojiCompat_SpanFactoryType(); + static final _createSpan = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_Config__registerInitCallback") + "EmojiCompat_SpanFactory__createSpan") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: public androidx.emoji2.text.EmojiCompat.Config registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) + /// 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. /// - /// Registers an initialization callback. - ///@param initCallback the initialization callback to register, cannot be {@code null} - ///@return EmojiCompat.Config instance - EmojiCompat_Config registerInitCallback( - EmojiCompat_InitCallback initCallback, + /// Create EmojiSpan instance. + ///@param rasterizer TypefaceEmojiRasterizer instance, which can draw the emoji onto a + /// Canvas. + ///@return EmojiSpan instance that can use TypefaceEmojiRasterizer to draw emoji. + jni.JObject createSpan( + jni.JObject rasterizer, ) { - return const $EmojiCompat_ConfigType().fromRef( - _registerInitCallback(reference, initCallback.reference).object); + return const jni.JObjectType() + .fromRef(_createSpan(reference, rasterizer.reference).object); } +} - static final _unregisterInitCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_Config__unregisterInitCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, 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. - /// - /// Unregisters a callback that was added before. - ///@param initCallback the initialization callback to be removed, cannot be {@code null} - ///@return EmojiCompat.Config instance - EmojiCompat_Config unregisterInitCallback( - EmojiCompat_InitCallback initCallback, - ) { - return const $EmojiCompat_ConfigType().fromRef( - _unregisterInitCallback(reference, initCallback.reference).object); - } +final class $EmojiCompat_SpanFactoryType + extends jni.JObjType { + const $EmojiCompat_SpanFactoryType(); - static final _setReplaceAll = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("EmojiCompat_Config__setReplaceAll") - .asFunction, int)>(); + @override + String get signature => r"Landroidx/emoji2/text/EmojiCompat$SpanFactory;"; - /// from: public androidx.emoji2.text.EmojiCompat.Config setReplaceAll(boolean replaceAll) - /// The returned object must be released after use, by calling the [release] method. - /// - /// Determines whether EmojiCompat should replace all the emojis it finds with the - /// EmojiSpans. By default EmojiCompat tries its best to understand if the system already - /// can render an emoji and do not replace those emojis. - ///@param replaceAll replace all emojis found with EmojiSpans - ///@return EmojiCompat.Config instance - EmojiCompat_Config setReplaceAll( - bool replaceAll, - ) { - return const $EmojiCompat_ConfigType() - .fromRef(_setReplaceAll(reference, replaceAll ? 1 : 0).object); + @override + EmojiCompat_SpanFactory fromRef(jni.JObjectPtr ref) => + EmojiCompat_SpanFactory.fromRef(ref); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($EmojiCompat_SpanFactoryType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_SpanFactoryType) && + other is $EmojiCompat_SpanFactoryType; } +} - static final _setUseEmojiAsDefaultStyle = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Uint8)>>("EmojiCompat_Config__setUseEmojiAsDefaultStyle") - .asFunction, int)>(); +/// from: androidx.emoji2.text.EmojiCompat +/// +/// Main class to keep Android devices up to date with the newest emojis by adding EmojiSpans +/// to a given CharSequence. +///

+/// By default, EmojiCompat is initialized by EmojiCompatInitializer, which performs +/// deferred font loading to avoid potential app startup delays. The default behavior is to load +/// the font shortly after the first Activity resumes. EmojiCompatInitializer will configure +/// EmojiCompat to use the system emoji font provider via DefaultEmojiCompatConfig and +/// always creates a new background thread for font loading. +///

+/// EmojiCompat will only allow one instance to be initialized and any calls to +/// \#init(Config) after the first one will have no effect. As a result, configuration options +/// may not be provided when using EmojiCompatInitializer. To provide a custom configuration, +/// disable EmojiCompatInitializer in the manifest with: +/// +///

+///     <provider
+///         android:name="androidx.startup.InitializationProvider"
+///         android:authorities="${applicationId}.androidx-startup"
+///         android:exported="false"
+///         tools:node="merge">
+///         <meta-data android:name="androidx.emoji2.text.EmojiCompatInitializer"
+///                   tools:node="remove" />
+///     </provider>
+/// 
+/// +/// When not using EmojiCompatInitializer, EmojiCompat must to be initialized manually using +/// \#init(EmojiCompat.Config). It is recommended to make the initialization as early as +/// possible in your app, such as from Application\#onCreate(). +///

+/// \#init(Config) is fast and may be called from the main thread on the path to +/// displaying the first activity. However, loading the emoji font takes significant resources on a +/// background thread, so it is suggested to use \#LOAD_STRATEGY_MANUAL in all manual +/// configurations to defer font loading until after the first screen displays. Font loading may +/// be started by calling \#load()}. See the implementation EmojiCompatInitializer +/// for ideas when building a manual configuration. +///

+/// After initialization the \#get() function can be used to get the configured instance and +/// the \#process(CharSequence) function can be used to update a CharSequence with emoji +/// EmojiSpans. +///

+///

CharSequence processedSequence = EmojiCompat.get().process("some string")
+///

+/// During loading information about emojis is not available. Before the +/// EmojiCompat instance has finished loading, calls to functions such as EmojiCompat\#process(CharSequence) will throw an exception. It is safe to call process when +/// \#getLoadState() returns \#LOAD_STATE_SUCCEEDED. To register a callback when +/// loading completes use InitCallback. +///

+class EmojiCompat extends jni.JObject { + @override + late final jni.JObjType $type = type; - /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle) + EmojiCompat.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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(); + + /// from: static public final java.lang.String EDITOR_INFO_METAVERSION_KEY /// The returned object must be released after use, by calling the [release] method. /// - /// Determines whether EmojiCompat should use the emoji presentation style for emojis - /// that have text style as default. By default, the text style would be used, unless these - /// are followed by the U+FE0F variation selector. - /// Details about emoji presentation and text presentation styles can be found here: - /// http://unicode.org/reports/tr51/\#Presentation_Style - /// If useEmojiAsDefaultStyle is true, the emoji presentation style will be used for all - /// emojis, including potentially unexpected ones (such as digits or other keycap emojis). If - /// this is not the expected behaviour, method - /// \#setUseEmojiAsDefaultStyle(boolean, List) can be used to specify the - /// exception emojis that should be still presented as text style. - ///@param useEmojiAsDefaultStyle whether to use the emoji style presentation for all emojis - /// that would be presented as text style by default - EmojiCompat_Config setUseEmojiAsDefaultStyle( - bool useEmojiAsDefaultStyle, - ) { - return const $EmojiCompat_ConfigType().fromRef( - _setUseEmojiAsDefaultStyle(reference, useEmojiAsDefaultStyle ? 1 : 0) - .object); - } + /// Key in EditorInfo\#extras that represents the emoji metadata version used by the + /// widget. The existence of the value means that the widget is using EmojiCompat. + ///

+ /// If exists, the value for the key is an {@code int} and can be used to query EmojiCompat to + /// see whether the widget has the ability to display a certain emoji using + /// \#hasEmojiGlyph(CharSequence, int). + static jni.JString get EDITOR_INFO_METAVERSION_KEY => const jni.JStringType() + .fromRef(_get_EDITOR_INFO_METAVERSION_KEY().object); - static final _setUseEmojiAsDefaultStyle1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Uint8, - ffi.Pointer)>>( - "EmojiCompat_Config__setUseEmojiAsDefaultStyle1") - .asFunction< - jni.JniResult Function( - ffi.Pointer, int, ffi.Pointer)>(); + static final _get_EDITOR_INFO_REPLACE_ALL_KEY = + jniLookup>( + "get_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY") + .asFunction(); - /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle, java.util.List emojiAsDefaultStyleExceptions) + /// 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. /// - /// @see \#setUseEmojiAsDefaultStyle(boolean) - ///@param emojiAsDefaultStyleExceptions Contains the exception emojis which will be still - /// presented as text style even if the - /// useEmojiAsDefaultStyle flag is set to {@code true}. - /// This list will be ignored if useEmojiAsDefaultStyle - /// is {@code false}. Note that emojis with default - /// emoji style presentation will remain emoji style - /// regardless the value of useEmojiAsDefaultStyle or - /// whether they are included in the exceptions list or - /// not. When no exception is wanted, the method - /// \#setUseEmojiAsDefaultStyle(boolean) should - /// be used instead. - EmojiCompat_Config setUseEmojiAsDefaultStyle1( - bool useEmojiAsDefaultStyle, - jni.JList emojiAsDefaultStyleExceptions, - ) { - return const $EmojiCompat_ConfigType().fromRef(_setUseEmojiAsDefaultStyle1( - reference, - useEmojiAsDefaultStyle ? 1 : 0, - emojiAsDefaultStyleExceptions.reference) - .object); - } + /// 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 => const jni.JStringType() + .fromRef(_get_EDITOR_INFO_REPLACE_ALL_KEY().object); - static final _setEmojiSpanIndicatorEnabled = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, ffi.Uint8)>>( - "EmojiCompat_Config__setEmojiSpanIndicatorEnabled") - .asFunction, int)>(); + /// from: static public final int LOAD_STATE_DEFAULT + /// + /// EmojiCompat instance is constructed, however the initialization did not start yet. + ///@see \#getLoadState() + static const LOAD_STATE_DEFAULT = 3; - /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorEnabled(boolean emojiSpanIndicatorEnabled) - /// The returned object must be released after use, by calling the [release] method. + /// from: static public final int LOAD_STATE_LOADING /// - /// Determines whether a background will be drawn for the emojis that are found and - /// replaced by EmojiCompat. Should be used only for debugging purposes. The indicator color - /// can be set using \#setEmojiSpanIndicatorColor(int). - ///@param emojiSpanIndicatorEnabled when {@code true} a background is drawn for each emoji - /// that is replaced - EmojiCompat_Config setEmojiSpanIndicatorEnabled( - bool emojiSpanIndicatorEnabled, - ) { - return const $EmojiCompat_ConfigType().fromRef( - _setEmojiSpanIndicatorEnabled( - reference, emojiSpanIndicatorEnabled ? 1 : 0) - .object); - } + /// EmojiCompat is initializing. + ///@see \#getLoadState() + static const LOAD_STATE_LOADING = 0; - static final _setEmojiSpanIndicatorColor = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("EmojiCompat_Config__setEmojiSpanIndicatorColor") - .asFunction, int)>(); + /// from: static public final int LOAD_STATE_SUCCEEDED + /// + /// EmojiCompat successfully initialized. + ///@see \#getLoadState() + static const LOAD_STATE_SUCCEEDED = 1; - /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorColor(int color) - /// The returned object must be released after use, by calling the [release] method. + /// from: static public final int LOAD_STATE_FAILED /// - /// Sets the color used as emoji span indicator. The default value is - /// Color\#GREEN Color.GREEN. - ///@see \#setEmojiSpanIndicatorEnabled(boolean) - EmojiCompat_Config setEmojiSpanIndicatorColor( - int color, - ) { - return const $EmojiCompat_ConfigType() - .fromRef(_setEmojiSpanIndicatorColor(reference, color).object); - } + /// An unrecoverable error occurred during initialization of EmojiCompat. Calls to functions + /// such as \#process(CharSequence) will fail. + ///@see \#getLoadState() + static const LOAD_STATE_FAILED = 2; - static final _setMetadataLoadStrategy = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Int32)>>("EmojiCompat_Config__setMetadataLoadStrategy") - .asFunction, int)>(); + /// from: static public final int REPLACE_STRATEGY_DEFAULT + /// + /// Replace strategy that uses the value given in EmojiCompat.Config. + ///@see \#process(CharSequence, int, int, int, int) + static const REPLACE_STRATEGY_DEFAULT = 0; - /// from: public androidx.emoji2.text.EmojiCompat.Config setMetadataLoadStrategy(int strategy) - /// The returned object must be released after use, by calling the [release] method. + /// from: static public final int REPLACE_STRATEGY_ALL + /// + /// Replace strategy to add EmojiSpans for all emoji that were found. + ///@see \#process(CharSequence, int, int, int, int) + static const REPLACE_STRATEGY_ALL = 1; + + /// from: static public final int REPLACE_STRATEGY_NON_EXISTENT + /// + /// Replace strategy to add EmojiSpans only for emoji that do not exist in the system. + static const REPLACE_STRATEGY_NON_EXISTENT = 2; + + /// from: static public final int LOAD_STRATEGY_DEFAULT + /// + /// EmojiCompat will start loading metadata when \#init(Config) is called. + ///@see Config\#setMetadataLoadStrategy(int) + static const LOAD_STRATEGY_DEFAULT = 0; + + /// from: static public final int LOAD_STRATEGY_MANUAL + /// + /// EmojiCompat will wait for \#load() to be called by developer in order to + /// start loading metadata. + ///@see Config\#setMetadataLoadStrategy(int) + static const LOAD_STRATEGY_MANUAL = 1; + + /// from: static public final int EMOJI_UNSUPPORTED + /// + /// Result of \#getEmojiMatch(CharSequence, int) that means no part of this codepoint + /// sequence will ever generate an EmojiSpan at the requested metadata level. + /// + /// This return value implies: + /// - EmojiCompat will always defer to system emoji font + /// - System emoji font may or may not support this emoji + /// - This application MAY render this emoji + /// + /// This can be used by keyboards to learn that EmojiCompat does not support this codepoint + /// sequence at this metadata version. The system emoji font is not checked by this method, + /// and this result will be returned even if the system emoji font supports the emoji. This may + /// happen if the application is using an older version of the emoji compat font than the + /// system emoji font. + /// + /// Keyboards may optionally determine that the system emoji font will support the emoji, for + /// example by building a internal lookup table or calling + /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) to query the system + /// emoji font. Keyboards may use a lookup table to optimize this check, however they should be + /// aware that OEMs may add or remove emoji from the system emoji font. + /// + /// Keyboards may finally decide: + /// - If the system emoji font DOES NOT support the emoji, then the emoji IS NOT supported by + /// this application. + /// - If the system emoji font DOES support the emoji, then the emoji IS supported by this + /// application. + /// - If system emoji font is support is UNKNOWN, then assume the emoji IS NOT supported by + /// this application. + static const EMOJI_UNSUPPORTED = 0; + + /// from: static public final int EMOJI_SUPPORTED + /// + /// Result of \#getEmojiMatch(CharSequence, int) that means this codepoint can be drawn + /// by an EmojiSpan at this metadata level. + /// + /// No further checks are required by keyboards for this result. The emoji is always supported + /// by this application. + /// + /// This return value implies: + /// - EmojiCompat can draw this emoji + /// - System emoji font may or may not support this emoji + /// - This application WILL render this emoji + /// + /// This result implies that EmojiCompat can successfully display this emoji. The system emoji + /// font is not checked by this method, and this result may be returned even if the platform + /// also supports the emoji sequence. + /// + /// If the application passes EmojiCompat\#REPLACE_STRATEGY_ALL of true, then an + /// EmojiSpan will always be generated for this emoji. + /// + /// If the application passes EmojiCompat\#REPLACE_STRATEGY_ALL of false, then an + /// EmojiSpan will only be generated if + /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) + /// returns false for this emoji. + static const EMOJI_SUPPORTED = 1; + + /// from: static public final int EMOJI_FALLBACK + /// + /// Result of \#getEmojiMatch(CharSequence, int) that means the full codepoint sequence + /// is not known to emojicompat, but at least one subsequence is an emoji that is known at + /// this metadata level. + /// + /// Keyboards may decide that this emoji is not supported by the application when this result is + /// returned, with no further processing. + /// + /// This return value implies: + /// - EmojiCompat will decompose this ZWJ sequence into multiple glyphs when replaceAll=true + /// - EmojiCompat MAY defer to platform when replaceAll=false + /// - System emoji font may or may not support this emoji + /// - This application MAY render this emoji + /// + /// This return value is only ever returned for ZWJ sequences. To understand this result + /// consider when it may be returned for the multi-skin-tone handshake introduced in emoji 14. /// - /// Determines the strategy to start loading the metadata. By default EmojiCompat - /// will start loading the metadata during EmojiCompat\#init(Config). When set to - /// EmojiCompat\#LOAD_STRATEGY_MANUAL, you should call EmojiCompat\#load() to - /// initiate metadata loading. - ///

- /// Default implementations of EmojiCompat.MetadataRepoLoader start a thread - /// during their EmojiCompat.MetadataRepoLoader\#load functions. Just instantiating - /// and starting a thread might take time especially in older devices. Since - /// EmojiCompat\#init(Config) has to be called before any EmojiCompat widgets are - /// inflated, this results in time spent either on your Application.onCreate or Activity - /// .onCreate. If you'd like to gain more control on when to start loading the metadata - /// and be able to call EmojiCompat\#init(Config) with absolute minimum time cost you - /// can use EmojiCompat\#LOAD_STRATEGY_MANUAL. - ///

- /// When set to EmojiCompat\#LOAD_STRATEGY_MANUAL, EmojiCompat will wait - /// for \#load() to be called by the developer in order to start loading metadata, - /// therefore you should call EmojiCompat\#load() to initiate metadata loading. - /// \#load() can be called from any thread. ///

-  /// EmojiCompat.Config config = new FontRequestEmojiCompatConfig(context, fontRequest)
-  ///         .setMetadataLoadStrategy(EmojiCompat.LOAD_STRATEGY_MANUAL);
+  ///     U+1FAF1 // unknown @ requested metadata level
+  ///     U+1F3FB // metadata level 1
+  ///     U+200D  // not displayed (ZWJ)
+  ///     U+1FAF2 // unknown @ requested metadata level
+  ///     U+1F3FD // metadata level 1
+  /// 
+ /// + /// In this codepoint sequence, U+1F3FB and U+1F3FD are known from metadata level 1. When an + /// application is using a metadata level that doesn't understand this ZWJ and provides + /// EmojiCompat\#REPLACE_STRATEGY_ALL true, the color emoji are matched and replaced + /// with EmojiSpan. The system emoji font, even if it supports this ZWJ sequence, is + /// never queried and the added EmojiSpans force fallback rendering for the ZWJ sequence. + /// + /// The glyph will only display correctly for this application if ALL of the following + /// requirements are met: + /// - EmojiCompat\#REPLACE_STRATEGY_ALL is false + /// - androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) returns true for each + /// emoji subsequence known at this metadata level + /// - androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) returns true for the + /// full sequence + /// + /// Given this return value for the multi-skin-tone handshake above, if + /// EmojiCompat\#REPLACE_STRATEGY_ALL is false then the emoji will display if the + /// entire emoji sequence is matched by + /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) because U+1F3FB and + /// U+1F3FD are both in the system emoji font. + /// + /// Keyboards that wish to determine if the glyph will display correctly by the application in + /// response to this return value should consider building an internal lookup for new ZWJ + /// sequences instead of repeatedly calling + /// 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)>(); + + /// 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. + /// + /// Initialize the singleton instance with the default system-provided configuration. + /// + /// This is the recommended configuration for most applications. For more details see + /// DefaultEmojiCompatConfig. + /// /// - /// // EmojiCompat will not start loading metadata and MetadataRepoLoader\#load(...) - /// // will not be called - /// EmojiCompat.init(config); + /// This call will use DefaultEmojiCompatConfig to lookup the default emoji font + /// provider installed on the system and use that, if present. If there is no default font + /// provider onthe system, this call will have no effect. /// - /// // At any time (i.e. idle time or executorService is ready) - /// // call EmojiCompat\#load() to start loading metadata. - /// executorService.execute(() -> EmojiCompat.get().load()); - /// - ///@param strategy one of EmojiCompat\#LOAD_STRATEGY_DEFAULT, - /// EmojiCompat\#LOAD_STRATEGY_MANUAL - EmojiCompat_Config setMetadataLoadStrategy( - int strategy, + /// + /// Note: EmojiCompat may only be initialized once, and will return the same instance + /// afterwords. + /// + ///@return Default EmojiCompat for this device, or null if there is no provider on the system. + static EmojiCompat init( + jni.JObject context, ) { - return const $EmojiCompat_ConfigType() - .fromRef(_setMetadataLoadStrategy(reference, strategy).object); + return const $EmojiCompatType().fromRef(_init(context.reference).object); } - static final _setSpanFactory = jniLookup< + static final _init1 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat_Config__setSpanFactory") - .asFunction< - jni.JniResult Function( - ffi.Pointer, 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. - /// - /// Set the span factory used to actually draw emoji replacements. - ///@param factory custum span factory that can draw the emoji replacements - ///@return this - EmojiCompat_Config setSpanFactory( - EmojiCompat_SpanFactory factory0, - ) { - return const $EmojiCompat_ConfigType() - .fromRef(_setSpanFactory(reference, factory0.reference).object); - } - - static final _setGlyphChecker = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_Config__setGlyphChecker") + ffi.Pointer)>>("EmojiCompat__init1") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: public androidx.emoji2.text.EmojiCompat.Config setGlyphChecker(androidx.emoji2.text.EmojiCompat.GlyphChecker glyphChecker) + /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigFactory defaultFactory) /// The returned object must be released after use, by calling the [release] method. /// - /// The interface that is used by EmojiCompat in order to check if a given emoji can be - /// rendered by the system. - ///@param glyphChecker GlyphChecker instance to be used. - EmojiCompat_Config setGlyphChecker( - EmojiCompat_GlyphChecker glyphChecker, + /// @hide + static EmojiCompat init1( + jni.JObject context, + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory defaultFactory, ) { - return const $EmojiCompat_ConfigType() - .fromRef(_setGlyphChecker(reference, glyphChecker.reference).object); + return const $EmojiCompatType() + .fromRef(_init1(context.reference, defaultFactory.reference).object); } - static final _getMetadataRepoLoader = jniLookup< + static final _init2 = jniLookup< ffi .NativeFunction)>>( - "EmojiCompat_Config__getMetadataRepoLoader") + "EmojiCompat__init2") .asFunction)>(); - /// from: protected final androidx.emoji2.text.EmojiCompat.MetadataRepoLoader getMetadataRepoLoader() - /// The returned object must be released after use, by calling the [release] method. - /// - /// Returns the MetadataRepoLoader. - EmojiCompat_MetadataRepoLoader getMetadataRepoLoader() { - return const $EmojiCompat_MetadataRepoLoaderType() - .fromRef(_getMetadataRepoLoader(reference).object); - } -} - -final class $EmojiCompat_ConfigType extends jni.JObjType { - const $EmojiCompat_ConfigType(); - - @override - String get signature => r"Landroidx/emoji2/text/EmojiCompat$Config;"; - - @override - EmojiCompat_Config fromRef(jni.JObjectPtr ref) => - EmojiCompat_Config.fromRef(ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($EmojiCompat_ConfigType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_ConfigType) && - other is $EmojiCompat_ConfigType; - } -} - -/// from: androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback -/// -/// Callback to inform EmojiCompat about the state of the metadata load. Passed to -/// MetadataRepoLoader during MetadataRepoLoader\#load(MetadataRepoLoaderCallback) call. -class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { - @override - late final jni.JObjType $type = type; - - EmojiCompat_MetadataRepoLoaderCallback.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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(); - - /// from: public void () + /// 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. - factory EmojiCompat_MetadataRepoLoaderCallback() { - return EmojiCompat_MetadataRepoLoaderCallback.fromRef(_new0().object); - } - - static final _onLoaded = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_MetadataRepoLoaderCallback__onLoaded") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract void onLoaded(androidx.emoji2.text.MetadataRepo metadataRepo) - /// - /// Called by MetadataRepoLoader when metadata is loaded successfully. - ///@param metadataRepo MetadataRepo instance, cannot be {@code null} - void onLoaded( - jni.JObject metadataRepo, - ) { - return _onLoaded(reference, metadataRepo.reference).check(); - } - - static final _onFailed = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_MetadataRepoLoaderCallback__onFailed") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract void onFailed(java.lang.Throwable throwable) /// - /// Called by MetadataRepoLoader if an error occurs while loading the metadata. - ///@param throwable the exception that caused the failure, {@code nullable} - void onFailed( - jni.JObject throwable, + /// Initialize the singleton instance with a configuration. When used on devices running API 18 + /// or below, the singleton instance is immediately moved into \#LOAD_STATE_SUCCEEDED + /// state without loading any metadata. When called for the first time, the library will create + /// the singleton instance and any call after that will not create a new instance and return + /// immediately. + ///@see EmojiCompat.Config + static EmojiCompat init2( + EmojiCompat_Config config, ) { - return _onFailed(reference, throwable.reference).check(); - } -} - -final class $EmojiCompat_MetadataRepoLoaderCallbackType - extends jni.JObjType { - const $EmojiCompat_MetadataRepoLoaderCallbackType(); - - @override - String get signature => - r"Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;"; - - @override - EmojiCompat_MetadataRepoLoaderCallback fromRef(jni.JObjectPtr ref) => - EmojiCompat_MetadataRepoLoaderCallback.fromRef(ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallbackType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderCallbackType) && - other is $EmojiCompat_MetadataRepoLoaderCallbackType; + return const $EmojiCompatType().fromRef(_init2(config.reference).object); } -} - -/// from: androidx.emoji2.text.EmojiCompat$GlyphChecker -/// -/// Interface to check if a given emoji exists on the system. -class EmojiCompat_GlyphChecker extends jni.JObject { - @override - late final jni.JObjType $type = type; - EmojiCompat_GlyphChecker.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_GlyphCheckerType(); - static final _hasGlyph = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("EmojiCompat_GlyphChecker__hasGlyph") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); + static final _isConfigured = + jniLookup>( + "EmojiCompat__isConfigured") + .asFunction(); - /// from: public abstract boolean hasGlyph(java.lang.CharSequence charSequence, int start, int end, int sdkAdded) - /// - /// Return {@code true} if the emoji that is in {@code charSequence} between - /// {@code start}(inclusive) and {@code end}(exclusive) can be rendered on the system - /// using the default Typeface. - /// - /// This function is called after an emoji is identified in the given {@code charSequence} - /// and EmojiCompat wants to know if that emoji can be rendered on the system. The result - /// of this call will be cached and the same emoji sequence won't be asked for the same - /// EmojiCompat instance. - /// - /// When the function returns {@code true}, it will mean that the system can render the - /// emoji. In that case if Config\#setReplaceAll is set to {@code false}, then no - /// EmojiSpan will be added in the final emoji processing result. - /// - /// When the function returns {@code false}, it will mean that the system cannot render - /// the given emoji, therefore an EmojiSpan will be added to the final emoji - /// processing result. + /// from: static public boolean isConfigured() /// - /// The default implementation of this class uses - /// androidx.core.graphics.PaintCompat\#hasGlyph(Paint, String) function to check - /// if the emoji can be rendered on the system. This is required even if EmojiCompat - /// knows about the SDK Version that the emoji was added on AOSP. Just the {@code sdkAdded} - /// information is not enough to reliably decide if emoji can be rendered since this - /// information may not be consistent across all the OEMs and all the Android versions. + /// Return true if EmojiCompat has been configured by a successful call to + /// EmojiCompat\#init. /// - /// With this interface you can apply your own heuristics to check if the emoji can be - /// rendered on the system. For example, if you'd like to rely on the {@code sdkAdded} - /// information, and some predefined OEMs, it is possible to write the following code - /// snippet. + /// You can use this to check if EmojiCompat\#get() will return a valid EmojiCompat + /// instance. /// - /// {@sample frameworks/support/samples/SupportEmojiDemos/src/main/java/com/example/android/support/text/emoji/sample/GlyphCheckerSample.java glyphchecker} - ///@param charSequence the CharSequence that is being processed - ///@param start the inclusive starting offset for the emoji in the {@code charSequence} - ///@param end the exclusive end offset for the emoji in the {@code charSequence} - ///@param sdkAdded the API version that the emoji was added in AOSP - ///@return true if the given sequence can be rendered as a single glyph, otherwise false. - bool hasGlyph( - jni.JObject charSequence, - int start, - int end, - int sdkAdded, + /// This function does not check the \#getLoadState() and will return true even if the + /// font is still loading, or has failed to load. + ///@return true if EmojiCompat has been successfully initialized. + static bool isConfigured() { + return _isConfigured().boolean; + } + + static final _reset = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__reset") + .asFunction)>(); + + /// 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. + /// + /// Used by the tests to reset EmojiCompat with a new configuration. Every time it is called a + /// new instance is created with the new configuration. + ///@hide + static EmojiCompat reset( + EmojiCompat_Config config, ) { - return _hasGlyph(reference, charSequence.reference, start, end, sdkAdded) - .boolean; + return const $EmojiCompatType().fromRef(_reset(config.reference).object); } -} -final class $EmojiCompat_GlyphCheckerType - extends jni.JObjType { - const $EmojiCompat_GlyphCheckerType(); + static final _reset1 = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__reset1") + .asFunction)>(); - @override - String get signature => r"Landroidx/emoji2/text/EmojiCompat$GlyphChecker;"; + /// 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. + /// + /// Used by the tests to reset EmojiCompat with a new singleton instance. + ///@hide + static EmojiCompat reset1( + EmojiCompat emojiCompat, + ) { + return const $EmojiCompatType() + .fromRef(_reset1(emojiCompat.reference).object); + } - @override - EmojiCompat_GlyphChecker fromRef(jni.JObjectPtr ref) => - EmojiCompat_GlyphChecker.fromRef(ref); + static final _skipDefaultConfigurationLookup = + jniLookup>( + "EmojiCompat__skipDefaultConfigurationLookup") + .asFunction(); - @override - jni.JObjType get superType => const jni.JObjectType(); + /// from: static public void skipDefaultConfigurationLookup(boolean shouldSkip) + /// + /// Reset default configuration lookup flag, for tests. + ///@hide + static void skipDefaultConfigurationLookup( + bool shouldSkip, + ) { + return _skipDefaultConfigurationLookup(shouldSkip ? 1 : 0).check(); + } - @override - final superCount = 1; + static final _get0 = jniLookup>( + "EmojiCompat__get0") + .asFunction(); - @override - int get hashCode => ($EmojiCompat_GlyphCheckerType).hashCode; + /// from: static public androidx.emoji2.text.EmojiCompat get() + /// The returned object must be released after use, by calling the [release] method. + /// + /// Return singleton EmojiCompat instance. Should be called after + /// \#init(EmojiCompat.Config) is called to initialize the singleton instance. + ///@return EmojiCompat instance + ///@throws IllegalStateException if called before \#init(EmojiCompat.Config) + static EmojiCompat get0() { + return const $EmojiCompatType().fromRef(_get0().object); + } - @override - bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_GlyphCheckerType) && - other is $EmojiCompat_GlyphCheckerType; + static final _load = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__load") + .asFunction)>(); + + /// from: public void load() + /// + /// When Config\#setMetadataLoadStrategy(int) is set to \#LOAD_STRATEGY_MANUAL, + /// this function starts loading the metadata. Calling the function when + /// Config\#setMetadataLoadStrategy(int) is {@code not} set to + /// \#LOAD_STRATEGY_MANUAL will throw an exception. The load will {@code not} start if: + ///
    + ///
  • the metadata is already loaded successfully and \#getLoadState() is + /// \#LOAD_STATE_SUCCEEDED. + ///
  • + ///
  • a previous load attempt is not finished yet and \#getLoadState() is + /// \#LOAD_STATE_LOADING.
  • + ///
+ ///@throws IllegalStateException when Config\#setMetadataLoadStrategy(int) is not set + /// to \#LOAD_STRATEGY_MANUAL + void load() { + return _load(reference).check(); } -} -/// from: androidx.emoji2.text.EmojiCompat$MetadataRepoLoader -/// -/// Interface to load emoji metadata. -class EmojiCompat_MetadataRepoLoader extends jni.JObject { - @override - late final jni.JObjType $type = type; + static final _registerInitCallback = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Pointer)>>("EmojiCompat__registerInitCallback") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>(); - EmojiCompat_MetadataRepoLoader.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); + /// from: public void registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) + /// + /// Registers an initialization callback. If the initialization is already completed by the time + /// the listener is added, the callback functions are called immediately. Callbacks are called on + /// the main looper. + ///

+ /// When used on devices running API 18 or below, InitCallback\#onInitialized() is called + /// without loading any metadata. In such cases InitCallback\#onFailed(Throwable) is never + /// called. + ///@param initCallback the initialization callback to register, cannot be {@code null} + ///@see \#unregisterInitCallback(InitCallback) + void registerInitCallback( + EmojiCompat_InitCallback initCallback, + ) { + return _registerInitCallback(reference, initCallback.reference).check(); + } - /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_MetadataRepoLoaderType(); - static final _load = jniLookup< + static final _unregisterInitCallback = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_MetadataRepoLoader__load") + "EmojiCompat__unregisterInitCallback") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: public abstract void load(androidx.emoji2.text.EmojiCompat.MetadataRepoLoaderCallback loaderCallback) + /// from: public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) /// - /// Start loading the metadata. When the loading operation is finished MetadataRepoLoaderCallback\#onLoaded(MetadataRepo) or - /// MetadataRepoLoaderCallback\#onFailed(Throwable) should be called. When used on - /// devices running API 18 or below, this function is never called. - ///@param loaderCallback callback to signal the loading state - void load( - EmojiCompat_MetadataRepoLoaderCallback loaderCallback, + /// Unregisters a callback that was added before. + ///@param initCallback the callback to be removed, cannot be {@code null} + void unregisterInitCallback( + EmojiCompat_InitCallback initCallback, ) { - return _load(reference, loaderCallback.reference).check(); + return _unregisterInitCallback(reference, initCallback.reference).check(); } -} -final class $EmojiCompat_MetadataRepoLoaderType - extends jni.JObjType { - const $EmojiCompat_MetadataRepoLoaderType(); + static final _getLoadState = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__getLoadState") + .asFunction)>(); - @override - String get signature => - r"Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;"; + /// from: public int getLoadState() + /// + /// Returns loading state of the EmojiCompat instance. When used on devices running API 18 or + /// below always returns \#LOAD_STATE_SUCCEEDED. + ///@return one of \#LOAD_STATE_DEFAULT, \#LOAD_STATE_LOADING, + /// \#LOAD_STATE_SUCCEEDED, \#LOAD_STATE_FAILED + int getLoadState() { + return _getLoadState(reference).integer; + } - @override - EmojiCompat_MetadataRepoLoader fromRef(jni.JObjectPtr ref) => - EmojiCompat_MetadataRepoLoader.fromRef(ref); + static final _isEmojiSpanIndicatorEnabled = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__isEmojiSpanIndicatorEnabled") + .asFunction)>(); - @override - jni.JObjType get superType => const jni.JObjectType(); + /// from: public boolean isEmojiSpanIndicatorEnabled() + /// + /// @return whether a background should be drawn for the emoji for debugging + ///@hide + bool isEmojiSpanIndicatorEnabled() { + return _isEmojiSpanIndicatorEnabled(reference).boolean; + } - @override - final superCount = 1; + static final _getEmojiSpanIndicatorColor = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__getEmojiSpanIndicatorColor") + .asFunction)>(); - @override - int get hashCode => ($EmojiCompat_MetadataRepoLoaderType).hashCode; + /// from: public int getEmojiSpanIndicatorColor() + /// + /// @return color of background drawn if EmojiCompat\#isEmojiSpanIndicatorEnabled is true + ///@hide + int getEmojiSpanIndicatorColor() { + return _getEmojiSpanIndicatorColor(reference).integer; + } - @override - bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderType) && - other is $EmojiCompat_MetadataRepoLoaderType; + static final _getEmojiStart = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>("EmojiCompat__getEmojiStart") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer, int)>(); + + /// from: public int getEmojiStart(java.lang.CharSequence charSequence, int offset) + /// + /// Together with \#getEmojiEnd(CharSequence, int), if the character at {@code offset} is + /// part of an emoji, returns the index range of that emoji, start index inclusively/end index + /// exclusively so that {@code charSequence.subSequence(start, end)} will return that emoji. + /// E.g., getEmojiStart/End("AB\ud83d\ude00", 1) will return (-1,-1) since 'B' is not part an emoji; + /// getEmojiStart/End("AB\ud83d\ude00", 3) will return [2,4), note that "\ud83d\ude00" contains 2 Chars. + /// Returns -1 otherwise. + ///@param charSequence the whole sequence + ///@param offset index of the emoji to look up + ///@return the start index inclusively/end index exclusively + int getEmojiStart( + jni.JObject charSequence, + int offset, + ) { + return _getEmojiStart(reference, charSequence.reference, offset).integer; } -} -/// from: androidx.emoji2.text.EmojiCompat$InitCallback -/// -/// Listener class for the initialization of the EmojiCompat. -class EmojiCompat_InitCallback extends jni.JObject { - @override - late final jni.JObjType $type = type; + static final _getEmojiEnd = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>("EmojiCompat__getEmojiEnd") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer, int)>(); - EmojiCompat_InitCallback.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); + /// from: public int getEmojiEnd(java.lang.CharSequence charSequence, int offset) + /// + /// see \#getEmojiStart(CharSequence, int). + int getEmojiEnd( + jni.JObject charSequence, + int offset, + ) { + return _getEmojiEnd(reference, charSequence.reference, offset).integer; + } - /// 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 _handleOnKeyDown = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>("EmojiCompat__handleOnKeyDown") + .asFunction< + jni.JniResult Function( + ffi.Pointer, int, ffi.Pointer)>(); - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory EmojiCompat_InitCallback() { - return EmojiCompat_InitCallback.fromRef(_new0().object); + /// from: static public boolean handleOnKeyDown(android.text.Editable editable, int keyCode, android.view.KeyEvent event) + /// + /// Handles onKeyDown commands from a KeyListener and if {@code keyCode} is one of + /// KeyEvent\#KEYCODE_DEL or KeyEvent\#KEYCODE_FORWARD_DEL it tries to delete an + /// EmojiSpan from an Editable. Returns {@code true} if an EmojiSpan is + /// deleted with the characters it covers. + ///

+ /// If there is a selection where selection start is not equal to selection end, does not + /// delete. + ///

+ /// When used on devices running API 18 or below, always returns {@code false}. + ///@param editable Editable instance passed to KeyListener\#onKeyDown(android.view.View, + /// Editable, int, KeyEvent) + ///@param keyCode keyCode passed to KeyListener\#onKeyDown(android.view.View, Editable, + /// int, KeyEvent) + ///@param event KeyEvent passed to KeyListener\#onKeyDown(android.view.View, Editable, + /// int, KeyEvent) + ///@return {@code true} if an EmojiSpan is deleted + static bool handleOnKeyDown( + jni.JObject editable, + int keyCode, + jni.JObject event, + ) { + return _handleOnKeyDown(editable.reference, keyCode, event.reference) + .boolean; } - static final _onInitialized = jniLookup< - ffi - .NativeFunction)>>( - "EmojiCompat_InitCallback__onInitialized") - .asFunction)>(); + static final _handleDeleteSurroundingText = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Uint8)>>("EmojiCompat__handleDeleteSurroundingText") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer, int, int, int)>(); - /// from: public void onInitialized() + /// from: static public boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection inputConnection, android.text.Editable editable, int beforeLength, int afterLength, boolean inCodePoints) /// - /// 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() { - return _onInitialized(reference).check(); + /// Handles deleteSurroundingText commands from InputConnection and tries to delete an + /// EmojiSpan from an Editable. Returns {@code true} if an EmojiSpan is + /// deleted. + ///

+ /// If there is a selection where selection start is not equal to selection end, does not + /// delete. + ///

+ /// When used on devices running API 18 or below, always returns {@code false}. + ///@param inputConnection InputConnection instance + ///@param editable TextView.Editable instance + ///@param beforeLength the number of characters before the cursor to be deleted + ///@param afterLength the number of characters after the cursor to be deleted + ///@param inCodePoints {@code true} if length parameters are in codepoints + ///@return {@code true} if an EmojiSpan is deleted + static bool handleDeleteSurroundingText( + jni.JObject inputConnection, + jni.JObject editable, + int beforeLength, + int afterLength, + bool inCodePoints, + ) { + return _handleDeleteSurroundingText(inputConnection.reference, + editable.reference, beforeLength, afterLength, inCodePoints ? 1 : 0) + .boolean; } - static final _onFailed = jniLookup< + static final _hasEmojiGlyph = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("EmojiCompat_InitCallback__onFailed") + ffi.Pointer)>>("EmojiCompat__hasEmojiGlyph") .asFunction< jni.JniResult Function( ffi.Pointer, ffi.Pointer)>(); - /// from: public void onFailed(java.lang.Throwable throwable) + /// from: public boolean hasEmojiGlyph(java.lang.CharSequence sequence) /// - /// Called when an unrecoverable error occurs during EmojiCompat initialization. When used on - /// devices running API 18 or below, this function is never called. - void onFailed( - jni.JObject throwable, + /// Returns {@code true} if EmojiCompat is capable of rendering an emoji. When used on devices + /// running API 18 or below, always returns {@code false}. + ///@deprecated use getEmojiMatch which returns more accurate lookup information. + ///@param sequence CharSequence representing the emoji + ///@return {@code true} if EmojiCompat can render given emoji, cannot be {@code null} + ///@throws IllegalStateException if not initialized yet + bool hasEmojiGlyph( + jni.JObject sequence, ) { - return _onFailed(reference, throwable.reference).check(); + return _hasEmojiGlyph(reference, sequence.reference).boolean; } -} - -final class $EmojiCompat_InitCallbackType - extends jni.JObjType { - const $EmojiCompat_InitCallbackType(); - - @override - String get signature => r"Landroidx/emoji2/text/EmojiCompat$InitCallback;"; - - @override - EmojiCompat_InitCallback fromRef(jni.JObjectPtr ref) => - EmojiCompat_InitCallback.fromRef(ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - @override - final superCount = 1; - - @override - int get hashCode => ($EmojiCompat_InitCallbackType).hashCode; + static final _hasEmojiGlyph1 = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>("EmojiCompat__hasEmojiGlyph1") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer, int)>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_InitCallbackType) && - other is $EmojiCompat_InitCallbackType; + /// from: public boolean hasEmojiGlyph(java.lang.CharSequence sequence, int metadataVersion) + /// + /// Returns {@code true} if EmojiCompat is capable of rendering an emoji at the given metadata + /// version. When used on devices running API 18 or below, always returns {@code false}. + ///@deprecated use getEmojiMatch which returns more accurate lookup information. + ///@param sequence CharSequence representing the emoji + ///@param metadataVersion the metadata version to check against, should be greater than or + /// equal to {@code 0}, + ///@return {@code true} if EmojiCompat can render given emoji, cannot be {@code null} + ///@throws IllegalStateException if not initialized yet + bool hasEmojiGlyph1( + jni.JObject sequence, + int metadataVersion, + ) { + return _hasEmojiGlyph1(reference, sequence.reference, metadataVersion) + .boolean; } -} -/// from: androidx.emoji2.text.EmojiCompat$DefaultSpanFactory -/// -/// @hide -class EmojiCompat_DefaultSpanFactory extends jni.JObject { - @override - late final jni.JObjType $type = type; + static final _getEmojiMatch = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>("EmojiCompat__getEmojiMatch") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer, int)>(); - EmojiCompat_DefaultSpanFactory.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); + /// from: public int getEmojiMatch(java.lang.CharSequence sequence, int metadataVersion) + /// + /// Attempts to lookup the entire sequence at the specified metadata version and returns what + /// the runtime match behavior would be. + /// + /// To be used by keyboards to show or hide emoji in response to specific metadata support. + ///@see \#EMOJI_SUPPORTED + ///@see \#EMOJI_UNSUPPORTED + ///@see \#EMOJI_FALLBACK + ///@param sequence CharSequence representing an emoji + ///@param metadataVersion the metada version to check against, should be greater than or + /// equal to {@code 0}, + ///@return A match result, or decomposes if replaceAll would cause partial subsequence matches. + int getEmojiMatch( + jni.JObject sequence, + int metadataVersion, + ) { + return _getEmojiMatch(reference, sequence.reference, metadataVersion) + .integer; + } - /// 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 _process = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Pointer)>>("EmojiCompat__process") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>(); - /// from: public void () + /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence) /// The returned object must be released after use, by calling the [release] method. - factory EmojiCompat_DefaultSpanFactory() { - return EmojiCompat_DefaultSpanFactory.fromRef(_new0().object); + /// + /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. When + /// used on devices running API 18 or below, returns the given {@code charSequence} without + /// processing it. + ///@param charSequence CharSequence to add the EmojiSpans + ///@throws IllegalStateException if not initialized yet + ///@see \#process(CharSequence, int, int) + jni.JObject process( + jni.JObject charSequence, + ) { + return const jni.JObjectType() + .fromRef(_process(reference, charSequence.reference).object); } - static final _createSpan = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_DefaultSpanFactory__createSpan") + static final _process1 = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32)>>("EmojiCompat__process1") .asFunction< jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, int, int)>(); - /// from: public androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer rasterizer) + /// 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. /// - /// Returns a TypefaceEmojiSpan. - ///@param rasterizer TypefaceEmojiRasterizer instance, which can draw the emoji onto a - /// Canvas. - ///@return TypefaceEmojiSpan - jni.JObject createSpan( - jni.JObject rasterizer, + /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. + /// + ///

    + ///
  • If no emojis are found, {@code charSequence} given as the input is returned without + /// any changes. i.e. charSequence is a String, and no emojis are found, the same String is + /// returned.
  • + ///
  • If the given input is not a Spannable (such as String), and at least one emoji is found + /// a new android.text.Spannable instance is returned.
  • + ///
  • If the given input is a Spannable, the same instance is returned.
  • + ///
+ /// When used on devices running API 18 or below, returns the given {@code charSequence} without + /// processing it. + ///@param charSequence CharSequence to add the EmojiSpans, cannot be {@code null} + ///@param start start index in the charSequence to look for emojis, should be greater than or + /// equal to {@code 0}, also less than or equal to {@code charSequence.length()} + ///@param end end index in the charSequence to look for emojis, should be greater than or equal + /// to {@code start} parameter, also less than or equal to + /// {@code charSequence.length()} + ///@throws IllegalStateException if not initialized yet + ///@throws IllegalArgumentException in the following cases: + /// {@code start < 0}, {@code end < 0}, {@code end < start}, + /// {@code start > charSequence.length()}, + /// {@code end > charSequence.length()} + jni.JObject process1( + jni.JObject charSequence, + int start, + int end, ) { - return const jni.JObjectType() - .fromRef(_createSpan(reference, rasterizer.reference).object); + return const jni.JObjectType().fromRef( + _process1(reference, charSequence.reference, start, end).object); } -} - -final class $EmojiCompat_DefaultSpanFactoryType - extends jni.JObjType { - const $EmojiCompat_DefaultSpanFactoryType(); - - @override - String get signature => - r"Landroidx/emoji2/text/EmojiCompat$DefaultSpanFactory;"; - - @override - EmojiCompat_DefaultSpanFactory fromRef(jni.JObjectPtr ref) => - EmojiCompat_DefaultSpanFactory.fromRef(ref); - @override - jni.JObjType get superType => const jni.JObjectType(); + static final _process2 = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32)>>("EmojiCompat__process2") + .asFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer, int, int, int)>(); - @override - final superCount = 1; + /// 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. + /// + /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. + /// + ///
    + ///
  • If no emojis are found, {@code charSequence} given as the input is returned without + /// any changes. i.e. charSequence is a String, and no emojis are found, the same String is + /// returned.
  • + ///
  • If the given input is not a Spannable (such as String), and at least one emoji is found + /// a new android.text.Spannable instance is returned.
  • + ///
  • If the given input is a Spannable, the same instance is returned.
  • + ///
+ /// When used on devices running API 18 or below, returns the given {@code charSequence} without + /// processing it. + ///@param charSequence CharSequence to add the EmojiSpans, cannot be {@code null} + ///@param start start index in the charSequence to look for emojis, should be greater than or + /// equal to {@code 0}, also less than or equal to {@code charSequence.length()} + ///@param end end index in the charSequence to look for emojis, should be greater than or + /// equal to {@code start} parameter, also less than or equal to + /// {@code charSequence.length()} + ///@param maxEmojiCount maximum number of emojis in the {@code charSequence}, should be greater + /// than or equal to {@code 0} + ///@throws IllegalStateException if not initialized yet + ///@throws IllegalArgumentException in the following cases: + /// {@code start < 0}, {@code end < 0}, {@code end < start}, + /// {@code start > charSequence.length()}, + /// {@code end > charSequence.length()} + /// {@code maxEmojiCount < 0} + jni.JObject process2( + jni.JObject charSequence, + int start, + int end, + int maxEmojiCount, + ) { + return const jni.JObjectType().fromRef( + _process2(reference, charSequence.reference, start, end, maxEmojiCount) + .object); + } - @override - int get hashCode => ($EmojiCompat_DefaultSpanFactoryType).hashCode; + static final _process3 = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32, + ffi.Int32)>>("EmojiCompat__process3") + .asFunction< + jni.JniResult Function(ffi.Pointer, ffi.Pointer, + int, int, int, int)>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_DefaultSpanFactoryType) && - other is $EmojiCompat_DefaultSpanFactoryType; + /// 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. + /// + /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. + /// + ///
    + ///
  • If no emojis are found, {@code charSequence} given as the input is returned without + /// any changes. i.e. charSequence is a String, and no emojis are found, the same String is + /// returned.
  • + ///
  • If the given input is not a Spannable (such as String), and at least one emoji is found + /// a new android.text.Spannable instance is returned.
  • + ///
  • If the given input is a Spannable, the same instance is returned.
  • + ///
+ /// When used on devices running API 18 or below, returns the given {@code charSequence} without + /// processing it. + ///@param charSequence CharSequence to add the EmojiSpans, cannot be {@code null} + ///@param start start index in the charSequence to look for emojis, should be greater than or + /// equal to {@code 0}, also less than or equal to {@code charSequence.length()} + ///@param end end index in the charSequence to look for emojis, should be greater than or + /// equal to {@code start} parameter, also less than or equal to + /// {@code charSequence.length()} + ///@param maxEmojiCount maximum number of emojis in the {@code charSequence}, should be greater + /// than or equal to {@code 0} + ///@param replaceStrategy whether to replace all emoji with EmojiSpans, should be one of + /// \#REPLACE_STRATEGY_DEFAULT, + /// \#REPLACE_STRATEGY_NON_EXISTENT, + /// \#REPLACE_STRATEGY_ALL + ///@throws IllegalStateException if not initialized yet + ///@throws IllegalArgumentException in the following cases: + /// {@code start < 0}, {@code end < 0}, {@code end < start}, + /// {@code start > charSequence.length()}, + /// {@code end > charSequence.length()} + /// {@code maxEmojiCount < 0} + jni.JObject process3( + jni.JObject charSequence, + int start, + int end, + int maxEmojiCount, + int replaceStrategy, + ) { + return const jni.JObjectType().fromRef(_process3(reference, + charSequence.reference, start, end, maxEmojiCount, replaceStrategy) + .object); } -} -/// from: androidx.emoji2.text.EmojiCompat$SpanFactory -/// -/// Factory class that creates the EmojiSpans. -/// -/// By default it creates TypefaceEmojiSpan. -/// -/// Apps should use this only if they want to control the drawing of EmojiSpans for non-standard -/// emoji display (for example, resizing or repositioning emoji). -class EmojiCompat_SpanFactory extends jni.JObject { - @override - late final jni.JObjType $type = type; + static final _getAssetSignature = jniLookup< + ffi + .NativeFunction)>>( + "EmojiCompat__getAssetSignature") + .asFunction)>(); - EmojiCompat_SpanFactory.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); + /// from: public java.lang.String getAssetSignature() + /// The returned object must be released after use, by calling the [release] method. + /// + /// Returns signature for the currently loaded emoji assets. The signature is a SHA that is + /// constructed using emoji assets. Can be used to detect if currently loaded asset is different + /// 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 const jni.JStringType() + .fromRef(_getAssetSignature(reference).object); + } - /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_SpanFactoryType(); - static final _createSpan = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "EmojiCompat_SpanFactory__createSpan") + static final _updateEditorInfo = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Pointer)>>("EmojiCompat__updateEditorInfo") .asFunction< jni.JniResult Function( ffi.Pointer, 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. + /// from: public void updateEditorInfo(android.view.inputmethod.EditorInfo outAttrs) /// - /// Create EmojiSpan instance. - ///@param rasterizer TypefaceEmojiRasterizer instance, which can draw the emoji onto a - /// Canvas. - ///@return EmojiSpan instance that can use TypefaceEmojiRasterizer to draw emoji. - jni.JObject createSpan( - jni.JObject rasterizer, + /// Updates the EditorInfo attributes in order to communicate information to Keyboards. When + /// used on devices running API 18 or below, does not update EditorInfo attributes. + /// + /// This is called from EditText integrations that use EmojiEditTextHelper. Custom + /// widgets that allow IME not subclassing EditText should call this method when creating an + /// input connection. + /// + /// When EmojiCompat is not in \#LOAD_STATE_SUCCEEDED, this method has no effect. + /// + /// Calling this method on API levels below API 19 will have no effect, as EmojiCompat may + /// never be configured. However, it is always safe to call, even on older API levels. + ///@param outAttrs EditorInfo instance passed to + /// android.widget.TextView\#onCreateInputConnection(EditorInfo) + ///@see \#EDITOR_INFO_METAVERSION_KEY + ///@see \#EDITOR_INFO_REPLACE_ALL_KEY + void updateEditorInfo( + jni.JObject outAttrs, ) { - return const jni.JObjectType() - .fromRef(_createSpan(reference, rasterizer.reference).object); + return _updateEditorInfo(reference, outAttrs.reference).check(); } } -final class $EmojiCompat_SpanFactoryType - extends jni.JObjType { - const $EmojiCompat_SpanFactoryType(); +final class $EmojiCompatType extends jni.JObjType { + const $EmojiCompatType(); @override - String get signature => r"Landroidx/emoji2/text/EmojiCompat$SpanFactory;"; + String get signature => r"Landroidx/emoji2/text/EmojiCompat;"; @override - EmojiCompat_SpanFactory fromRef(jni.JObjectPtr ref) => - EmojiCompat_SpanFactory.fromRef(ref); + EmojiCompat fromRef(jni.JObjectPtr ref) => EmojiCompat.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1870,96 +1940,85 @@ final class $EmojiCompat_SpanFactoryType final superCount = 1; @override - int get hashCode => ($EmojiCompat_SpanFactoryType).hashCode; + int get hashCode => ($EmojiCompatType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_SpanFactoryType) && - other is $EmojiCompat_SpanFactoryType; + return other.runtimeType == ($EmojiCompatType) && other is $EmojiCompatType; } } -/// from: androidx.emoji2.text.DefaultEmojiCompatConfig -/// -/// The default config will use downloadable fonts to fetch the emoji compat font file. -/// -/// It will automatically fetch the emoji compat font from a {@code ContentProvider} that is -/// installed on the devices system image, if present. -/// -/// -/// You should use this if you want the default emoji font from a system installed -/// downloadable fonts provider. This is the recommended behavior for all applications unless -/// they install a custom emoji font. -/// -/// -/// You may need to specialize the configuration beyond this default config in some -/// situations: -/// -///
    -///
  • If you are trying to install a custom emoji font through downloadable fonts use -/// FontRequestEmojiCompatConfig instead of this method.
  • -///
  • If you're trying to bundle an emoji font with your APK use {@code -/// BundledEmojiCompatConfig} in the {@code emoji2-bundled} artifact.
  • -///
  • If you are building an APK that will be installed on devices that won't have a -/// downloadable fonts provider, use {@code BundledEmojiCompatConfig}.
  • -///
-/// -/// The downloadable font provider used by {@code DefaultEmojiCompatConfig} always satisfies -/// the following contract: +/// from: androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory /// -///
    -///
  1. It MUST provide an intent filter for {@code androidx.content.action.LOAD_EMOJI_FONT}. -///
  2. -///
  3. It MUST respond to the query {@code emojicompat-emoji-font} with a valid emoji compat -/// font file including metadata.
  4. -///
  5. It MUST provide fonts via the same contract as downloadable fonts.
  6. -///
  7. It MUST be installed in the system image.
  8. -///
-class DefaultEmojiCompatConfig extends jni.JObject { +/// Actual factory for generating default emoji configs, does service locator lookup internally. +///@see DefaultEmojiCompatConfig\#create +///@hide +class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory + extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni + .JObjType + $type = type; - DefaultEmojiCompatConfig.fromRef( + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $DefaultEmojiCompatConfigType(); - static final _create = jniLookup< + static const type = + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); + static final _new0 = jniLookup< ffi .NativeFunction)>>( - "DefaultEmojiCompatConfig__create") + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0") .asFunction)>(); - /// from: static public androidx.emoji2.text.FontRequestEmojiCompatConfig create(android.content.Context context) + /// from: public void (androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigHelper helper) /// The returned object must be released after use, by calling the [release] method. /// - /// Get the default emoji compat config for this device. - /// - /// You may further configure the returned config before passing it to EmojiCompat\#init. + /// @hide + factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory( + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper helper, + ) { + return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef( + _new0(helper.reference).object); + } + + static final _create = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create") + .asFunction< + jni.JniResult Function( + ffi.Pointer, 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. /// - /// Each call to this method will return a new EmojiCompat.Config, so changes to the returned - /// object will not modify future return values. - ///@param context context for lookup - ///@return A valid config for downloading the emoji compat font, or null if no font provider - /// could be found. - static jni.JObject create( + /// @see DefaultEmojiCompatConfig\#create + ///@hide + EmojiCompat_Config create( jni.JObject context, ) { - return const jni.JObjectType().fromRef(_create(context.reference).object); + return const $EmojiCompat_ConfigType() + .fromRef(_create(reference, context.reference).object); } } -final class $DefaultEmojiCompatConfigType - extends jni.JObjType { - const $DefaultEmojiCompatConfigType(); +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType + extends jni + .JObjType { + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); @override - String get signature => r"Landroidx/emoji2/text/DefaultEmojiCompatConfig;"; + String get signature => + r"Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;"; @override - DefaultEmojiCompatConfig fromRef(jni.JObjectPtr ref) => - DefaultEmojiCompatConfig.fromRef(ref); + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory fromRef( + jni.JObjectPtr ref) => + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1968,99 +2027,148 @@ final class $DefaultEmojiCompatConfigType final superCount = 1; @override - int get hashCode => ($DefaultEmojiCompatConfigType).hashCode; + int get hashCode => + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($DefaultEmojiCompatConfigType) && - other is $DefaultEmojiCompatConfigType; + return other.runtimeType == + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType) && + other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType; } } -/// from: androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 +/// from: androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper /// -/// Helper to lookup signatures in package manager > API 28 +/// Helper to lookup signatures in package manager. ///@hide -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 - extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 { +class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper + extends jni.JObject { @override late final jni - .JObjType - $type = type; + .JObjType $type = + type; - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromRef( + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); static final _new0 = jniLookup>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0") + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0") .asFunction(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 - .fromRef(_new0().object); + factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { + return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef( + _new0().object); } - static final _getSigningSignatures1 = jniLookup< + static final _getSigningSignatures = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1") + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures") .asFunction< jni.JniResult Function(ffi.Pointer, 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. - jni.JArray getSigningSignatures1( + /// + /// Get the signing signatures for a package in package manager. + jni.JArray getSigningSignatures( jni.JObject packageManager, jni.JString providerPackage, ) { return const jni.JArrayType(jni.JObjectType()).fromRef( - _getSigningSignatures1( + _getSigningSignatures( reference, packageManager.reference, providerPackage.reference) .object); } + + static final _queryIntentContentProviders = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>( + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders") + .asFunction< + jni.JniResult Function(ffi.Pointer, 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. + /// + /// Get the content provider by intent. + jni.JList queryIntentContentProviders( + jni.JObject packageManager, + jni.JObject intent, + int flags, + ) { + return const jni.JListType(jni.JObjectType()).fromRef( + _queryIntentContentProviders( + reference, packageManager.reference, intent.reference, flags) + .object); + } + + static final _getProviderInfo = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>>( + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo") + .asFunction< + jni.JniResult Function( + ffi.Pointer, 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. + /// + /// Get a ProviderInfo, if present, from a ResolveInfo + ///@param resolveInfo the subject + ///@return resolveInfo.providerInfo above API 19 + jni.JObject getProviderInfo( + jni.JObject resolveInfo, + ) { + return const jni.JObjectType() + .fromRef(_getProviderInfo(reference, resolveInfo.reference).object); + } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType extends jni - .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); + .JObjType { + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); @override String get signature => - r"Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28;"; + r"Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;"; @override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 fromRef( + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper fromRef( jni.JObjectPtr ref) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromRef( - ref); + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef(ref); @override - jni.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 3; + final superCount = 1; @override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type) - .hashCode; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType).hashCode; @override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type) && - other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType) && + other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType; } } @@ -2173,211 +2281,174 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type } } -/// from: androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper +/// from: androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 /// -/// Helper to lookup signatures in package manager. +/// Helper to lookup signatures in package manager > API 28 ///@hide -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper - extends jni.JObject { +class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 + extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 { @override late final jni - .JObjType $type = - type; + .JObjType + $type = type; - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef( + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); static final _new0 = jniLookup>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0") + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0") .asFunction(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef( - _new0().object); + factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { + return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 + .fromRef(_new0().object); } - static final _getSigningSignatures = jniLookup< + static final _getSigningSignatures1 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getSigningSignatures") + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1") .asFunction< jni.JniResult Function(ffi.Pointer, 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. - /// - /// Get the signing signatures for a package in package manager. - jni.JArray getSigningSignatures( + jni.JArray getSigningSignatures1( jni.JObject packageManager, jni.JString providerPackage, ) { return const jni.JArrayType(jni.JObjectType()).fromRef( - _getSigningSignatures( + _getSigningSignatures1( reference, packageManager.reference, providerPackage.reference) .object); } - - static final _queryIntentContentProviders = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__queryIntentContentProviders") - .asFunction< - jni.JniResult Function(ffi.Pointer, 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. - /// - /// Get the content provider by intent. - jni.JList queryIntentContentProviders( - jni.JObject packageManager, - jni.JObject intent, - int flags, - ) { - return const jni.JListType(jni.JObjectType()).fromRef( - _queryIntentContentProviders( - reference, packageManager.reference, intent.reference, flags) - .object); - } - - static final _getProviderInfo = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo") - .asFunction< - jni.JniResult Function( - ffi.Pointer, 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. - /// - /// Get a ProviderInfo, if present, from a ResolveInfo - ///@param resolveInfo the subject - ///@return resolveInfo.providerInfo above API 19 - jni.JObject getProviderInfo( - jni.JObject resolveInfo, - ) { - return const jni.JObjectType() - .fromRef(_getProviderInfo(reference, resolveInfo.reference).object); - } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type extends jni - .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); + .JObjType { + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); @override String get signature => - r"Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;"; + r"Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28;"; @override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper fromRef( + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 fromRef( jni.JObjectPtr ref) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef(ref); + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromRef( + ref); @override - jni.JObjType get superType => const jni.JObjectType(); + jni.JObjType get superType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); @override - final superCount = 1; + final superCount = 3; @override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType).hashCode; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type) + .hashCode; @override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType) && - other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type) && + other + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type; } } -/// from: androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory +/// from: androidx.emoji2.text.DefaultEmojiCompatConfig /// -/// Actual factory for generating default emoji configs, does service locator lookup internally. -///@see DefaultEmojiCompatConfig\#create -///@hide -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory - extends jni.JObject { +/// The default config will use downloadable fonts to fetch the emoji compat font file. +/// +/// It will automatically fetch the emoji compat font from a {@code ContentProvider} that is +/// installed on the devices system image, if present. +/// +/// +/// You should use this if you want the default emoji font from a system installed +/// downloadable fonts provider. This is the recommended behavior for all applications unless +/// they install a custom emoji font. +/// +/// +/// You may need to specialize the configuration beyond this default config in some +/// situations: +/// +///
    +///
  • If you are trying to install a custom emoji font through downloadable fonts use +/// FontRequestEmojiCompatConfig instead of this method.
  • +///
  • If you're trying to bundle an emoji font with your APK use {@code +/// BundledEmojiCompatConfig} in the {@code emoji2-bundled} artifact.
  • +///
  • If you are building an APK that will be installed on devices that won't have a +/// downloadable fonts provider, use {@code BundledEmojiCompatConfig}.
  • +///
+/// +/// The downloadable font provider used by {@code DefaultEmojiCompatConfig} always satisfies +/// the following contract: +/// +///
    +///
  1. It MUST provide an intent filter for {@code androidx.content.action.LOAD_EMOJI_FONT}. +///
  2. +///
  3. It MUST respond to the query {@code emojicompat-emoji-font} with a valid emoji compat +/// font file including metadata.
  4. +///
  5. It MUST provide fonts via the same contract as downloadable fonts.
  6. +///
  7. It MUST be installed in the system image.
  8. +///
+class DefaultEmojiCompatConfig extends jni.JObject { @override - late final jni - .JObjType - $type = type; + late final jni.JObjType $type = type; - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef( + DefaultEmojiCompatConfig.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); - static final _new0 = jniLookup< + static const type = $DefaultEmojiCompatConfigType(); + static final _create = jniLookup< ffi .NativeFunction)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0") + "DefaultEmojiCompatConfig__create") .asFunction)>(); - /// from: public void (androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigHelper helper) + /// 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. /// - /// @hide - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory( - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper helper, - ) { - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef( - _new0(helper.reference).object); - } - - static final _create = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create") - .asFunction< - jni.JniResult Function( - ffi.Pointer, 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. + /// Get the default emoji compat config for this device. /// - /// @see DefaultEmojiCompatConfig\#create - ///@hide - EmojiCompat_Config create( + /// You may further configure the returned config before passing it to EmojiCompat\#init. + /// + /// Each call to this method will return a new EmojiCompat.Config, so changes to the returned + /// object will not modify future return values. + ///@param context context for lookup + ///@return A valid config for downloading the emoji compat font, or null if no font provider + /// could be found. + static jni.JObject create( jni.JObject context, ) { - return const $EmojiCompat_ConfigType() - .fromRef(_create(reference, context.reference).object); + return const jni.JObjectType().fromRef(_create(context.reference).object); } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType - extends jni - .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); +final class $DefaultEmojiCompatConfigType + extends jni.JObjType { + const $DefaultEmojiCompatConfigType(); @override - String get signature => - r"Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;"; + String get signature => r"Landroidx/emoji2/text/DefaultEmojiCompatConfig;"; @override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory fromRef( - jni.JObjectPtr ref) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef(ref); + DefaultEmojiCompatConfig fromRef(jni.JObjectPtr ref) => + DefaultEmojiCompatConfig.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -2386,14 +2457,12 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType final superCount = 1; @override - int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType).hashCode; + int get hashCode => ($DefaultEmojiCompatConfigType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType) && - other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType; + return other.runtimeType == ($DefaultEmojiCompatConfigType) && + other is $DefaultEmojiCompatConfigType; } } @@ -3676,3 +3745,57 @@ final class $HashMapType<$K extends jni.JObject, $V extends jni.JObject> V == other.V; } } + +/// from: com.example.in_app_java.AndroidUtils +class AndroidUtils extends jni.JObject { + @override + late final jni.JObjType $type = type; + + AndroidUtils.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// The type which includes information such as the signature of this class. + static const type = $AndroidUtilsType(); + static final _showToast = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>("AndroidUtils__showToast") + .asFunction< + jni.JniResult Function( + 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, + ) { + return _showToast(mainActivity.reference, text.reference, duration).check(); + } +} + +final class $AndroidUtilsType extends jni.JObjType { + const $AndroidUtilsType(); + + @override + String get signature => r"Lcom/example/in_app_java/AndroidUtils;"; + + @override + AndroidUtils fromRef(jni.JObjectPtr ref) => AndroidUtils.fromRef(ref); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($AndroidUtilsType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($AndroidUtilsType) && + other is $AndroidUtilsType; + } +} 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 index 381224d4ce..993aade1e3 100644 --- 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 @@ -15,1192 +15,1060 @@ void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { env_getter = eg; } -// com.example.in_app_java.AndroidUtils -jclass _c_AndroidUtils = NULL; +// androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult +jclass _c_EmojiCompat_CodepointSequenceMatchResult = NULL; -jmethodID _m_AndroidUtils__showToast = NULL; +// androidx.emoji2.text.EmojiCompat$Config +jclass _c_EmojiCompat_Config = NULL; + +jmethodID _m_EmojiCompat_Config__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult AndroidUtils__showToast(jobject mainActivity, - jobject text, - int32_t duration) { +JniResult EmojiCompat_Config__new0(jobject metadataLoader) { load_env(); - load_class_global_ref(&_c_AndroidUtils, - "com/example/in_app_java/AndroidUtils"); - if (_c_AndroidUtils == NULL) + 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_static_method(_c_AndroidUtils, &_m_AndroidUtils__showToast, "showToast", - "(Landroid/app/Activity;Ljava/lang/CharSequence;I)V"); - if (_m_AndroidUtils__showToast == NULL) + 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()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_AndroidUtils, - _m_AndroidUtils__showToast, mainActivity, - text, duration); - 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); } -// androidx.emoji2.text.EmojiCompat -jclass _c_EmojiCompat = NULL; - -jmethodID _m_EmojiCompat__init = NULL; +jmethodID _m_EmojiCompat_Config__registerInitCallback = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__init(jobject context) { +JniResult EmojiCompat_Config__registerInitCallback(jobject self_, + jobject initCallback) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method( - _c_EmojiCompat, &_m_EmojiCompat__init, "init", - "(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__init == NULL) + 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)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__init, context); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__registerInitCallback, initCallback); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__init1 = NULL; +jmethodID _m_EmojiCompat_Config__unregisterInitCallback = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__init1(jobject context, jobject defaultFactory) { +JniResult EmojiCompat_Config__unregisterInitCallback(jobject self_, + jobject initCallback) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_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) + 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)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__init1, context, defaultFactory); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__unregisterInitCallback, + initCallback); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__init2 = NULL; +jmethodID _m_EmojiCompat_Config__setReplaceAll = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__init2(jobject config) { +JniResult EmojiCompat_Config__setReplaceAll(jobject self_, uint8_t replaceAll) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method(_c_EmojiCompat, &_m_EmojiCompat__init2, "init", - "(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/" - "emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__init2 == NULL) + 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)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__init2, config); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__setReplaceAll, replaceAll); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__isConfigured = NULL; +jmethodID _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__isConfigured() { +JniResult EmojiCompat_Config__setUseEmojiAsDefaultStyle( + jobject self_, + uint8_t useEmojiAsDefaultStyle) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method(_c_EmojiCompat, &_m_EmojiCompat__isConfigured, - "isConfigured", "()Z"); - if (_m_EmojiCompat__isConfigured == NULL) + 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()}; - uint8_t _result = (*jniEnv)->CallStaticBooleanMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__isConfigured); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle, + useEmojiAsDefaultStyle); + return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__reset = NULL; +jmethodID _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__reset(jobject config) { +JniResult EmojiCompat_Config__setUseEmojiAsDefaultStyle1( + jobject self_, + uint8_t useEmojiAsDefaultStyle, + jobject emojiAsDefaultStyleExceptions) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method(_c_EmojiCompat, &_m_EmojiCompat__reset, "reset", - "(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/" - "emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__reset == NULL) + 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)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__reset, config); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1, + useEmojiAsDefaultStyle, emojiAsDefaultStyleExceptions); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__reset1 = NULL; +jmethodID _m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__reset1(jobject emojiCompat) { +JniResult EmojiCompat_Config__setEmojiSpanIndicatorEnabled( + jobject self_, + uint8_t emojiSpanIndicatorEnabled) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method( - _c_EmojiCompat, &_m_EmojiCompat__reset1, "reset", - "(Landroidx/emoji2/text/EmojiCompat;)Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__reset1 == NULL) + 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)->CallStaticObjectMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__reset1, emojiCompat); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled, + emojiSpanIndicatorEnabled); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__skipDefaultConfigurationLookup = NULL; +jmethodID _m_EmojiCompat_Config__setEmojiSpanIndicatorColor = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__skipDefaultConfigurationLookup(uint8_t shouldSkip) { +JniResult EmojiCompat_Config__setEmojiSpanIndicatorColor(jobject self_, + int32_t color) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method(_c_EmojiCompat, - &_m_EmojiCompat__skipDefaultConfigurationLookup, - "skipDefaultConfigurationLookup", "(Z)V"); - if (_m_EmojiCompat__skipDefaultConfigurationLookup == NULL) + 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()}; - (*jniEnv)->CallStaticVoidMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__skipDefaultConfigurationLookup, - shouldSkip); - 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__get0 = NULL; +jmethodID _m_EmojiCompat_Config__setMetadataLoadStrategy = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__get0() { +JniResult EmojiCompat_Config__setMetadataLoadStrategy(jobject self_, + int32_t strategy) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method(_c_EmojiCompat, &_m_EmojiCompat__get0, "get", - "()Landroidx/emoji2/text/EmojiCompat;"); - if (_m_EmojiCompat__get0 == NULL) + 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)->CallStaticObjectMethod(jniEnv, _c_EmojiCompat, - _m_EmojiCompat__get0); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__setMetadataLoadStrategy, strategy); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__load = NULL; +jmethodID _m_EmojiCompat_Config__setSpanFactory = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__load(jobject self_) { +JniResult EmojiCompat_Config__setSpanFactory(jobject self_, jobject factory) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__load, "load", "()V"); - if (_m_EmojiCompat__load == NULL) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__load); - 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__registerInitCallback = NULL; +jmethodID _m_EmojiCompat_Config__setGlyphChecker = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__registerInitCallback(jobject self_, - jobject initCallback) { +JniResult EmojiCompat_Config__setGlyphChecker(jobject self_, + jobject glyphChecker) { 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) + 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, &_m_EmojiCompat__unregisterInitCallback, - "unregisterInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V"); - if (_m_EmojiCompat__unregisterInitCallback == NULL) + 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()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_EmojiCompat__unregisterInitCallback, initCallback); - 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__getLoadState = NULL; +jmethodID _m_EmojiCompat_Config__getMetadataRepoLoader = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getLoadState(jobject self_) { +JniResult EmojiCompat_Config__getMetadataRepoLoader(jobject self_) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__getLoadState, "getLoadState", - "()I"); - if (_m_EmojiCompat__getLoadState == NULL) + 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()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_EmojiCompat__getLoadState); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_Config__getMetadataRepoLoader); + return to_global_ref_result(_result); } -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()}; -} +// androidx.emoji2.text.EmojiCompat$DefaultSpanFactory +jclass _c_EmojiCompat_DefaultSpanFactory = NULL; -jmethodID _m_EmojiCompat__getEmojiSpanIndicatorColor = NULL; +jmethodID _m_EmojiCompat_DefaultSpanFactory__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiSpanIndicatorColor(jobject self_) { +JniResult EmojiCompat_DefaultSpanFactory__new0() { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__getEmojiSpanIndicatorColor, - "getEmojiSpanIndicatorColor", "()I"); - if (_m_EmojiCompat__getEmojiSpanIndicatorColor == NULL) + load_method(_c_EmojiCompat_DefaultSpanFactory, + &_m_EmojiCompat_DefaultSpanFactory__new0, "", "()V"); + if (_m_EmojiCompat_DefaultSpanFactory__new0 == 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()}; + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_DefaultSpanFactory, + _m_EmojiCompat_DefaultSpanFactory__new0); + return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__getEmojiStart = NULL; +jmethodID _m_EmojiCompat_DefaultSpanFactory__createSpan = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiStart(jobject self_, - jobject charSequence, - int32_t offset) { +JniResult EmojiCompat_DefaultSpanFactory__createSpan(jobject self_, + jobject rasterizer) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__getEmojiStart, "getEmojiStart", - "(Ljava/lang/CharSequence;I)I"); - if (_m_EmojiCompat__getEmojiStart == NULL) + 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()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_EmojiCompat__getEmojiStart, charSequence, offset); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat_DefaultSpanFactory__createSpan, rasterizer); + return to_global_ref_result(_result); } -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()}; -} +// androidx.emoji2.text.EmojiCompat$GlyphChecker +jclass _c_EmojiCompat_GlyphChecker = NULL; -jmethodID _m_EmojiCompat__handleOnKeyDown = NULL; +jmethodID _m_EmojiCompat_GlyphChecker__hasGlyph = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__handleOnKeyDown(jobject editable, - int32_t keyCode, - jobject event) { +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, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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_static_method(_c_EmojiCompat, &_m_EmojiCompat__handleOnKeyDown, - "handleOnKeyDown", - "(Landroid/text/Editable;ILandroid/view/KeyEvent;)Z"); - if (_m_EmojiCompat__handleOnKeyDown == NULL) + 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)->CallStaticBooleanMethod( - jniEnv, _c_EmojiCompat, _m_EmojiCompat__handleOnKeyDown, editable, - keyCode, event); + uint8_t _result = (*jniEnv)->CallBooleanMethod( + jniEnv, self_, _m_EmojiCompat_GlyphChecker__hasGlyph, charSequence, start, + end, sdkAdded); 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()}; -} +// androidx.emoji2.text.EmojiCompat$InitCallback +jclass _c_EmojiCompat_InitCallback = NULL; -jmethodID _m_EmojiCompat__hasEmojiGlyph = NULL; +jmethodID _m_EmojiCompat_InitCallback__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__hasEmojiGlyph(jobject self_, jobject sequence) { +JniResult EmojiCompat_InitCallback__new0() { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__hasEmojiGlyph, "hasEmojiGlyph", - "(Ljava/lang/CharSequence;)Z"); - if (_m_EmojiCompat__hasEmojiGlyph == NULL) + load_method(_c_EmojiCompat_InitCallback, &_m_EmojiCompat_InitCallback__new0, + "", "()V"); + if (_m_EmojiCompat_InitCallback__new0 == 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()}; + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_InitCallback, + _m_EmojiCompat_InitCallback__new0); + return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__hasEmojiGlyph1 = NULL; +jmethodID _m_EmojiCompat_InitCallback__onInitialized = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__hasEmojiGlyph1(jobject self_, - jobject sequence, - int32_t metadataVersion) { +JniResult EmojiCompat_InitCallback__onInitialized(jobject self_) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__hasEmojiGlyph1, "hasEmojiGlyph", - "(Ljava/lang/CharSequence;I)Z"); - if (_m_EmojiCompat__hasEmojiGlyph1 == NULL) + 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()}; - uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_EmojiCompat__hasEmojiGlyph1, sequence, metadataVersion); - return (JniResult){.value = {.z = _result}, .exception = check_exception()}; + (*jniEnv)->CallVoidMethod(jniEnv, self_, + _m_EmojiCompat_InitCallback__onInitialized); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat__getEmojiMatch = NULL; +jmethodID _m_EmojiCompat_InitCallback__onFailed = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__getEmojiMatch(jobject self_, - jobject sequence, - int32_t metadataVersion) { +JniResult EmojiCompat_InitCallback__onFailed(jobject self_, jobject throwable) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__getEmojiMatch, "getEmojiMatch", - "(Ljava/lang/CharSequence;I)I"); - if (_m_EmojiCompat__getEmojiMatch == NULL) + 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()}; - int32_t _result = (*jniEnv)->CallIntMethod( - jniEnv, self_, _m_EmojiCompat__getEmojiMatch, sequence, metadataVersion); - return (JniResult){.value = {.i = _result}, .exception = check_exception()}; + (*jniEnv)->CallVoidMethod(jniEnv, self_, + _m_EmojiCompat_InitCallback__onFailed, throwable); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat__process = NULL; +// 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__process(jobject self_, jobject charSequence) { +JniResult EmojiCompat_MetadataRepoLoader__load(jobject self_, + jobject loaderCallback) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__process, "process", - "(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process == NULL) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__process, charSequence); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod( + jniEnv, self_, _m_EmojiCompat_MetadataRepoLoader__load, loaderCallback); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat__process1 = NULL; +// androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback +jclass _c_EmojiCompat_MetadataRepoLoaderCallback = NULL; + +jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process1(jobject self_, - jobject charSequence, - int32_t start, - int32_t end) { +JniResult EmojiCompat_MetadataRepoLoaderCallback__new0() { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__process1, "process", - "(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process1 == NULL) + 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)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__process1, charSequence, start, end); + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_MetadataRepoLoaderCallback, + _m_EmojiCompat_MetadataRepoLoaderCallback__new0); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat__process2 = NULL; +jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process2(jobject self_, - jobject charSequence, - int32_t start, - int32_t end, - int32_t maxEmojiCount) { +JniResult EmojiCompat_MetadataRepoLoaderCallback__onLoaded( + jobject self_, + jobject metadataRepo) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__process2, "process", - "(Ljava/lang/CharSequence;III)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process2 == NULL) + 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()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_EmojiCompat__process2, - charSequence, start, end, maxEmojiCount); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod(jniEnv, self_, + _m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded, + metadataRepo); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat__process3 = NULL; +jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__onFailed = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat__process3(jobject self_, - jobject charSequence, - int32_t start, - int32_t end, - int32_t maxEmojiCount, - int32_t replaceStrategy) { +JniResult EmojiCompat_MetadataRepoLoaderCallback__onFailed(jobject self_, + jobject throwable) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__process3, "process", - "(Ljava/lang/CharSequence;IIII)Ljava/lang/CharSequence;"); - if (_m_EmojiCompat__process3 == NULL) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat__process3, charSequence, start, end, - maxEmojiCount, replaceStrategy); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod(jniEnv, self_, + _m_EmojiCompat_MetadataRepoLoaderCallback__onFailed, + throwable); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat__getAssetSignature = NULL; +// 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__getAssetSignature(jobject self_) { +JniResult EmojiCompat_SpanFactory__createSpan(jobject self_, + jobject rasterizer) { load_env(); - load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); - if (_c_EmojiCompat == NULL) + 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, &_m_EmojiCompat__getAssetSignature, - "getAssetSignature", "()Ljava/lang/String;"); - if (_m_EmojiCompat__getAssetSignature == NULL) + 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__getAssetSignature); + jniEnv, self_, _m_EmojiCompat_SpanFactory__createSpan, rasterizer); 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()}; -} +// androidx.emoji2.text.EmojiCompat +jclass _c_EmojiCompat = NULL; -jfieldID _f_EmojiCompat__EDITOR_INFO_METAVERSION_KEY = NULL; +jmethodID _m_EmojiCompat__init = NULL; FFI_PLUGIN_EXPORT -JniResult get_EmojiCompat__EDITOR_INFO_METAVERSION_KEY() { +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_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); + 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); } -jfieldID _f_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY = NULL; +jmethodID _m_EmojiCompat__init1 = NULL; FFI_PLUGIN_EXPORT -JniResult get_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY() { +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_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); + 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); } -// androidx.emoji2.text.EmojiCompat$Config -jclass _c_EmojiCompat_Config = NULL; - -jmethodID _m_EmojiCompat_Config__new0 = NULL; +jmethodID _m_EmojiCompat__init2 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__new0(jobject metadataLoader) { +JniResult EmojiCompat__init2(jobject config) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, &_m_EmojiCompat_Config__new0, "", - "(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;)V"); - if (_m_EmojiCompat_Config__new0 == NULL) + 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)->NewObject(jniEnv, _c_EmojiCompat_Config, - _m_EmojiCompat_Config__new0, metadataLoader); + jobject _result = (*jniEnv)->CallStaticObjectMethod( + jniEnv, _c_EmojiCompat, _m_EmojiCompat__init2, config); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat_Config__registerInitCallback = NULL; +jmethodID _m_EmojiCompat__isConfigured = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__registerInitCallback(jobject self_, - jobject initCallback) { +JniResult EmojiCompat__isConfigured() { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__registerInitCallback, - "registerInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__registerInitCallback == NULL) + load_static_method(_c_EmojiCompat, &_m_EmojiCompat__isConfigured, + "isConfigured", "()Z"); + if (_m_EmojiCompat__isConfigured == 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); + uint8_t _result = (*jniEnv)->CallStaticBooleanMethod( + jniEnv, _c_EmojiCompat, _m_EmojiCompat__isConfigured); + return (JniResult){.value = {.z = _result}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__unregisterInitCallback = NULL; +jmethodID _m_EmojiCompat__reset = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__unregisterInitCallback(jobject self_, - jobject initCallback) { +JniResult EmojiCompat__reset(jobject config) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__unregisterInitCallback, - "unregisterInitCallback", - "(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__unregisterInitCallback == NULL) + 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)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__unregisterInitCallback, - initCallback); + jobject _result = (*jniEnv)->CallStaticObjectMethod( + jniEnv, _c_EmojiCompat, _m_EmojiCompat__reset, config); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat_Config__setReplaceAll = NULL; +jmethodID _m_EmojiCompat__reset1 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setReplaceAll(jobject self_, uint8_t replaceAll) { +JniResult EmojiCompat__reset1(jobject emojiCompat) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, &_m_EmojiCompat_Config__setReplaceAll, - "setReplaceAll", "(Z)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setReplaceAll == NULL) + 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)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setReplaceAll, replaceAll); + jobject _result = (*jniEnv)->CallStaticObjectMethod( + jniEnv, _c_EmojiCompat, _m_EmojiCompat__reset1, emojiCompat); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle = NULL; +jmethodID _m_EmojiCompat__skipDefaultConfigurationLookup = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setUseEmojiAsDefaultStyle( - jobject self_, - uint8_t useEmojiAsDefaultStyle) { +JniResult EmojiCompat__skipDefaultConfigurationLookup(uint8_t shouldSkip) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle, - "setUseEmojiAsDefaultStyle", - "(Z)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle == NULL) + load_static_method(_c_EmojiCompat, + &_m_EmojiCompat__skipDefaultConfigurationLookup, + "skipDefaultConfigurationLookup", "(Z)V"); + if (_m_EmojiCompat__skipDefaultConfigurationLookup == 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); + (*jniEnv)->CallStaticVoidMethod( + jniEnv, _c_EmojiCompat, _m_EmojiCompat__skipDefaultConfigurationLookup, + shouldSkip); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1 = NULL; +jmethodID _m_EmojiCompat__get0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setUseEmojiAsDefaultStyle1( - jobject self_, - uint8_t useEmojiAsDefaultStyle, - jobject emojiAsDefaultStyleExceptions) { +JniResult EmojiCompat__get0() { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1, - "setUseEmojiAsDefaultStyle", - "(ZLjava/util/List;)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1 == NULL) + 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)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setUseEmojiAsDefaultStyle1, - useEmojiAsDefaultStyle, emojiAsDefaultStyleExceptions); + jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_EmojiCompat, + _m_EmojiCompat__get0); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled = NULL; +jmethodID _m_EmojiCompat__load = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setEmojiSpanIndicatorEnabled( - jobject self_, - uint8_t emojiSpanIndicatorEnabled) { +JniResult EmojiCompat__load(jobject self_) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled, - "setEmojiSpanIndicatorEnabled", - "(Z)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setEmojiSpanIndicatorEnabled == NULL) + load_method(_c_EmojiCompat, &_m_EmojiCompat__load, "load", "()V"); + if (_m_EmojiCompat__load == 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); + (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__load); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__setEmojiSpanIndicatorColor = NULL; +jmethodID _m_EmojiCompat__registerInitCallback = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setEmojiSpanIndicatorColor(jobject self_, - int32_t color) { +JniResult EmojiCompat__registerInitCallback(jobject self_, + jobject initCallback) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__setEmojiSpanIndicatorColor, - "setEmojiSpanIndicatorColor", - "(I)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setEmojiSpanIndicatorColor == NULL) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setEmojiSpanIndicatorColor, color); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__registerInitCallback, + initCallback); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__setMetadataLoadStrategy = NULL; +jmethodID _m_EmojiCompat__unregisterInitCallback = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setMetadataLoadStrategy(jobject self_, - int32_t strategy) { +JniResult EmojiCompat__unregisterInitCallback(jobject self_, + jobject initCallback) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__setMetadataLoadStrategy, - "setMetadataLoadStrategy", - "(I)Landroidx/emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setMetadataLoadStrategy == NULL) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_EmojiCompat_Config__setMetadataLoadStrategy, strategy); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod( + jniEnv, self_, _m_EmojiCompat__unregisterInitCallback, initCallback); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__setSpanFactory = NULL; +jmethodID _m_EmojiCompat__getLoadState = 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) +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_Config, &_m_EmojiCompat_Config__setSpanFactory, - "setSpanFactory", - "(Landroidx/emoji2/text/EmojiCompat$SpanFactory;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setSpanFactory == NULL) + load_method(_c_EmojiCompat, &_m_EmojiCompat__getLoadState, "getLoadState", + "()I"); + if (_m_EmojiCompat__getLoadState == 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); + int32_t _result = + (*jniEnv)->CallIntMethod(jniEnv, self_, _m_EmojiCompat__getLoadState); + return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__setGlyphChecker = NULL; +jmethodID _m_EmojiCompat__isEmojiSpanIndicatorEnabled = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__setGlyphChecker(jobject self_, - jobject glyphChecker) { +JniResult EmojiCompat__isEmojiSpanIndicatorEnabled(jobject self_) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, &_m_EmojiCompat_Config__setGlyphChecker, - "setGlyphChecker", - "(Landroidx/emoji2/text/EmojiCompat$GlyphChecker;)Landroidx/" - "emoji2/text/EmojiCompat$Config;"); - if (_m_EmojiCompat_Config__setGlyphChecker == NULL) + load_method(_c_EmojiCompat, &_m_EmojiCompat__isEmojiSpanIndicatorEnabled, + "isEmojiSpanIndicatorEnabled", "()Z"); + if (_m_EmojiCompat__isEmojiSpanIndicatorEnabled == 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); + uint8_t _result = (*jniEnv)->CallBooleanMethod( + jniEnv, self_, _m_EmojiCompat__isEmojiSpanIndicatorEnabled); + return (JniResult){.value = {.z = _result}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_Config__getMetadataRepoLoader = NULL; +jmethodID _m_EmojiCompat__getEmojiSpanIndicatorColor = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__getMetadataRepoLoader(jobject self_) { +JniResult EmojiCompat__getEmojiSpanIndicatorColor(jobject self_) { load_env(); - load_class_global_ref(&_c_EmojiCompat_Config, - "androidx/emoji2/text/EmojiCompat$Config"); - if (_c_EmojiCompat_Config == NULL) + 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_Config, - &_m_EmojiCompat_Config__getMetadataRepoLoader, - "getMetadataRepoLoader", - "()Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;"); - if (_m_EmojiCompat_Config__getMetadataRepoLoader == NULL) + load_method(_c_EmojiCompat, &_m_EmojiCompat__getEmojiSpanIndicatorColor, + "getEmojiSpanIndicatorColor", "()I"); + if (_m_EmojiCompat__getEmojiSpanIndicatorColor == 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); + int32_t _result = (*jniEnv)->CallIntMethod( + jniEnv, self_, _m_EmojiCompat__getEmojiSpanIndicatorColor); + return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -// androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback -jclass _c_EmojiCompat_MetadataRepoLoaderCallback = NULL; - -jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__new0 = NULL; +jmethodID _m_EmojiCompat__getEmojiStart = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__new0() { +JniResult EmojiCompat__getEmojiStart(jobject self_, + jobject charSequence, + int32_t offset) { load_env(); - load_class_global_ref( - &_c_EmojiCompat_MetadataRepoLoaderCallback, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); - if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) + 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_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__new0, "", - "()V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__new0 == NULL) + 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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_MetadataRepoLoaderCallback, - _m_EmojiCompat_MetadataRepoLoaderCallback__new0); - return to_global_ref_result(_result); + int32_t _result = (*jniEnv)->CallIntMethod( + jniEnv, self_, _m_EmojiCompat__getEmojiStart, charSequence, offset); + return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded = NULL; +jmethodID _m_EmojiCompat__getEmojiEnd = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__onLoaded( - jobject self_, - jobject metadataRepo) { +JniResult EmojiCompat__getEmojiEnd(jobject self_, + jobject charSequence, + int32_t offset) { load_env(); - load_class_global_ref( - &_c_EmojiCompat_MetadataRepoLoaderCallback, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); - if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) + 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_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded, "onLoaded", - "(Landroidx/emoji2/text/MetadataRepo;)V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded == NULL) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_MetadataRepoLoaderCallback__onLoaded, - metadataRepo); - 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_MetadataRepoLoaderCallback__onFailed = NULL; +jmethodID _m_EmojiCompat__handleOnKeyDown = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__onFailed(jobject self_, - jobject throwable) { +JniResult EmojiCompat__handleOnKeyDown(jobject editable, + int32_t keyCode, + jobject event) { load_env(); - load_class_global_ref( - &_c_EmojiCompat_MetadataRepoLoaderCallback, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback"); - if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) + 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_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__onFailed, "onFailed", - "(Ljava/lang/Throwable;)V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__onFailed == NULL) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_MetadataRepoLoaderCallback__onFailed, - throwable); - 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()}; } -// androidx.emoji2.text.EmojiCompat$GlyphChecker -jclass _c_EmojiCompat_GlyphChecker = NULL; - -jmethodID _m_EmojiCompat_GlyphChecker__hasGlyph = NULL; +jmethodID _m_EmojiCompat__handleDeleteSurroundingText = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_GlyphChecker__hasGlyph(jobject self_, - jobject charSequence, - int32_t start, - int32_t end, - int32_t sdkAdded) { +JniResult EmojiCompat__handleDeleteSurroundingText(jobject inputConnection, + jobject editable, + int32_t beforeLength, + int32_t afterLength, + uint8_t inCodePoints) { load_env(); - load_class_global_ref(&_c_EmojiCompat_GlyphChecker, - "androidx/emoji2/text/EmojiCompat$GlyphChecker"); - if (_c_EmojiCompat_GlyphChecker == NULL) + 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_GlyphChecker, - &_m_EmojiCompat_GlyphChecker__hasGlyph, "hasGlyph", - "(Ljava/lang/CharSequence;III)Z"); - if (_m_EmojiCompat_GlyphChecker__hasGlyph == NULL) + 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)->CallBooleanMethod( - jniEnv, self_, _m_EmojiCompat_GlyphChecker__hasGlyph, charSequence, start, - end, sdkAdded); + uint8_t _result = (*jniEnv)->CallStaticBooleanMethod( + jniEnv, _c_EmojiCompat, _m_EmojiCompat__handleDeleteSurroundingText, + inputConnection, editable, beforeLength, afterLength, inCodePoints); return (JniResult){.value = {.z = _result}, .exception = check_exception()}; } -// androidx.emoji2.text.EmojiCompat$MetadataRepoLoader -jclass _c_EmojiCompat_MetadataRepoLoader = NULL; - -jmethodID _m_EmojiCompat_MetadataRepoLoader__load = NULL; +jmethodID _m_EmojiCompat__hasEmojiGlyph = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoader__load(jobject self_, - jobject loaderCallback) { +JniResult EmojiCompat__hasEmojiGlyph(jobject self_, jobject sequence) { load_env(); - load_class_global_ref(&_c_EmojiCompat_MetadataRepoLoader, - "androidx/emoji2/text/EmojiCompat$MetadataRepoLoader"); - if (_c_EmojiCompat_MetadataRepoLoader == NULL) + 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_MetadataRepoLoader, - &_m_EmojiCompat_MetadataRepoLoader__load, "load", - "(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V"); - if (_m_EmojiCompat_MetadataRepoLoader__load == NULL) + 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()}; - (*jniEnv)->CallVoidMethod( - jniEnv, self_, _m_EmojiCompat_MetadataRepoLoader__load, loaderCallback); - 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()}; } -// androidx.emoji2.text.EmojiCompat$InitCallback -jclass _c_EmojiCompat_InitCallback = NULL; - -jmethodID _m_EmojiCompat_InitCallback__new0 = NULL; +jmethodID _m_EmojiCompat__hasEmojiGlyph1 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__new0() { +JniResult EmojiCompat__hasEmojiGlyph1(jobject self_, + jobject sequence, + int32_t metadataVersion) { load_env(); - load_class_global_ref(&_c_EmojiCompat_InitCallback, - "androidx/emoji2/text/EmojiCompat$InitCallback"); - if (_c_EmojiCompat_InitCallback == NULL) + 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_InitCallback, &_m_EmojiCompat_InitCallback__new0, - "", "()V"); - if (_m_EmojiCompat_InitCallback__new0 == NULL) + 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()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_InitCallback, - _m_EmojiCompat_InitCallback__new0); - return to_global_ref_result(_result); + uint8_t _result = (*jniEnv)->CallBooleanMethod( + jniEnv, self_, _m_EmojiCompat__hasEmojiGlyph1, sequence, metadataVersion); + return (JniResult){.value = {.z = _result}, .exception = check_exception()}; } -jmethodID _m_EmojiCompat_InitCallback__onInitialized = NULL; +jmethodID _m_EmojiCompat__getEmojiMatch = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__onInitialized(jobject self_) { +JniResult EmojiCompat__getEmojiMatch(jobject self_, + jobject sequence, + int32_t metadataVersion) { load_env(); - load_class_global_ref(&_c_EmojiCompat_InitCallback, - "androidx/emoji2/text/EmojiCompat$InitCallback"); - if (_c_EmojiCompat_InitCallback == NULL) + 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_InitCallback, - &_m_EmojiCompat_InitCallback__onInitialized, "onInitialized", - "()V"); - if (_m_EmojiCompat_InitCallback__onInitialized == NULL) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_InitCallback__onInitialized); - 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_InitCallback__onFailed = NULL; +jmethodID _m_EmojiCompat__process = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__onFailed(jobject self_, jobject throwable) { +JniResult EmojiCompat__process(jobject self_, jobject charSequence) { load_env(); - load_class_global_ref(&_c_EmojiCompat_InitCallback, - "androidx/emoji2/text/EmojiCompat$InitCallback"); - if (_c_EmojiCompat_InitCallback == NULL) + 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_InitCallback, - &_m_EmojiCompat_InitCallback__onFailed, "onFailed", - "(Ljava/lang/Throwable;)V"); - if (_m_EmojiCompat_InitCallback__onFailed == NULL) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_EmojiCompat_InitCallback__onFailed, throwable); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat__process, charSequence); + return to_global_ref_result(_result); } -// androidx.emoji2.text.EmojiCompat$DefaultSpanFactory -jclass _c_EmojiCompat_DefaultSpanFactory = NULL; - -jmethodID _m_EmojiCompat_DefaultSpanFactory__new0 = NULL; +jmethodID _m_EmojiCompat__process1 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_DefaultSpanFactory__new0() { +JniResult EmojiCompat__process1(jobject self_, + jobject charSequence, + int32_t start, + int32_t end) { load_env(); - load_class_global_ref(&_c_EmojiCompat_DefaultSpanFactory, - "androidx/emoji2/text/EmojiCompat$DefaultSpanFactory"); - if (_c_EmojiCompat_DefaultSpanFactory == NULL) + 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_DefaultSpanFactory, - &_m_EmojiCompat_DefaultSpanFactory__new0, "", "()V"); - if (_m_EmojiCompat_DefaultSpanFactory__new0 == NULL) + 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)->NewObject(jniEnv, _c_EmojiCompat_DefaultSpanFactory, - _m_EmojiCompat_DefaultSpanFactory__new0); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat__process1, charSequence, start, end); return to_global_ref_result(_result); } -jmethodID _m_EmojiCompat_DefaultSpanFactory__createSpan = NULL; +jmethodID _m_EmojiCompat__process2 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_DefaultSpanFactory__createSpan(jobject self_, - jobject rasterizer) { +JniResult EmojiCompat__process2(jobject self_, + jobject charSequence, + int32_t start, + int32_t end, + int32_t maxEmojiCount) { load_env(); - load_class_global_ref(&_c_EmojiCompat_DefaultSpanFactory, - "androidx/emoji2/text/EmojiCompat$DefaultSpanFactory"); - if (_c_EmojiCompat_DefaultSpanFactory == NULL) + 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_DefaultSpanFactory, - &_m_EmojiCompat_DefaultSpanFactory__createSpan, "createSpan", - "(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/" - "emoji2/text/EmojiSpan;"); - if (_m_EmojiCompat_DefaultSpanFactory__createSpan == NULL) + 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_DefaultSpanFactory__createSpan, rasterizer); + jobject _result = + (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_EmojiCompat__process2, + charSequence, start, end, maxEmojiCount); return to_global_ref_result(_result); } -// androidx.emoji2.text.EmojiCompat$SpanFactory -jclass _c_EmojiCompat_SpanFactory = NULL; - -jmethodID _m_EmojiCompat_SpanFactory__createSpan = NULL; +jmethodID _m_EmojiCompat__process3 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_SpanFactory__createSpan(jobject self_, - jobject rasterizer) { +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_SpanFactory, - "androidx/emoji2/text/EmojiCompat$SpanFactory"); - if (_c_EmojiCompat_SpanFactory == NULL) + 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_SpanFactory, - &_m_EmojiCompat_SpanFactory__createSpan, "createSpan", - "(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/" - "emoji2/text/EmojiSpan;"); - if (_m_EmojiCompat_SpanFactory__createSpan == NULL) + 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_SpanFactory__createSpan, rasterizer); + jniEnv, self_, _m_EmojiCompat__process3, charSequence, start, end, + maxEmojiCount, replaceStrategy); return to_global_ref_result(_result); } -// androidx.emoji2.text.DefaultEmojiCompatConfig -jclass _c_DefaultEmojiCompatConfig = NULL; - -jmethodID _m_DefaultEmojiCompatConfig__create = NULL; +jmethodID _m_EmojiCompat__getAssetSignature = NULL; FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig__create(jobject context) { +JniResult EmojiCompat__getAssetSignature(jobject self_) { load_env(); - load_class_global_ref(&_c_DefaultEmojiCompatConfig, - "androidx/emoji2/text/DefaultEmojiCompatConfig"); - if (_c_DefaultEmojiCompatConfig == NULL) + 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_DefaultEmojiCompatConfig, - &_m_DefaultEmojiCompatConfig__create, "create", - "(Landroid/content/Context;)Landroidx/emoji2/text/" - "FontRequestEmojiCompatConfig;"); - if (_m_DefaultEmojiCompatConfig__create == NULL) + 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)->CallStaticObjectMethod( - jniEnv, _c_DefaultEmojiCompatConfig, _m_DefaultEmojiCompatConfig__create, - context); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_EmojiCompat__getAssetSignature); 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; +jmethodID _m_EmojiCompat__updateEditorInfo = NULL; FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0() { +JniResult EmojiCompat__updateEditorInfo(jobject self_, jobject outAttrs) { load_env(); - load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 == NULL) + 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_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0, - "", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0 == - NULL) + 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()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_EmojiCompat__updateEditorInfo, + outAttrs); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1 = - NULL; +jfieldID _f_EmojiCompat__EDITOR_INFO_METAVERSION_KEY = NULL; FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1( - jobject self_, - jobject packageManager, - jobject providerPackage) { +JniResult get_EmojiCompat__EDITOR_INFO_METAVERSION_KEY() { 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) + load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); + if (_c_EmojiCompat == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__getSigningSignatures1, - packageManager, providerPackage); + 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); } -// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 -jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 = NULL; - -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0 = - NULL; +jfieldID _f_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY = NULL; FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0() { +JniResult get_EmojiCompat__EDITOR_INFO_REPLACE_ALL_KEY() { 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) + load_class_global_ref(&_c_EmojiCompat, "androidx/emoji2/text/EmojiCompat"); + if (_c_EmojiCompat == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0); + 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); } -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders = - NULL; +// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory +jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory = NULL; + +jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0 = + NULL; FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders( - jobject self_, - jobject packageManager, - jobject intent, - int32_t flags) { +JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0( + jobject helper) { load_env(); load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, + &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == NULL) + "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); + if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory == 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) + _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)->CallObjectMethod( - jniEnv, self_, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders, - packageManager, intent, flags); + jobject _result = (*jniEnv)->NewObject( + jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0, + helper); return to_global_ref_result(_result); } -jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo = - NULL; +jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create = + NULL; FFI_PLUGIN_EXPORT -JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__getProviderInfo( +JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create( jobject self_, - jobject resolveInfo) { + jobject context) { load_env(); load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, + &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == NULL) + "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); + if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory == 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 == + _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_DefaultEmojiCompatConfigHelper_API19__getProviderInfo, - resolveInfo); + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create, + context); return to_global_ref_result(_result); } @@ -1324,60 +1192,178 @@ DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__getProviderInfo( return to_global_ref_result(_result); } -// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory -jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory = NULL; +// androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 +jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 = NULL; -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0 = - NULL; +jmethodID + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0 = + NULL; FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0( - jobject helper) { +JniResult +DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0() { load_env(); load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, + &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory == NULL) + "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); + if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == 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) + _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_DefaultEmojiCompatConfigFactory, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0, - helper); + jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0); return to_global_ref_result(_result); } -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create = - NULL; +jmethodID + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders = + NULL; FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__create( +JniResult +DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__queryIntentContentProviders( jobject self_, - jobject context) { + jobject packageManager, + jobject intent, + int32_t flags) { load_env(); load_class_global_ref( - &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, + &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, "androidx/emoji2/text/" - "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory"); - if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory == NULL) + "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19"); + if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 == 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 == + _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_DefaultEmojiCompatConfigFactory__create, + _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); } @@ -2570,3 +2556,26 @@ JniResult HashMap__clone(jobject self_) { (*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/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/Main.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/Main.java index 0077fd71e4..3def0063fd 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/Main.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/Main.java @@ -15,10 +15,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; +import java.util.*; import javax.tools.DocumentationTool; import javax.tools.JavaFileObject; import javax.tools.ToolProvider; @@ -36,7 +33,7 @@ public enum Backend { static SummarizerOptions options; - public static List runDocletWithClass( + public static Map runDocletWithClass( DocumentationTool javaDoc, Class docletClass, List fileObjects, @@ -58,7 +55,7 @@ public static List runDocletWithClass( return SummarizerDoclet.getClasses(); } - public static List runDoclet( + public static Map runDoclet( DocumentationTool javaDoc, List javaFileObjects, SummarizerOptions options) { return runDocletWithClass(javaDoc, SummarizerDoclet.class, javaFileObjects, options); } @@ -96,26 +93,14 @@ public static void main(String[] args) throws FileNotFoundException { sourceClasses, sourcePaths, javaDoc.getStandardFileManager(null, null, null)); } - // remove found classes from binaryClasses, so that they don't need to be searched again. - // TODO: Tidy up this logic, move to ClassFinder class - for (var qualifiedName : options.args) { - if (sourceClasses.get(qualifiedName) != null) { - binaryClasses.remove(qualifiedName); - } - } - if (options.backend != Backend.DOCLET) { ClassFinder.findJavaClasses(binaryClasses, classPaths); } - // remove duplicates (found as both source & binary), and determine if any class is not found. var notFound = new ArrayList(); for (var qualifiedName : options.args) { var foundSource = sourceClasses.get(qualifiedName) != null; var foundBinary = binaryClasses.get(qualifiedName) != null; - if (foundSource) { - binaryClasses.remove(qualifiedName); - } if (!foundBinary && !foundSource) { notFound.add(qualifiedName); } @@ -131,20 +116,22 @@ public static void main(String[] args) throws FileNotFoundException { switch (options.backend) { case DOCLET: - JsonWriter.writeJSON(runDoclet(javaDoc, sourceFiles, options), output); + JsonWriter.writeJSON(runDoclet(javaDoc, sourceFiles, options).values(), output); break; case ASM: - JsonWriter.writeJSON(AsmSummarizer.run(classStreamProviders), output); + JsonWriter.writeJSON(AsmSummarizer.run(classStreamProviders).values(), output); break; case AUTO: - List decls = new ArrayList<>(); - if (!sourceFiles.isEmpty()) { - decls.addAll(runDoclet(javaDoc, sourceFiles, options)); - } + Map classes = new LinkedHashMap<>(); + // Preferring DOCLET as the source of summary a class exists in + // both ASM and DOCLET. if (!classStreamProviders.isEmpty()) { - decls.addAll(AsmSummarizer.run(classStreamProviders)); + classes.putAll(AsmSummarizer.run(classStreamProviders)); + } + if (!sourceFiles.isEmpty()) { + classes.putAll(runDoclet(javaDoc, sourceFiles, options)); } - JsonWriter.writeJSON(decls, output); + JsonWriter.writeJSON(classes.values(), output); break; } } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java index d5a730b479..d979b4e328 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java @@ -10,7 +10,6 @@ import com.github.dart_lang.jnigen.apisummarizer.util.SkipException; import com.github.dart_lang.jnigen.apisummarizer.util.StreamUtil; import java.util.*; -import java.util.stream.Collectors; import org.objectweb.asm.*; import org.objectweb.asm.signature.SignatureReader; @@ -23,11 +22,11 @@ private static Param param( return param; } - public List getVisited() { + public Map getVisited() { return visited; } - List visited = new ArrayList<>(); + Map visited = new LinkedHashMap<>(); Stack visiting = new Stack<>(); /// Actual access for the inner classes as originally defined. @@ -64,14 +63,11 @@ public void visit( public void visitInnerClass(String name, String outerName, String innerName, int access) { var binaryName = name.replace('/', '.'); actualAccess.put(binaryName, access); - var alreadyVisitedInnerClass = - visited.stream() - .filter(decl -> decl.binaryName.equals(binaryName)) - .collect(Collectors.toList()); - // If the order of visit is outer first inner second. - // We still want to correct the modifiers. - if (!alreadyVisitedInnerClass.isEmpty()) { - alreadyVisitedInnerClass.get(0).modifiers = TypeUtils.access(access); + + if (visited.containsKey(binaryName)) { + // If the order of visit is outerClass-first, innerClass-second then only + // correct the modifiers. + visited.get(binaryName).modifiers = TypeUtils.access(access); } } @@ -159,7 +155,8 @@ public AnnotationVisitor visitTypeAnnotation( @Override public void visitEnd() { - visited.add(popVisiting()); + var classToAdd = popVisiting(); + visited.put(classToAdd.binaryName, classToAdd); } private ClassDecl peekVisiting() { diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmSummarizer.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmSummarizer.java index 485c442682..4d7417e93f 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmSummarizer.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmSummarizer.java @@ -9,11 +9,12 @@ import com.github.dart_lang.jnigen.apisummarizer.elements.ClassDecl; import com.github.dart_lang.jnigen.apisummarizer.util.InputStreamProvider; import java.util.List; +import java.util.Map; import org.objectweb.asm.ClassReader; public class AsmSummarizer { - public static List run(List inputProviders) { + public static Map run(List inputProviders) { var visitor = new AsmClassVisitor(); for (var provider : inputProviders) { var inputStream = provider.getInputStream(); diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/SummarizerDoclet.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/SummarizerDoclet.java index abbc7cc653..7e87444e8e 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/SummarizerDoclet.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/SummarizerDoclet.java @@ -38,11 +38,11 @@ public SourceVersion getSupportedSourceVersion() { return SourceVersion.RELEASE_11; } - public static List getClasses() { + public static Map getClasses() { return classes; } - public static List classes; + public static Map classes; @Override public boolean run(DocletEnvironment docletEnvironment) { @@ -62,7 +62,7 @@ public static class SummaryCollector { public class SummarizingScanner extends ElementScanner9 { List packages = new ArrayList<>(); - List types = new ArrayList<>(); + Map types = new LinkedHashMap<>(); ElementBuilders builders = new ElementBuilders(utils); // Each element in collector is a stack @@ -100,7 +100,8 @@ public Void visitType(TypeElement e, SummaryCollector collector) { var cls = builders.classDecl(e); collector.types.push(cls); super.visitType(e, collector); - types.add(collector.types.pop()); + var puttingClass = collector.types.pop(); + types.put(puttingClass.binaryName, puttingClass); } catch (SkipException skip) { Log.info("Skip type: %s", e.getQualifiedName()); } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/ClassFinder.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/ClassFinder.java index 23c1ca5346..89d7f307a6 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/ClassFinder.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/ClassFinder.java @@ -63,7 +63,6 @@ public static Optional> findClassAndChildren( classes.add(fqnWithSlashesSuffix); return Optional.of(classes); } - // consider fqnWithSlashes as a directory List children = entries.tailSet(fqnWithSlashesSlash).stream() @@ -77,9 +76,9 @@ public static Optional> findClassAndChildren( } public static void findFilesInPath( + Map> classes, String searchLocation, String suffix, - Map> classes, Function, List> mapper) { Path searchPath = Path.of(searchLocation); @@ -142,7 +141,7 @@ public static void find( for (var searchPath : searchPaths) { File searchFile = new File(searchPath); if (searchFile.isDirectory()) { - findFilesInPath(searchPath, suffix, classes, fileMapper); + findFilesInPath(classes, searchPath, suffix, fileMapper); } else if (searchFile.isFile() && searchPath.endsWith(".jar")) { var jarFile = wrapCheckedException(JarFile::new, searchPath); var useful = findFilesInJar(classes, jarFile, suffix, entryMapper); diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/JsonWriter.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/JsonWriter.java index 112e241f7e..543499b8e0 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/JsonWriter.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/util/JsonWriter.java @@ -6,10 +6,10 @@ import com.github.dart_lang.jnigen.apisummarizer.elements.ClassDecl; import java.io.IOException; import java.io.OutputStream; -import java.util.List; +import java.util.Collection; public class JsonWriter { - public static void writeJSON(List classes, OutputStream output) { + public static void writeJSON(Collection classes, OutputStream output) { var mapper = new ObjectMapper(); Log.info("Writing JSON for %d classes", classes.size()); mapper.enable(SerializationFeature.INDENT_OUTPUT); diff --git a/pkgs/jnigen/lib/src/summary/summary.dart b/pkgs/jnigen/lib/src/summary/summary.dart index 170627582b..25f932d2fd 100644 --- a/pkgs/jnigen/lib/src/summary/summary.dart +++ b/pkgs/jnigen/lib/src/summary/summary.dart @@ -189,7 +189,6 @@ Future getSummary(Config config) async { if (json == null) { throw SummaryParseException('Expected JSON element from summarizer.'); } - final list = json as List; - final classes = Classes.fromJson(list); + final classes = Classes.fromJson(json); return classes; } 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 index 11bc5da430..5989a3f691 100644 --- 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 @@ -32,6 +32,114 @@ void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { 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; @@ -1466,114 +1574,154 @@ JniResult get_JsonFactory__DEFAULT_ROOT_VALUE_SEPARATOR() { return to_global_ref_result(_result); } -// com.fasterxml.jackson.core.JsonFactory$Feature -jclass _c_JsonFactory_Feature = NULL; +// com.fasterxml.jackson.core.JsonParser$Feature +jclass _c_JsonParser_Feature = NULL; -jmethodID _m_JsonFactory_Feature__values = NULL; +jmethodID _m_JsonParser_Feature__values = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__values() { +JniResult JsonParser_Feature__values() { load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) + 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_JsonFactory_Feature, &_m_JsonFactory_Feature__values, + load_static_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__values, "values", - "()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); - if (_m_JsonFactory_Feature__values == NULL) + "()[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_JsonFactory_Feature, _m_JsonFactory_Feature__values); + jniEnv, _c_JsonParser_Feature, _m_JsonParser_Feature__values); return to_global_ref_result(_result); } -jmethodID _m_JsonFactory_Feature__valueOf = NULL; +jmethodID _m_JsonParser_Feature__valueOf = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__valueOf(jobject name) { +JniResult JsonParser_Feature__valueOf(jobject name) { load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) + 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_JsonFactory_Feature, &_m_JsonFactory_Feature__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); - if (_m_JsonFactory_Feature__valueOf == NULL) + _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_JsonFactory_Feature, _m_JsonFactory_Feature__valueOf, name); + jniEnv, _c_JsonParser_Feature, _m_JsonParser_Feature__valueOf, name); return to_global_ref_result(_result); } -jmethodID _m_JsonFactory_Feature__collectDefaults = NULL; +jmethodID _m_JsonParser_Feature__collectDefaults = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__collectDefaults() { +JniResult JsonParser_Feature__collectDefaults() { load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) + 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_JsonFactory_Feature, - &_m_JsonFactory_Feature__collectDefaults, - "collectDefaults", "()I"); - if (_m_JsonFactory_Feature__collectDefaults == NULL) + 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_JsonFactory_Feature, _m_JsonFactory_Feature__collectDefaults); + jniEnv, _c_JsonParser_Feature, _m_JsonParser_Feature__collectDefaults); return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -jmethodID _m_JsonFactory_Feature__enabledByDefault = NULL; +jmethodID _m_JsonParser_Feature__enabledByDefault = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__enabledByDefault(jobject self_) { +JniResult JsonParser_Feature__enabledByDefault(jobject self_) { load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) + 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_JsonFactory_Feature, &_m_JsonFactory_Feature__enabledByDefault, + load_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__enabledByDefault, "enabledByDefault", "()Z"); - if (_m_JsonFactory_Feature__enabledByDefault == NULL) + if (_m_JsonParser_Feature__enabledByDefault == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory_Feature__enabledByDefault); + jniEnv, self_, _m_JsonParser_Feature__enabledByDefault); return (JniResult){.value = {.z = _result}, .exception = check_exception()}; } -jmethodID _m_JsonFactory_Feature__enabledIn = NULL; +jmethodID _m_JsonParser_Feature__enabledIn = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__enabledIn(jobject self_, int32_t flags) { +JniResult JsonParser_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) + 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_JsonFactory_Feature, &_m_JsonFactory_Feature__enabledIn, + load_method(_c_JsonParser_Feature, &_m_JsonParser_Feature__enabledIn, "enabledIn", "(I)Z"); - if (_m_JsonFactory_Feature__enabledIn == NULL) + if (_m_JsonParser_Feature__enabledIn == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; uint8_t _result = (*jniEnv)->CallBooleanMethod( - jniEnv, self_, _m_JsonFactory_Feature__enabledIn, flags); + jniEnv, self_, _m_JsonParser_Feature__enabledIn, flags); return (JniResult){.value = {.z = _result}, .exception = check_exception()}; } -jmethodID _m_JsonFactory_Feature__getMask = NULL; +jmethodID _m_JsonParser_Feature__getMask = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory_Feature__getMask(jobject self_) { +JniResult JsonParser_Feature__getMask(jobject self_) { load_env(); - load_class_global_ref(&_c_JsonFactory_Feature, - "com/fasterxml/jackson/core/JsonFactory$Feature"); - if (_c_JsonFactory_Feature == NULL) + 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_JsonFactory_Feature, &_m_JsonFactory_Feature__getMask, - "getMask", "()I"); - if (_m_JsonFactory_Feature__getMask == NULL) + 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_JsonFactory_Feature__getMask); + (*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; @@ -3422,154 +3570,6 @@ JniResult get_JsonParser__DEFAULT_READ_CAPABILITIES() { 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.JsonToken jclass _c_JsonToken = NULL; 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 index beb1dd5aec..6d5ff7a765 100644 --- 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 @@ -42,6 +42,123 @@ 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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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 const jni.JArrayType($JsonFactory_FeatureType()) + .fromRef(_values().object); + } + + 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 const $JsonFactory_FeatureType() + .fromRef(_valueOf(name.reference).object); + } + + 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)>>( + "JsonFactory_Feature__enabledByDefault") + .asFunction)>(); + + /// from: public boolean enabledByDefault() + bool enabledByDefault() { + return _enabledByDefault(reference).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, flags).boolean; + } + + static final _getMask = jniLookup< + ffi + .NativeFunction)>>( + "JsonFactory_Feature__getMask") + .asFunction)>(); + + /// from: public int getMask() + int getMask() { + return _getMask(reference).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 fromRef(jni.JObjectPtr ref) => + JsonFactory_Feature.fromRef(ref); + + @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 @@ -1884,120 +2001,3 @@ final class $JsonFactoryType extends jni.JObjType { return other.runtimeType == ($JsonFactoryType) && other is $JsonFactoryType; } } - -/// 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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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 const jni.JArrayType($JsonFactory_FeatureType()) - .fromRef(_values().object); - } - - 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 const $JsonFactory_FeatureType() - .fromRef(_valueOf(name.reference).object); - } - - 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)>>( - "JsonFactory_Feature__enabledByDefault") - .asFunction)>(); - - /// from: public boolean enabledByDefault() - bool enabledByDefault() { - return _enabledByDefault(reference).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, flags).boolean; - } - - static final _getMask = jniLookup< - ffi - .NativeFunction)>>( - "JsonFactory_Feature__getMask") - .asFunction)>(); - - /// from: public int getMask() - int getMask() { - return _getMask(reference).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 fromRef(jni.JObjectPtr ref) => - JsonFactory_Feature.fromRef(ref); - - @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; - } -} 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 index 4a1863df4b..ea47c4cec2 100644 --- 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 @@ -42,6 +42,191 @@ 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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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 const jni.JArrayType($JsonParser_FeatureType()) + .fromRef(_values().object); + } + + 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 const $JsonParser_FeatureType() + .fromRef(_valueOf(name.reference).object); + } + + 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)>>( + "JsonParser_Feature__enabledByDefault") + .asFunction)>(); + + /// from: public boolean enabledByDefault() + bool enabledByDefault() { + return _enabledByDefault(reference).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, flags).boolean; + } + + static final _getMask = jniLookup< + ffi + .NativeFunction)>>( + "JsonParser_Feature__getMask") + .asFunction)>(); + + /// from: public int getMask() + int getMask() { + return _getMask(reference).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 fromRef(jni.JObjectPtr ref) => + JsonParser_Feature.fromRef(ref); + + @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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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 const jni.JArrayType($JsonParser_NumberTypeType()) + .fromRef(_values().object); + } + + 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 const $JsonParser_NumberTypeType() + .fromRef(_valueOf(name.reference).object); + } +} + +final class $JsonParser_NumberTypeType + extends jni.JObjType { + const $JsonParser_NumberTypeType(); + + @override + String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$NumberType;"; + + @override + JsonParser_NumberType fromRef(jni.JObjectPtr ref) => + JsonParser_NumberType.fromRef(ref); + + @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. @@ -2660,188 +2845,3 @@ final class $JsonParserType extends jni.JObjType { return other.runtimeType == ($JsonParserType) && other is $JsonParserType; } } - -/// 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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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 const jni.JArrayType($JsonParser_FeatureType()) - .fromRef(_values().object); - } - - 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 const $JsonParser_FeatureType() - .fromRef(_valueOf(name.reference).object); - } - - 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)>>( - "JsonParser_Feature__enabledByDefault") - .asFunction)>(); - - /// from: public boolean enabledByDefault() - bool enabledByDefault() { - return _enabledByDefault(reference).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, flags).boolean; - } - - static final _getMask = jniLookup< - ffi - .NativeFunction)>>( - "JsonParser_Feature__getMask") - .asFunction)>(); - - /// from: public int getMask() - int getMask() { - return _getMask(reference).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 fromRef(jni.JObjectPtr ref) => - JsonParser_Feature.fromRef(ref); - - @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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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 const jni.JArrayType($JsonParser_NumberTypeType()) - .fromRef(_values().object); - } - - 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 const $JsonParser_NumberTypeType() - .fromRef(_valueOf(name.reference).object); - } -} - -final class $JsonParser_NumberTypeType - extends jni.JObjType { - const $JsonParser_NumberTypeType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$NumberType;"; - - @override - JsonParser_NumberType fromRef(jni.JObjectPtr ref) => - JsonParser_NumberType.fromRef(ref); - - @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; - } -} 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/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart index aa0264e1a4..e1f2bbe954 100644 --- 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/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -41,6 +41,120 @@ import "package:jni/jni.dart" as jni; import "JsonParser.dart" as jsonparser_; +/// 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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = + jni.Jni.findJClass(r"com/fasterxml/jackson/core/JsonFactory$Feature"); + + /// The type which includes information such as the signature of this class. + static const type = $JsonFactory_FeatureType(); + static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"values", + r"()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); + + /// 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 const jni.JArrayType($JsonFactory_FeatureType()).fromRef( + jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, + jni.JniCallType.objectType, []).object); + } + + static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"valueOf", + r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); + + /// 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 const $JsonFactory_FeatureType().fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_valueOf, + jni.JniCallType.objectType, [name.reference]).object); + } + + static final _id_collectDefaults = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"collectDefaults", r"()I"); + + /// 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 jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, + _id_collectDefaults, jni.JniCallType.intType, []).integer; + } + + static final _id_enabledByDefault = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"enabledByDefault", r"()Z"); + + /// from: public boolean enabledByDefault() + bool enabledByDefault() { + return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledByDefault, + jni.JniCallType.booleanType, []).boolean; + } + + static final _id_enabledIn = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"enabledIn", r"(I)Z"); + + /// from: public boolean enabledIn(int flags) + bool enabledIn( + int flags, + ) { + return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledIn, + jni.JniCallType.booleanType, [jni.JValueInt(flags)]).boolean; + } + + static final _id_getMask = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"getMask", r"()I"); + + /// from: public int getMask() + int getMask() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_getMask, jni.JniCallType.intType, []).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 fromRef(jni.JObjectPtr ref) => + JsonFactory_Feature.fromRef(ref); + + @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 @@ -1790,117 +1904,3 @@ final class $JsonFactoryType extends jni.JObjType { return other.runtimeType == ($JsonFactoryType) && other is $JsonFactoryType; } } - -/// 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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/fasterxml/jackson/core/JsonFactory$Feature"); - - /// The type which includes information such as the signature of this class. - static const type = $JsonFactory_FeatureType(); - static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"values", - r"()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); - - /// 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 const jni.JArrayType($JsonFactory_FeatureType()).fromRef( - jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, - jni.JniCallType.objectType, []).object); - } - - static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"valueOf", - r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); - - /// 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 const $JsonFactory_FeatureType().fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_valueOf, - jni.JniCallType.objectType, [name.reference]).object); - } - - static final _id_collectDefaults = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"collectDefaults", r"()I"); - - /// 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 jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, - _id_collectDefaults, jni.JniCallType.intType, []).integer; - } - - static final _id_enabledByDefault = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"enabledByDefault", r"()Z"); - - /// from: public boolean enabledByDefault() - bool enabledByDefault() { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledByDefault, - jni.JniCallType.booleanType, []).boolean; - } - - static final _id_enabledIn = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"enabledIn", r"(I)Z"); - - /// from: public boolean enabledIn(int flags) - bool enabledIn( - int flags, - ) { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledIn, - jni.JniCallType.booleanType, [jni.JValueInt(flags)]).boolean; - } - - static final _id_getMask = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"getMask", r"()I"); - - /// from: public int getMask() - int getMask() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_getMask, jni.JniCallType.intType, []).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 fromRef(jni.JObjectPtr ref) => - JsonFactory_Feature.fromRef(ref); - - @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; - } -} 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/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart index 2c27eccdbe..ae8f7aa7c4 100644 --- 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/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -41,6 +41,192 @@ import "package:jni/jni.dart" as jni; import "JsonToken.dart" as jsontoken_; +/// 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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = + jni.Jni.findJClass(r"com/fasterxml/jackson/core/JsonParser$Feature"); + + /// The type which includes information such as the signature of this class. + static const type = $JsonParser_FeatureType(); + static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"values", + r"()[Lcom/fasterxml/jackson/core/JsonParser$Feature;"); + + /// 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 const jni.JArrayType($JsonParser_FeatureType()).fromRef( + jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, + jni.JniCallType.objectType, []).object); + } + + static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"valueOf", + r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$Feature;"); + + /// 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 const $JsonParser_FeatureType().fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_valueOf, + jni.JniCallType.objectType, [name.reference]).object); + } + + static final _id_collectDefaults = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"collectDefaults", r"()I"); + + /// 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 jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, + _id_collectDefaults, jni.JniCallType.intType, []).integer; + } + + static final _id_enabledByDefault = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"enabledByDefault", r"()Z"); + + /// from: public boolean enabledByDefault() + bool enabledByDefault() { + return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledByDefault, + jni.JniCallType.booleanType, []).boolean; + } + + static final _id_enabledIn = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"enabledIn", r"(I)Z"); + + /// from: public boolean enabledIn(int flags) + bool enabledIn( + int flags, + ) { + return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledIn, + jni.JniCallType.booleanType, [jni.JValueInt(flags)]).boolean; + } + + static final _id_getMask = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"getMask", r"()I"); + + /// from: public int getMask() + int getMask() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_getMask, jni.JniCallType.intType, []).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 fromRef(jni.JObjectPtr ref) => + JsonParser_Feature.fromRef(ref); + + @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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = + jni.Jni.findJClass(r"com/fasterxml/jackson/core/JsonParser$NumberType"); + + /// The type which includes information such as the signature of this class. + static const type = $JsonParser_NumberTypeType(); + static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"values", + r"()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); + + /// 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 const jni.JArrayType($JsonParser_NumberTypeType()).fromRef( + jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, + jni.JniCallType.objectType, []).object); + } + + static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"valueOf", + r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); + + /// 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 const $JsonParser_NumberTypeType().fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_valueOf, + jni.JniCallType.objectType, [name.reference]).object); + } +} + +final class $JsonParser_NumberTypeType + extends jni.JObjType { + const $JsonParser_NumberTypeType(); + + @override + String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$NumberType;"; + + @override + JsonParser_NumberType fromRef(jni.JObjectPtr ref) => + JsonParser_NumberType.fromRef(ref); + + @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. @@ -2513,189 +2699,3 @@ final class $JsonParserType extends jni.JObjType { return other.runtimeType == ($JsonParserType) && other is $JsonParserType; } } - -/// 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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/fasterxml/jackson/core/JsonParser$Feature"); - - /// The type which includes information such as the signature of this class. - static const type = $JsonParser_FeatureType(); - static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"values", - r"()[Lcom/fasterxml/jackson/core/JsonParser$Feature;"); - - /// 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 const jni.JArrayType($JsonParser_FeatureType()).fromRef( - jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, - jni.JniCallType.objectType, []).object); - } - - static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"valueOf", - r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$Feature;"); - - /// 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 const $JsonParser_FeatureType().fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_valueOf, - jni.JniCallType.objectType, [name.reference]).object); - } - - static final _id_collectDefaults = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"collectDefaults", r"()I"); - - /// 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 jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, - _id_collectDefaults, jni.JniCallType.intType, []).integer; - } - - static final _id_enabledByDefault = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"enabledByDefault", r"()Z"); - - /// from: public boolean enabledByDefault() - bool enabledByDefault() { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledByDefault, - jni.JniCallType.booleanType, []).boolean; - } - - static final _id_enabledIn = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"enabledIn", r"(I)Z"); - - /// from: public boolean enabledIn(int flags) - bool enabledIn( - int flags, - ) { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_enabledIn, - jni.JniCallType.booleanType, [jni.JValueInt(flags)]).boolean; - } - - static final _id_getMask = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"getMask", r"()I"); - - /// from: public int getMask() - int getMask() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_getMask, jni.JniCallType.intType, []).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 fromRef(jni.JObjectPtr ref) => - JsonParser_Feature.fromRef(ref); - - @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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/fasterxml/jackson/core/JsonParser$NumberType"); - - /// The type which includes information such as the signature of this class. - static const type = $JsonParser_NumberTypeType(); - static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"values", - r"()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); - - /// 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 const jni.JArrayType($JsonParser_NumberTypeType()).fromRef( - jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, - jni.JniCallType.objectType, []).object); - } - - static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"valueOf", - r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); - - /// 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 const $JsonParser_NumberTypeType().fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_valueOf, - jni.JniCallType.objectType, [name.reference]).object); - } -} - -final class $JsonParser_NumberTypeType - extends jni.JObjType { - const $JsonParser_NumberTypeType(); - - @override - String get signature => r"Lcom/fasterxml/jackson/core/JsonParser$NumberType;"; - - @override - JsonParser_NumberType fromRef(jni.JObjectPtr ref) => - JsonParser_NumberType.fromRef(ref); - - @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; - } -} 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 index f1fee4e2a5..54d6b884dd 100644 --- 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 @@ -19,44 +19,186 @@ void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) { env_getter = eg; } -// com.github.dart_lang.jnigen.simple_package.Color -jclass _c_Color = NULL; +// com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice +jclass _c_Example_Nested_NestedTwice = NULL; -jmethodID _m_Color__values = NULL; +jmethodID _m_Example_Nested_NestedTwice__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Color__values() { +JniResult Example_Nested_NestedTwice__new0() { load_env(); - load_class_global_ref(&_c_Color, - "com/github/dart_lang/jnigen/simple_package/Color"); - if (_c_Color == NULL) + 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_method(_c_Color, &_m_Color__values, "values", - "()[Lcom/github/dart_lang/jnigen/simple_package/Color;"); - if (_m_Color__values == NULL) + 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)->CallStaticObjectMethod(jniEnv, _c_Color, _m_Color__values); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example_Nested_NestedTwice, + _m_Example_Nested_NestedTwice__new0); return to_global_ref_result(_result); } -jmethodID _m_Color__valueOf = NULL; +jfieldID _f_Example_Nested_NestedTwice__ZERO = NULL; FFI_PLUGIN_EXPORT -JniResult Color__valueOf(jobject name) { +JniResult get_Example_Nested_NestedTwice__ZERO() { load_env(); - load_class_global_ref(&_c_Color, - "com/github/dart_lang/jnigen/simple_package/Color"); - if (_c_Color == NULL) + 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_method( - _c_Color, &_m_Color__valueOf, "valueOf", - "(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;"); - if (_m_Color__valueOf == NULL) + 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()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_Color, - _m_Color__valueOf, name); + 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; @@ -851,2119 +993,1999 @@ JniResult set_Example__protectedField(jobject self_, jobject value) { return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -// com.github.dart_lang.jnigen.simple_package.Example$Nested -jclass _c_Example_Nested = NULL; +// com.github.dart_lang.jnigen.pkg2.C2 +jclass _c_C2 = NULL; -jmethodID _m_Example_Nested__new0 = NULL; +jmethodID _m_C2__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example_Nested__new0(uint8_t value) { +JniResult C2__new0() { load_env(); - load_class_global_ref( - &_c_Example_Nested, - "com/github/dart_lang/jnigen/simple_package/Example$Nested"); - if (_c_Example_Nested == NULL) + 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_Example_Nested, &_m_Example_Nested__new0, "", "(Z)V"); - if (_m_Example_Nested__new0 == NULL) + 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_Example_Nested, - _m_Example_Nested__new0, value); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_C2, _m_C2__new0); return to_global_ref_result(_result); } -jmethodID _m_Example_Nested__usesAnonymousInnerClass = NULL; +jfieldID _f_C2__CONSTANT = NULL; FFI_PLUGIN_EXPORT -JniResult Example_Nested__usesAnonymousInnerClass(jobject self_) { +JniResult get_C2__CONSTANT() { 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) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_Example_Nested__usesAnonymousInnerClass); - 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()}; } -jmethodID _m_Example_Nested__getValue = NULL; FFI_PLUGIN_EXPORT -JniResult Example_Nested__getValue(jobject self_) { +JniResult set_C2__CONSTANT(int32_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__getValue, "getValue", - "()Z"); - if (_m_Example_Nested__getValue == NULL) + 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()}; - uint8_t _result = - (*jniEnv)->CallBooleanMethod(jniEnv, self_, _m_Example_Nested__getValue); - return (JniResult){.value = {.z = _result}, .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()}; } -jmethodID _m_Example_Nested__setValue = NULL; +// com.github.dart_lang.jnigen.pkg2.Example +jclass _c_Example1 = NULL; + +jmethodID _m_Example1__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example_Nested__setValue(jobject self_, uint8_t value) { +JniResult Example1__new0() { load_env(); - load_class_global_ref( - &_c_Example_Nested, - "com/github/dart_lang/jnigen/simple_package/Example$Nested"); - if (_c_Example_Nested == NULL) + 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_Example_Nested, &_m_Example_Nested__setValue, "setValue", - "(Z)V"); - if (_m_Example_Nested__setValue == NULL) + load_method(_c_Example1, &_m_Example1__new0, "", "()V"); + if (_m_Example1__new0 == 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()}; + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_Example1, _m_Example1__new0); + return to_global_ref_result(_result); } -// com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice -jclass _c_Example_Nested_NestedTwice = NULL; +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()}; +} -jmethodID _m_Example_Nested_NestedTwice__new0 = NULL; +// 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 Example_Nested_NestedTwice__new0() { +JniResult GrandParent_Parent_Child__new0(jobject _parent, jobject newValue) { 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) + &_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_Example_Nested_NestedTwice, - &_m_Example_Nested_NestedTwice__new0, "", "()V"); - if (_m_Example_Nested_NestedTwice__new0 == NULL) + 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_Example_Nested_NestedTwice, - _m_Example_Nested_NestedTwice__new0); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GrandParent_Parent_Child, + _m_GrandParent_Parent_Child__new0, + _parent, newValue); return to_global_ref_result(_result); } -jfieldID _f_Example_Nested_NestedTwice__ZERO = NULL; +jfieldID _f_GrandParent_Parent_Child__grandParentValue = NULL; FFI_PLUGIN_EXPORT -JniResult get_Example_Nested_NestedTwice__ZERO() { +JniResult get_GrandParent_Parent_Child__grandParentValue(jobject self_) { 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) + &_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_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()}; + 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_Example_Nested_NestedTwice__ZERO(int32_t value) { +JniResult set_GrandParent_Parent_Child__grandParentValue(jobject self_, + jobject 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) + &_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_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); + 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()}; } -// com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested -jclass _c_Example_NonStaticNested = NULL; - -jmethodID _m_Example_NonStaticNested__new0 = NULL; +jfieldID _f_GrandParent_Parent_Child__parentValue = NULL; FFI_PLUGIN_EXPORT -JniResult Example_NonStaticNested__new0(jobject _parent) { +JniResult get_GrandParent_Parent_Child__parentValue(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_method(_c_Example_NonStaticNested, &_m_Example_NonStaticNested__new0, - "", - "(Lcom/github/dart_lang/jnigen/simple_package/Example;)V"); - if (_m_Example_NonStaticNested__new0 == NULL) + &_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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example_NonStaticNested, - _m_Example_NonStaticNested__new0, _parent); + 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); } -jfieldID _f_Example_NonStaticNested__ok = NULL; FFI_PLUGIN_EXPORT -JniResult get_Example_NonStaticNested__ok(jobject self_) { +JniResult set_GrandParent_Parent_Child__parentValue(jobject self_, + jobject value) { load_env(); load_class_global_ref( - &_c_Example_NonStaticNested, - "com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested"); - if (_c_Example_NonStaticNested == NULL) + &_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_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()}; + 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 set_Example_NonStaticNested__ok(jobject self_, uint8_t value) { +JniResult get_GrandParent_Parent_Child__value(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) + &_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_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()}; + 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); } -// com.github.dart_lang.jnigen.simple_package.Exceptions -jclass _c_Exceptions = NULL; - -jmethodID _m_Exceptions__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__new0() { +JniResult set_GrandParent_Parent_Child__value(jobject self_, jobject value) { 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) + &_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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__new0); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_Exceptions__new1 = NULL; +// com.github.dart_lang.jnigen.generics.GrandParent$Parent +jclass _c_GrandParent_Parent = NULL; + +jmethodID _m_GrandParent_Parent__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__new1(float x) { +JniResult GrandParent_Parent__new0(jobject _parent, jobject newValue) { load_env(); load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) + &_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_Exceptions, &_m_Exceptions__new1, "", "(F)V"); - if (_m_Exceptions__new1 == NULL) + 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_Exceptions, _m_Exceptions__new1, x); + (*jniEnv)->NewObject(jniEnv, _c_GrandParent_Parent, + _m_GrandParent_Parent__new0, _parent, newValue); return to_global_ref_result(_result); } -jmethodID _m_Exceptions__new2 = NULL; +jfieldID _f_GrandParent_Parent__parentValue = 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) { +JniResult get_GrandParent_Parent__parentValue(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__new2, "", "(IIIIII)V"); - if (_m_Exceptions__new2 == NULL) + &_c_GrandParent_Parent, + "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); + if (_c_GrandParent_Parent == 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); + 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); } -jmethodID _m_Exceptions__staticObjectMethod = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__staticObjectMethod() { +JniResult set_GrandParent_Parent__parentValue(jobject self_, jobject value) { 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) + &_c_GrandParent_Parent, + "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); + if (_c_GrandParent_Parent == 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); + 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()}; } -jmethodID _m_Exceptions__staticIntMethod = NULL; +jfieldID _f_GrandParent_Parent__value = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__staticIntMethod() { +JniResult get_GrandParent_Parent__value(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_static_method(_c_Exceptions, &_m_Exceptions__staticIntMethod, - "staticIntMethod", "()I"); - if (_m_Exceptions__staticIntMethod == NULL) + &_c_GrandParent_Parent, + "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); + if (_c_GrandParent_Parent == 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()}; + 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); } -jmethodID _m_Exceptions__staticObjectArrayMethod = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__staticObjectArrayMethod() { +JniResult set_GrandParent_Parent__value(jobject self_, jobject value) { 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) + &_c_GrandParent_Parent, + "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); + if (_c_GrandParent_Parent == 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); + 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()}; } -jmethodID _m_Exceptions__staticIntArrayMethod = NULL; +// 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 Exceptions__staticIntArrayMethod() { +JniResult GrandParent_StaticParent_Child__new0(jobject _parent, + jobject parentValue, + jobject value) { load_env(); load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) + &_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_static_method(_c_Exceptions, &_m_Exceptions__staticIntArrayMethod, - "staticIntArrayMethod", "()[I"); - if (_m_Exceptions__staticIntArrayMethod == NULL) + 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)->CallStaticObjectMethod( - jniEnv, _c_Exceptions, _m_Exceptions__staticIntArrayMethod); + jobject _result = (*jniEnv)->NewObject( + jniEnv, _c_GrandParent_StaticParent_Child, + _m_GrandParent_StaticParent_Child__new0, _parent, parentValue, value); return to_global_ref_result(_result); } -jmethodID _m_Exceptions__objectMethod = NULL; +jfieldID _f_GrandParent_StaticParent_Child__parentValue = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__objectMethod(jobject self_) { +JniResult get_GrandParent_StaticParent_Child__parentValue(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) + &_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()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Exceptions__objectMethod); + 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); } -jmethodID _m_Exceptions__intMethod = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__intMethod(jobject self_) { +JniResult set_GrandParent_StaticParent_Child__parentValue(jobject self_, + jobject value) { 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) + &_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()}; - int32_t _result = - (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Exceptions__intMethod); - return (JniResult){.value = {.i = _result}, .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()}; } -jmethodID _m_Exceptions__objectArrayMethod = NULL; +jfieldID _f_GrandParent_StaticParent_Child__value = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__objectArrayMethod(jobject self_) { +JniResult get_GrandParent_StaticParent_Child__value(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) + &_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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Exceptions__objectArrayMethod); + 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); } -jmethodID _m_Exceptions__intArrayMethod = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__intArrayMethod(jobject self_) { +JniResult set_GrandParent_StaticParent_Child__value(jobject self_, + jobject value) { 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) + &_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()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Exceptions__intArrayMethod); - return to_global_ref_result(_result); + 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()}; } -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()}; -} +// com.github.dart_lang.jnigen.generics.GrandParent$StaticParent +jclass _c_GrandParent_StaticParent = NULL; -jmethodID _m_Exceptions__throwFileNotFoundException = NULL; +jmethodID _m_GrandParent_StaticParent__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__throwFileNotFoundException(jobject self_) { +JniResult GrandParent_StaticParent__new0(jobject value) { load_env(); load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) + &_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_Exceptions, &_m_Exceptions__throwFileNotFoundException, - "throwFileNotFoundException", "()Ljava/io/InputStream;"); - if (_m_Exceptions__throwFileNotFoundException == NULL) + 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)->CallObjectMethod( - jniEnv, self_, _m_Exceptions__throwFileNotFoundException); + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_GrandParent_StaticParent, + _m_GrandParent_StaticParent__new0, value); return to_global_ref_result(_result); } -jmethodID _m_Exceptions__throwClassCastException = NULL; +jfieldID _f_GrandParent_StaticParent__value = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__throwClassCastException(jobject self_) { +JniResult get_GrandParent_StaticParent__value(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) + &_c_GrandParent_StaticParent, + "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); + if (_c_GrandParent_StaticParent == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_Exceptions__throwClassCastException); + 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); } -jmethodID _m_Exceptions__throwArrayIndexException = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__throwArrayIndexException(jobject self_) { +JniResult set_GrandParent_StaticParent__value(jobject self_, jobject value) { 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) + &_c_GrandParent_StaticParent, + "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); + if (_c_GrandParent_StaticParent == 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()}; + 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()}; } -jmethodID _m_Exceptions__throwArithmeticException = NULL; +// com.github.dart_lang.jnigen.generics.GrandParent +jclass _c_GrandParent = NULL; + +jmethodID _m_GrandParent__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__throwArithmeticException(jobject self_) { +JniResult GrandParent__new0(jobject value) { load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) + 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_Exceptions, &_m_Exceptions__throwArithmeticException, - "throwArithmeticException", "()I"); - if (_m_Exceptions__throwArithmeticException == NULL) + load_method(_c_GrandParent, &_m_GrandParent__new0, "", + "(Ljava/lang/Object;)V"); + if (_m_GrandParent__new0 == 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()}; + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_GrandParent, _m_GrandParent__new0, value); + return to_global_ref_result(_result); } -jmethodID _m_Exceptions__throwLoremIpsum = NULL; +jmethodID _m_GrandParent__stringParent = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__throwLoremIpsum() { +JniResult GrandParent__stringParent(jobject self_) { load_env(); - load_class_global_ref( - &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); - if (_c_Exceptions == NULL) + 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_Exceptions, &_m_Exceptions__throwLoremIpsum, - "throwLoremIpsum", "()V"); - if (_m_Exceptions__throwLoremIpsum == NULL) + 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()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Exceptions, - _m_Exceptions__throwLoremIpsum); - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; + jobject _result = + (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_GrandParent__stringParent); + return to_global_ref_result(_result); } -// com.github.dart_lang.jnigen.simple_package.Fields -jclass _c_Fields = NULL; - -jmethodID _m_Fields__new0 = NULL; +jmethodID _m_GrandParent__varParent = NULL; FFI_PLUGIN_EXPORT -JniResult Fields__new0() { +JniResult GrandParent__varParent(jobject self_, jobject nestedValue) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_Fields, &_m_Fields__new0, "", "()V"); - if (_m_Fields__new0 == NULL) + 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)->NewObject(jniEnv, _c_Fields, _m_Fields__new0); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_GrandParent__varParent, nestedValue); return to_global_ref_result(_result); } -jfieldID _f_Fields__amount = NULL; +jmethodID _m_GrandParent__stringStaticParent = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__amount() { +JniResult GrandParent__stringStaticParent() { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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 set_Fields__amount(int32_t value) { +JniResult GrandParent__varStaticParent(jobject value) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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); } -jfieldID _f_Fields__pi = NULL; +jmethodID _m_GrandParent__staticParentWithSameType = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__pi() { +JniResult GrandParent__staticParentWithSameType(jobject self_) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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 set_Fields__pi(double value) { +JniResult get_GrandParent__value(jobject self_) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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); } -jfieldID _f_Fields__asterisk = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__asterisk() { +JniResult set_GrandParent__value(jobject self_, jobject value) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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 set_Fields__asterisk(uint16_t value) { +JniResult MyMap_MyEntry__new0(jobject _parent, jobject key, jobject value) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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_Fields__name = NULL; +jfieldID _f_MyMap_MyEntry__key = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__name() { +JniResult get_MyMap_MyEntry__key(jobject self_) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_static_field(_c_Fields, &_f_Fields__name, "name", "Ljava/lang/String;"); + load_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__key, "key", + "Ljava/lang/Object;"); jobject _result = - (*jniEnv)->GetStaticObjectField(jniEnv, _c_Fields, _f_Fields__name); + (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyMap_MyEntry__key); return to_global_ref_result(_result); } FFI_PLUGIN_EXPORT -JniResult set_Fields__name(jobject value) { +JniResult set_MyMap_MyEntry__key(jobject self_, jobject value) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_static_field(_c_Fields, &_f_Fields__name, "name", "Ljava/lang/String;"); - (*jniEnv)->SetStaticObjectField(jniEnv, _c_Fields, _f_Fields__name, value); + 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_Fields__i = NULL; +jfieldID _f_MyMap_MyEntry__value = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__i(jobject self_) { +JniResult get_MyMap_MyEntry__value(jobject self_) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_Fields, &_f_Fields__i, "i", "Ljava/lang/Integer;"); - jobject _result = (*jniEnv)->GetObjectField(jniEnv, self_, _f_Fields__i); + 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_Fields__i(jobject self_, jobject value) { +JniResult set_MyMap_MyEntry__value(jobject self_, jobject value) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_Fields, &_f_Fields__i, "i", "Ljava/lang/Integer;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_Fields__i, value); + 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()}; } -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()}; -} +// com.github.dart_lang.jnigen.generics.MyMap +jclass _c_MyMap = NULL; +jmethodID _m_MyMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult set_Fields__trillion(jobject self_, int64_t value) { +JniResult MyMap__new0() { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_field(_c_Fields, &_f_Fields__trillion, "trillion", "J"); - (*jniEnv)->SetLongField(jniEnv, self_, _f_Fields__trillion, value); - 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); } -jfieldID _f_Fields__isAchillesDead = NULL; +jmethodID _m_MyMap__get0 = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__isAchillesDead(jobject self_) { +JniResult MyMap__get0(jobject self_, jobject key) { 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) + 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_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) + 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()}; - load_field(_c_Fields, &_f_Fields__bestFighterInGreece, "bestFighterInGreece", - "Ljava/lang/String;"); jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_Fields__bestFighterInGreece); + (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyMap__get0, key); return to_global_ref_result(_result); } +jmethodID _m_MyMap__put = NULL; FFI_PLUGIN_EXPORT -JniResult set_Fields__bestFighterInGreece(jobject self_, jobject value) { +JniResult MyMap__put(jobject self_, jobject key, jobject value) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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); } -jfieldID _f_Fields__random = NULL; +jmethodID _m_MyMap__entryStack = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__random(jobject self_) { +JniResult MyMap__entryStack(jobject self_) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_field(_c_Fields, &_f_Fields__random, "random", "Ljava/util/Random;"); - jobject _result = (*jniEnv)->GetObjectField(jniEnv, self_, _f_Fields__random); + 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 set_Fields__random(jobject self_, jobject value) { +JniResult MyStack__new0() { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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); } -jfieldID _f_Fields__euroSymbol = NULL; +jmethodID _m_MyStack__fromArray = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields__euroSymbol() { +JniResult MyStack__fromArray(jobject arr) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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 set_Fields__euroSymbol(uint16_t value) { +JniResult MyStack__fromArrayOfArrayOfGrandParents(jobject arr) { load_env(); - load_class_global_ref(&_c_Fields, - "com/github/dart_lang/jnigen/simple_package/Fields"); - if (_c_Fields == NULL) + 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_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()}; + 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); } -// com.github.dart_lang.jnigen.simple_package.Fields$Nested -jclass _c_Fields_Nested = NULL; - -jmethodID _m_Fields_Nested__new0 = NULL; +jmethodID _m_MyStack__of = NULL; FFI_PLUGIN_EXPORT -JniResult Fields_Nested__new0() { +JniResult MyStack__of() { load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) + 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_Fields_Nested, &_m_Fields_Nested__new0, "", "()V"); - if (_m_Fields_Nested__new0 == NULL) + 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)->NewObject(jniEnv, _c_Fields_Nested, _m_Fields_Nested__new0); + (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_MyStack, _m_MyStack__of); return to_global_ref_result(_result); } -jfieldID _f_Fields_Nested__hundred = NULL; +jmethodID _m_MyStack__of1 = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields_Nested__hundred(jobject self_) { +JniResult MyStack__of1(jobject obj) { load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) + 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_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) + 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()}; - 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()}; + jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_MyStack, + _m_MyStack__of1, obj); + return to_global_ref_result(_result); } -jfieldID _f_Fields_Nested__BEST_GOD = NULL; +jmethodID _m_MyStack__of2 = NULL; FFI_PLUGIN_EXPORT -JniResult get_Fields_Nested__BEST_GOD() { +JniResult MyStack__of2(jobject obj, jobject obj2) { load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) + 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_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); + 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 set_Fields_Nested__BEST_GOD(jobject value) { +JniResult MyStack__push(jobject self_, jobject item) { load_env(); - load_class_global_ref( - &_c_Fields_Nested, - "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); - if (_c_Fields_Nested == NULL) + 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_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); + 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()}; } -// com.github.dart_lang.jnigen.pkg2.C2 -jclass _c_C2 = NULL; - -jmethodID _m_C2__new0 = NULL; +jmethodID _m_MyStack__pop = NULL; FFI_PLUGIN_EXPORT -JniResult C2__new0() { +JniResult MyStack__pop(jobject self_) { load_env(); - load_class_global_ref(&_c_C2, "com/github/dart_lang/jnigen/pkg2/C2"); - if (_c_C2 == NULL) + 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_C2, &_m_C2__new0, "", "()V"); - if (_m_C2__new0 == NULL) + 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)->NewObject(jniEnv, _c_C2, _m_C2__new0); + jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyStack__pop); return to_global_ref_result(_result); } -jfieldID _f_C2__CONSTANT = NULL; +jmethodID _m_MyStack__size = NULL; FFI_PLUGIN_EXPORT -JniResult get_C2__CONSTANT() { +JniResult MyStack__size(jobject self_) { load_env(); - load_class_global_ref(&_c_C2, "com/github/dart_lang/jnigen/pkg2/C2"); - if (_c_C2 == NULL) + 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_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) + load_method(_c_MyStack, &_m_MyStack__size, "size", "()I"); + if (_m_MyStack__size == 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()}; + int32_t _result = (*jniEnv)->CallIntMethod(jniEnv, self_, _m_MyStack__size); + return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -// com.github.dart_lang.jnigen.pkg2.Example -jclass _c_Example1 = NULL; +// com.github.dart_lang.jnigen.generics.StringKeyedMap +jclass _c_StringKeyedMap = NULL; -jmethodID _m_Example1__new0 = NULL; +jmethodID _m_StringKeyedMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example1__new0() { +JniResult StringKeyedMap__new0() { load_env(); - load_class_global_ref(&_c_Example1, - "com/github/dart_lang/jnigen/pkg2/Example"); - if (_c_Example1 == NULL) + 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_Example1, &_m_Example1__new0, "", "()V"); - if (_m_Example1__new0 == NULL) + 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_Example1, _m_Example1__new0); + (*jniEnv)->NewObject(jniEnv, _c_StringKeyedMap, _m_StringKeyedMap__new0); return to_global_ref_result(_result); } -jmethodID _m_Example1__whichExample = NULL; +// com.github.dart_lang.jnigen.generics.StringStack +jclass _c_StringStack = NULL; + +jmethodID _m_StringStack__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example1__whichExample(jobject self_) { +JniResult StringStack__new0() { load_env(); - load_class_global_ref(&_c_Example1, - "com/github/dart_lang/jnigen/pkg2/Example"); - if (_c_Example1 == NULL) + 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_Example1, &_m_Example1__whichExample, "whichExample", "()I"); - if (_m_Example1__whichExample == NULL) + load_method(_c_StringStack, &_m_StringStack__new0, "", "()V"); + if (_m_StringStack__new0 == 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()}; + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_StringStack, _m_StringStack__new0); + return to_global_ref_result(_result); } -// com.github.dart_lang.jnigen.generics.GenericTypeParams -jclass _c_GenericTypeParams = NULL; +// com.github.dart_lang.jnigen.generics.StringValuedMap +jclass _c_StringValuedMap = NULL; -jmethodID _m_GenericTypeParams__new0 = NULL; +jmethodID _m_StringValuedMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GenericTypeParams__new0() { +JniResult StringValuedMap__new0() { load_env(); - load_class_global_ref( - &_c_GenericTypeParams, - "com/github/dart_lang/jnigen/generics/GenericTypeParams"); - if (_c_GenericTypeParams == NULL) + 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_GenericTypeParams, &_m_GenericTypeParams__new0, "", - "()V"); - if (_m_GenericTypeParams__new0 == NULL) + 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_GenericTypeParams, - _m_GenericTypeParams__new0); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_StringValuedMap, + _m_StringValuedMap__new0); return to_global_ref_result(_result); } -// com.github.dart_lang.jnigen.generics.GrandParent -jclass _c_GrandParent = NULL; +// com.github.dart_lang.jnigen.interfaces.MyInterface +jclass _c_MyInterface = NULL; -jmethodID _m_GrandParent__new0 = NULL; +jmethodID _m_MyInterface__voidCallback = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__new0(jobject value) { +JniResult MyInterface__voidCallback(jobject self_, jobject s) { load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_GrandParent, &_m_GrandParent__new0, "", - "(Ljava/lang/Object;)V"); - if (_m_GrandParent__new0 == NULL) + 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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_GrandParent, _m_GrandParent__new0, value); - return to_global_ref_result(_result); + (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyInterface__voidCallback, s); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jmethodID _m_GrandParent__stringParent = NULL; +jmethodID _m_MyInterface__stringCallback = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__stringParent(jobject self_) { +JniResult MyInterface__stringCallback(jobject self_, jobject s) { load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_GrandParent, &_m_GrandParent__stringParent, "stringParent", - "()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); - if (_m_GrandParent__stringParent == NULL) + 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_GrandParent__stringParent); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_MyInterface__stringCallback, s); return to_global_ref_result(_result); } -jmethodID _m_GrandParent__varParent = NULL; +jmethodID _m_MyInterface__varCallback = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__varParent(jobject self_, jobject nestedValue) { +JniResult MyInterface__varCallback(jobject self_, jobject t) { load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_GrandParent, &_m_GrandParent__varParent, "varParent", - "(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/" - "GrandParent$Parent;"); - if (_m_GrandParent__varParent == NULL) + 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_GrandParent__varParent, nestedValue); + jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, + _m_MyInterface__varCallback, t); return to_global_ref_result(_result); } -jmethodID _m_GrandParent__stringStaticParent = NULL; +jmethodID _m_MyInterface__manyPrimitives = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__stringStaticParent() { +JniResult MyInterface__manyPrimitives(jobject self_, + int32_t a, + uint8_t b, + uint16_t c, + double d) { load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_static_method( - _c_GrandParent, &_m_GrandParent__stringStaticParent, "stringStaticParent", - "()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); - if (_m_GrandParent__stringStaticParent == NULL) + load_method(_c_MyInterface, &_m_MyInterface__manyPrimitives, "manyPrimitives", + "(IZCD)J"); + if (_m_MyInterface__manyPrimitives == 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); + int64_t _result = (*jniEnv)->CallLongMethod( + jniEnv, self_, _m_MyInterface__manyPrimitives, a, b, c, d); + return (JniResult){.value = {.j = _result}, .exception = check_exception()}; } -jmethodID _m_GrandParent__varStaticParent = NULL; +// com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer +jclass _c_MyInterfaceConsumer = NULL; + +jmethodID _m_MyInterfaceConsumer__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__varStaticParent(jobject value) { +JniResult MyInterfaceConsumer__new0() { load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_GrandParent, &_m_GrandParent__varStaticParent, - "varStaticParent", - "(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/" - "generics/GrandParent$StaticParent;"); - if (_m_GrandParent__varStaticParent == NULL) + load_method(_c_MyInterfaceConsumer, &_m_MyInterfaceConsumer__new0, "", + "()V"); + if (_m_MyInterfaceConsumer__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_GrandParent, _m_GrandParent__varStaticParent, value); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyInterfaceConsumer, + _m_MyInterfaceConsumer__new0); return to_global_ref_result(_result); } -jmethodID _m_GrandParent__staticParentWithSameType = NULL; +jmethodID _m_MyInterfaceConsumer__consumeOnAnotherThread = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__staticParentWithSameType(jobject self_) { +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_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_GrandParent, &_m_GrandParent__staticParentWithSameType, - "staticParentWithSameType", - "()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); - if (_m_GrandParent__staticParentWithSameType == NULL) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_GrandParent__staticParentWithSameType); - return to_global_ref_result(_result); + (*jniEnv)->CallStaticVoidMethod( + jniEnv, _c_MyInterfaceConsumer, + _m_MyInterfaceConsumer__consumeOnAnotherThread, myInterface, s, a, b, c, + d, t); + return (JniResult){.value = {.j = 0}, .exception = check_exception()}; } -jfieldID _f_GrandParent__value = NULL; +jmethodID _m_MyInterfaceConsumer__consumeOnSameThread = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent__value(jobject self_) { +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_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_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); + 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 set_GrandParent__value(jobject self_, jobject value) { +JniResult MyRunnable__run(jobject self_) { load_env(); - load_class_global_ref(&_c_GrandParent, - "com/github/dart_lang/jnigen/generics/GrandParent"); - if (_c_GrandParent == NULL) + 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_field(_c_GrandParent, &_f_GrandParent__value, "value", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_GrandParent__value, value); + 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.generics.GrandParent$Parent -jclass _c_GrandParent_Parent = NULL; +// com.github.dart_lang.jnigen.interfaces.MyRunnableRunner +jclass _c_MyRunnableRunner = NULL; -jmethodID _m_GrandParent_Parent__new0 = NULL; +jmethodID _m_MyRunnableRunner__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_Parent__new0(jobject _parent, jobject newValue) { +JniResult MyRunnableRunner__new0(jobject runnable) { load_env(); load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) + &_c_MyRunnableRunner, + "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); + if (_c_MyRunnableRunner == 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) + 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_GrandParent_Parent, - _m_GrandParent_Parent__new0, _parent, newValue); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyRunnableRunner, + _m_MyRunnableRunner__new0, runnable); return to_global_ref_result(_result); } -jfieldID _f_GrandParent_Parent__parentValue = NULL; +jmethodID _m_MyRunnableRunner__runOnSameThread = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent__parentValue(jobject self_) { +JniResult MyRunnableRunner__runOnSameThread(jobject self_) { load_env(); load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) + &_c_MyRunnableRunner, + "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); + if (_c_MyRunnableRunner == 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); + 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 set_GrandParent_Parent__parentValue(jobject self_, jobject value) { +JniResult MyRunnableRunner__runOnAnotherThread(jobject self_) { load_env(); load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) + &_c_MyRunnableRunner, + "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); + if (_c_MyRunnableRunner == 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); + 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_GrandParent_Parent__value = NULL; +jfieldID _f_MyRunnableRunner__error = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent__value(jobject self_) { +JniResult get_MyRunnableRunner__error(jobject self_) { load_env(); load_class_global_ref( - &_c_GrandParent_Parent, - "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); - if (_c_GrandParent_Parent == NULL) + &_c_MyRunnableRunner, + "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); + if (_c_MyRunnableRunner == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_field(_c_GrandParent_Parent, &_f_GrandParent_Parent__value, "value", - "Ljava/lang/Object;"); + load_field(_c_MyRunnableRunner, &_f_MyRunnableRunner__error, "error", + "Ljava/lang/Throwable;"); jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_GrandParent_Parent__value); + (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyRunnableRunner__error); return to_global_ref_result(_result); } FFI_PLUGIN_EXPORT -JniResult set_GrandParent_Parent__value(jobject self_, jobject value) { +JniResult set_MyRunnableRunner__error(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) + &_c_MyRunnableRunner, + "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); + if (_c_MyRunnableRunner == 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); + 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.generics.GrandParent$Parent$Child -jclass _c_GrandParent_Parent_Child = NULL; +// com.github.dart_lang.jnigen.annotations.JsonSerializable$Case +jclass _c_JsonSerializable_Case = NULL; -jmethodID _m_GrandParent_Parent_Child__new0 = NULL; +jmethodID _m_JsonSerializable_Case__values = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_Parent_Child__new0(jobject _parent, jobject newValue) { +JniResult JsonSerializable_Case__values() { 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) + &_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_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) + 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)->NewObject(jniEnv, _c_GrandParent_Parent_Child, - _m_GrandParent_Parent_Child__new0, - _parent, newValue); + jobject _result = (*jniEnv)->CallStaticObjectMethod( + jniEnv, _c_JsonSerializable_Case, _m_JsonSerializable_Case__values); return to_global_ref_result(_result); } -jfieldID _f_GrandParent_Parent_Child__grandParentValue = NULL; +jmethodID _m_JsonSerializable_Case__valueOf = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent_Child__grandParentValue(jobject self_) { +JniResult JsonSerializable_Case__valueOf(jobject name) { 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) + &_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_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); + 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); } -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()}; -} +// com.github.dart_lang.jnigen.annotations.JsonSerializable +jclass _c_JsonSerializable = NULL; -jfieldID _f_GrandParent_Parent_Child__parentValue = NULL; +jmethodID _m_JsonSerializable__value = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent_Child__parentValue(jobject self_) { +JniResult JsonSerializable__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) + &_c_JsonSerializable, + "com/github/dart_lang/jnigen/annotations/JsonSerializable"); + if (_c_JsonSerializable == 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); + 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 set_GrandParent_Parent_Child__parentValue(jobject self_, - jobject value) { +JniResult MyDataClass__new0() { 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) + 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_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()}; + 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); } -jfieldID _f_GrandParent_Parent_Child__value = NULL; +// com.github.dart_lang.jnigen.simple_package.Color +jclass _c_Color = NULL; + +jmethodID _m_Color__values = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_Parent_Child__value(jobject self_) { +JniResult Color__values() { 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) + 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_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); + 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 set_GrandParent_Parent_Child__value(jobject self_, jobject value) { +JniResult Color__valueOf(jobject name) { 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) + 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_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()}; + 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.generics.GrandParent$StaticParent -jclass _c_GrandParent_StaticParent = NULL; +// com.github.dart_lang.jnigen.simple_package.Exceptions +jclass _c_Exceptions = NULL; -jmethodID _m_GrandParent_StaticParent__new0 = NULL; +jmethodID _m_Exceptions__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_StaticParent__new0(jobject value) { +JniResult Exceptions__new0() { load_env(); load_class_global_ref( - &_c_GrandParent_StaticParent, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - if (_c_GrandParent_StaticParent == NULL) + &_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_GrandParent_StaticParent, &_m_GrandParent_StaticParent__new0, - "", "(Ljava/lang/Object;)V"); - if (_m_GrandParent_StaticParent__new0 == NULL) + 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_GrandParent_StaticParent, - _m_GrandParent_StaticParent__new0, value); + (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__new0); return to_global_ref_result(_result); } -jfieldID _f_GrandParent_StaticParent__value = NULL; +jmethodID _m_Exceptions__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_StaticParent__value(jobject self_) { +JniResult Exceptions__new1(float x) { load_env(); load_class_global_ref( - &_c_GrandParent_StaticParent, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - if (_c_GrandParent_StaticParent == NULL) + &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); + if (_c_Exceptions == 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); + 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 set_GrandParent_StaticParent__value(jobject self_, jobject value) { +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_GrandParent_StaticParent, - "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - if (_c_GrandParent_StaticParent == NULL) + &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); + if (_c_Exceptions == 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()}; + 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); } -// com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child -jclass _c_GrandParent_StaticParent_Child = NULL; - -jmethodID _m_GrandParent_StaticParent_Child__new0 = NULL; +jmethodID _m_Exceptions__staticObjectMethod = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_StaticParent_Child__new0(jobject _parent, - jobject parentValue, - jobject value) { +JniResult Exceptions__staticObjectMethod() { 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) + &_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_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) + 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)->NewObject( - jniEnv, _c_GrandParent_StaticParent_Child, - _m_GrandParent_StaticParent_Child__new0, _parent, parentValue, value); + jobject _result = (*jniEnv)->CallStaticObjectMethod( + jniEnv, _c_Exceptions, _m_Exceptions__staticObjectMethod); return to_global_ref_result(_result); } -jfieldID _f_GrandParent_StaticParent_Child__parentValue = NULL; +jmethodID _m_Exceptions__staticIntMethod = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_StaticParent_Child__parentValue(jobject self_) { +JniResult Exceptions__staticIntMethod() { 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) + &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); + if (_c_Exceptions == 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); + 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 set_GrandParent_StaticParent_Child__parentValue(jobject self_, - jobject value) { +JniResult Exceptions__staticObjectArrayMethod() { 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) + &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); + if (_c_Exceptions == 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()}; + 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); } -jfieldID _f_GrandParent_StaticParent_Child__value = NULL; +jmethodID _m_Exceptions__staticIntArrayMethod = NULL; FFI_PLUGIN_EXPORT -JniResult get_GrandParent_StaticParent_Child__value(jobject self_) { +JniResult Exceptions__staticIntArrayMethod() { 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) + &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); + if (_c_Exceptions == 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); + 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 set_GrandParent_StaticParent_Child__value(jobject self_, - jobject value) { +JniResult Exceptions__objectMethod(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) + &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); + if (_c_Exceptions == 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()}; + 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); } -// com.github.dart_lang.jnigen.generics.MyMap -jclass _c_MyMap = NULL; - -jmethodID _m_MyMap__new0 = NULL; +jmethodID _m_Exceptions__intMethod = NULL; FFI_PLUGIN_EXPORT -JniResult MyMap__new0() { +JniResult Exceptions__intMethod(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) + 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_MyMap, &_m_MyMap__new0, "", "()V"); - if (_m_MyMap__new0 == NULL) + load_method(_c_Exceptions, &_m_Exceptions__intMethod, "intMethod", "()I"); + if (_m_Exceptions__intMethod == 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); + int32_t _result = + (*jniEnv)->CallIntMethod(jniEnv, self_, _m_Exceptions__intMethod); + return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -jmethodID _m_MyMap__get0 = NULL; +jmethodID _m_Exceptions__objectArrayMethod = 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) +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_MyMap, &_m_MyMap__get0, "get", - "(Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_MyMap__get0 == NULL) + 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_MyMap__get0, key); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_Exceptions__objectArrayMethod); return to_global_ref_result(_result); } -jmethodID _m_MyMap__put = NULL; +jmethodID _m_Exceptions__intArrayMethod = NULL; FFI_PLUGIN_EXPORT -JniResult MyMap__put(jobject self_, jobject key, jobject value) { +JniResult Exceptions__intArrayMethod(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) + 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_MyMap, &_m_MyMap__put, "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (_m_MyMap__put == NULL) + 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_MyMap__put, key, value); + (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_Exceptions__intArrayMethod); return to_global_ref_result(_result); } -jmethodID _m_MyMap__entryStack = NULL; +jmethodID _m_Exceptions__throwNullPointerException = NULL; FFI_PLUGIN_EXPORT -JniResult MyMap__entryStack(jobject self_) { +JniResult Exceptions__throwNullPointerException(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap, - "com/github/dart_lang/jnigen/generics/MyMap"); - if (_c_MyMap == NULL) + 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_MyMap, &_m_MyMap__entryStack, "entryStack", - "()Lcom/github/dart_lang/jnigen/generics/MyStack;"); - if (_m_MyMap__entryStack == NULL) + load_method(_c_Exceptions, &_m_Exceptions__throwNullPointerException, + "throwNullPointerException", "()I"); + if (_m_Exceptions__throwNullPointerException == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = - (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyMap__entryStack); - return to_global_ref_result(_result); + int32_t _result = (*jniEnv)->CallIntMethod( + jniEnv, self_, _m_Exceptions__throwNullPointerException); + return (JniResult){.value = {.i = _result}, .exception = check_exception()}; } -// com.github.dart_lang.jnigen.generics.MyMap$MyEntry -jclass _c_MyMap_MyEntry = NULL; - -jmethodID _m_MyMap_MyEntry__new0 = NULL; +jmethodID _m_Exceptions__throwFileNotFoundException = NULL; FFI_PLUGIN_EXPORT -JniResult MyMap_MyEntry__new0(jobject _parent, jobject key, jobject value) { +JniResult Exceptions__throwFileNotFoundException(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) + 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_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) + 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)->NewObject( - jniEnv, _c_MyMap_MyEntry, _m_MyMap_MyEntry__new0, _parent, key, value); + jobject _result = (*jniEnv)->CallObjectMethod( + jniEnv, self_, _m_Exceptions__throwFileNotFoundException); return to_global_ref_result(_result); } -jfieldID _f_MyMap_MyEntry__key = NULL; +jmethodID _m_Exceptions__throwClassCastException = NULL; FFI_PLUGIN_EXPORT -JniResult get_MyMap_MyEntry__key(jobject self_) { +JniResult Exceptions__throwClassCastException(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) + 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_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__key, "key", - "Ljava/lang/Object;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyMap_MyEntry__key); + 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 set_MyMap_MyEntry__key(jobject self_, jobject value) { +JniResult Exceptions__throwArrayIndexException(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) + 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_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()}; + 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()}; } -jfieldID _f_MyMap_MyEntry__value = NULL; +jmethodID _m_Exceptions__throwArithmeticException = NULL; FFI_PLUGIN_EXPORT -JniResult get_MyMap_MyEntry__value(jobject self_) { +JniResult Exceptions__throwArithmeticException(jobject self_) { load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) + 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_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); + 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 set_MyMap_MyEntry__value(jobject self_, jobject value) { +JniResult Exceptions__throwLoremIpsum() { load_env(); - load_class_global_ref(&_c_MyMap_MyEntry, - "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); - if (_c_MyMap_MyEntry == NULL) + 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_field(_c_MyMap_MyEntry, &_f_MyMap_MyEntry__value, "value", - "Ljava/lang/Object;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_MyMap_MyEntry__value, value); + 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.generics.MyStack -jclass _c_MyStack = NULL; +// com.github.dart_lang.jnigen.simple_package.Fields +jclass _c_Fields = NULL; -jmethodID _m_MyStack__new0 = NULL; +jmethodID _m_Fields__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__new0() { +JniResult Fields__new0() { load_env(); - load_class_global_ref(&_c_MyStack, - "com/github/dart_lang/jnigen/generics/MyStack"); - if (_c_MyStack == NULL) + 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_MyStack, &_m_MyStack__new0, "", "()V"); - if (_m_MyStack__new0 == NULL) + 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_MyStack, _m_MyStack__new0); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Fields, _m_Fields__new0); return to_global_ref_result(_result); } -jmethodID _m_MyStack__fromArray = NULL; +jfieldID _f_Fields__amount = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__fromArray(jobject arr) { +JniResult get_Fields__amount() { 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) + 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()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_MyStack, _m_MyStack__fromArray, arr); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_MyStack__fromArrayOfArrayOfGrandParents = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__fromArrayOfArrayOfGrandParents(jobject arr) { +JniResult set_Fields__amount(int32_t value) { 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) + 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()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_MyStack, _m_MyStack__fromArrayOfArrayOfGrandParents, arr); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_MyStack__of = NULL; +jfieldID _f_Fields__pi = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__of() { +JniResult get_Fields__pi() { 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) + 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()}; - jobject _result = - (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_MyStack, _m_MyStack__of); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_MyStack__of1 = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__of1(jobject obj) { +JniResult set_Fields__pi(double value) { 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) + 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()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod(jniEnv, _c_MyStack, - _m_MyStack__of1, obj); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_MyStack__of2 = NULL; +jfieldID _f_Fields__asterisk = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__of2(jobject obj, jobject obj2) { +JniResult get_Fields__asterisk() { 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) + 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()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_MyStack, _m_MyStack__of2, obj, obj2); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_MyStack__push = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__push(jobject self_, jobject item) { +JniResult set_Fields__asterisk(uint16_t value) { 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) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyStack__push, item); + 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()}; } -jmethodID _m_MyStack__pop = NULL; +jfieldID _f_Fields__name = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__pop(jobject self_) { +JniResult get_Fields__name() { 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) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, _m_MyStack__pop); + 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); } -jmethodID _m_MyStack__size = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__size(jobject self_) { +JniResult set_Fields__name(jobject value) { 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) + 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()}; - int32_t _result = (*jniEnv)->CallIntMethod(jniEnv, self_, _m_MyStack__size); - return (JniResult){.value = {.i = _result}, .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()}; } -// com.github.dart_lang.jnigen.generics.StringKeyedMap -jclass _c_StringKeyedMap = NULL; - -jmethodID _m_StringKeyedMap__new0 = NULL; +jfieldID _f_Fields__i = NULL; FFI_PLUGIN_EXPORT -JniResult StringKeyedMap__new0() { +JniResult get_Fields__i(jobject self_) { 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) + 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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringKeyedMap, _m_StringKeyedMap__new0); + 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); } -// com.github.dart_lang.jnigen.generics.StringMap -jclass _c_StringMap = NULL; - -jmethodID _m_StringMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult StringMap__new0() { +JniResult set_Fields__i(jobject self_, jobject value) { 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) + 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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringMap, _m_StringMap__new0); - return to_global_ref_result(_result); + 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()}; } -// com.github.dart_lang.jnigen.generics.StringStack -jclass _c_StringStack = NULL; - -jmethodID _m_StringStack__new0 = NULL; +jfieldID _f_Fields__trillion = NULL; FFI_PLUGIN_EXPORT -JniResult StringStack__new0() { +JniResult get_Fields__trillion(jobject self_) { 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) + 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()}; - jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringStack, _m_StringStack__new0); - return to_global_ref_result(_result); + 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()}; } -// com.github.dart_lang.jnigen.generics.StringValuedMap -jclass _c_StringValuedMap = NULL; - -jmethodID _m_StringValuedMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult StringValuedMap__new0() { +JniResult set_Fields__trillion(jobject self_, int64_t value) { 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) + 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()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_StringValuedMap, - _m_StringValuedMap__new0); - return to_global_ref_result(_result); + 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()}; } -// com.github.dart_lang.jnigen.interfaces.MyInterface -jclass _c_MyInterface = NULL; - -jmethodID _m_MyInterface__voidCallback = NULL; +jfieldID _f_Fields__isAchillesDead = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterface__voidCallback(jobject self_, jobject s) { +JniResult get_Fields__isAchillesDead(jobject self_) { 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) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyInterface__voidCallback, s); - 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()}; } -jmethodID _m_MyInterface__stringCallback = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterface__stringCallback(jobject self_, jobject s) { +JniResult set_Fields__isAchillesDead(jobject self_, uint8_t value) { 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) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod( - jniEnv, self_, _m_MyInterface__stringCallback, s); - return to_global_ref_result(_result); + 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()}; } -jmethodID _m_MyInterface__varCallback = NULL; +jfieldID _f_Fields__bestFighterInGreece = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterface__varCallback(jobject self_, jobject t) { +JniResult get_Fields__bestFighterInGreece(jobject self_) { 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) + 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()}; - jobject _result = (*jniEnv)->CallObjectMethod(jniEnv, self_, - _m_MyInterface__varCallback, t); + 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); } -jmethodID _m_MyInterface__manyPrimitives = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterface__manyPrimitives(jobject self_, - int32_t a, - uint8_t b, - uint16_t c, - double d) { +JniResult set_Fields__bestFighterInGreece(jobject self_, jobject value) { 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) + 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()}; - int64_t _result = (*jniEnv)->CallLongMethod( - jniEnv, self_, _m_MyInterface__manyPrimitives, a, b, c, d); - return (JniResult){.value = {.j = _result}, .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()}; } -// com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer -jclass _c_MyInterfaceConsumer = NULL; - -jmethodID _m_MyInterfaceConsumer__new0 = NULL; +jfieldID _f_Fields__random = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterfaceConsumer__new0() { +JniResult get_Fields__random(jobject self_) { 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) + 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()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__new0); + 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); } -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) { +JniResult set_Fields__random(jobject self_, jobject value) { 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) + 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()}; - (*jniEnv)->CallStaticVoidMethod( - jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__consumeOnAnotherThread, myInterface, s, a, b, c, - d, t); + 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()}; } -jmethodID _m_MyInterfaceConsumer__consumeOnSameThread = NULL; +jfieldID _f_Fields__euroSymbol = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterfaceConsumer__consumeOnSameThread(jobject myInterface, - jobject s, - int32_t a, - uint8_t b, - uint16_t c, - double d, - jobject t) { +JniResult get_Fields__euroSymbol() { 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) + 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()}; - (*jniEnv)->CallStaticVoidMethod(jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__consumeOnSameThread, - myInterface, s, a, b, c, d, t); - 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()}; } -// com.github.dart_lang.jnigen.interfaces.MyRunnable -jclass _c_MyRunnable = NULL; - -jmethodID _m_MyRunnable__run = NULL; FFI_PLUGIN_EXPORT -JniResult MyRunnable__run(jobject self_) { +JniResult set_Fields__euroSymbol(uint16_t value) { 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) + 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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, _m_MyRunnable__run); + 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.interfaces.MyRunnableRunner -jclass _c_MyRunnableRunner = NULL; +// com.github.dart_lang.jnigen.simple_package.Fields$Nested +jclass _c_Fields_Nested = NULL; -jmethodID _m_MyRunnableRunner__new0 = NULL; +jmethodID _m_Fields_Nested__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyRunnableRunner__new0(jobject runnable) { +JniResult Fields_Nested__new0() { load_env(); load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) + &_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_MyRunnableRunner, &_m_MyRunnableRunner__new0, "", - "(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V"); - if (_m_MyRunnableRunner__new0 == NULL) + 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_MyRunnableRunner, - _m_MyRunnableRunner__new0, runnable); + jobject _result = + (*jniEnv)->NewObject(jniEnv, _c_Fields_Nested, _m_Fields_Nested__new0); return to_global_ref_result(_result); } -jmethodID _m_MyRunnableRunner__runOnSameThread = NULL; +jfieldID _f_Fields_Nested__hundred = NULL; FFI_PLUGIN_EXPORT -JniResult MyRunnableRunner__runOnSameThread(jobject self_) { +JniResult get_Fields_Nested__hundred(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) + &_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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_MyRunnableRunner__runOnSameThread); - 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()}; } -jmethodID _m_MyRunnableRunner__runOnAnotherThread = NULL; FFI_PLUGIN_EXPORT -JniResult MyRunnableRunner__runOnAnotherThread(jobject self_) { +JniResult set_Fields_Nested__hundred(jobject self_, int64_t 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_method(_c_MyRunnableRunner, &_m_MyRunnableRunner__runOnAnotherThread, - "runOnAnotherThread", "()V"); - if (_m_MyRunnableRunner__runOnAnotherThread == NULL) + &_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()}; - (*jniEnv)->CallVoidMethod(jniEnv, self_, - _m_MyRunnableRunner__runOnAnotherThread); + 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_MyRunnableRunner__error = NULL; +jfieldID _f_Fields_Nested__BEST_GOD = NULL; FFI_PLUGIN_EXPORT -JniResult get_MyRunnableRunner__error(jobject self_) { +JniResult get_Fields_Nested__BEST_GOD() { load_env(); load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) + &_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_MyRunnableRunner, &_f_MyRunnableRunner__error, "error", - "Ljava/lang/Throwable;"); - jobject _result = - (*jniEnv)->GetObjectField(jniEnv, self_, _f_MyRunnableRunner__error); + 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_MyRunnableRunner__error(jobject self_, jobject value) { +JniResult set_Fields_Nested__BEST_GOD(jobject value) { load_env(); load_class_global_ref( - &_c_MyRunnableRunner, - "com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); - if (_c_MyRunnableRunner == NULL) + &_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_MyRunnableRunner, &_f_MyRunnableRunner__error, "error", - "Ljava/lang/Throwable;"); - (*jniEnv)->SetObjectField(jniEnv, self_, _f_MyRunnableRunner__error, value); + 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.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); -} +// com.github.dart_lang.jnigen.generics.GenericTypeParams +jclass _c_GenericTypeParams = NULL; -jmethodID _m_JsonSerializable_Case__valueOf = NULL; +jmethodID _m_GenericTypeParams__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonSerializable_Case__valueOf(jobject name) { +JniResult GenericTypeParams__new0() { load_env(); load_class_global_ref( - &_c_JsonSerializable_Case, - "com/github/dart_lang/jnigen/annotations/JsonSerializable$Case"); - if (_c_JsonSerializable_Case == NULL) + &_c_GenericTypeParams, + "com/github/dart_lang/jnigen/generics/GenericTypeParams"); + if (_c_GenericTypeParams == 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) + load_method(_c_GenericTypeParams, &_m_GenericTypeParams__new0, "", + "()V"); + if (_m_GenericTypeParams__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_JsonSerializable_Case, _m_JsonSerializable_Case__valueOf, - name); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GenericTypeParams, + _m_GenericTypeParams__new0); return to_global_ref_result(_result); } -// com.github.dart_lang.jnigen.annotations.MyDataClass -jclass _c_MyDataClass = NULL; +// com.github.dart_lang.jnigen.generics.StringMap +jclass _c_StringMap = NULL; -jmethodID _m_MyDataClass__new0 = NULL; +jmethodID _m_StringMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyDataClass__new0() { +JniResult StringMap__new0() { load_env(); - load_class_global_ref(&_c_MyDataClass, - "com/github/dart_lang/jnigen/annotations/MyDataClass"); - if (_c_MyDataClass == NULL) + 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_MyDataClass, &_m_MyDataClass__new0, "", "()V"); - if (_m_MyDataClass__new0 == NULL) + 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_MyDataClass, _m_MyDataClass__new0); + (*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 index cf8c6456a5..bf4ecbfacc 100644 --- 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 @@ -31,49 +31,217 @@ import "package:jni/jni.dart" as jni; final ffi.Pointer Function(String sym) jniLookup = ProtectedJniExtensions.initGeneratedLibrary("simple_package"); -/// from: com.github.dart_lang.jnigen.simple_package.Color -class Color extends jni.JObject { +/// 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; + late final jni.JObjType $type = type; - Color.fromRef( + Example_Nested_NestedTwice.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $ColorType(); - static final _values = - jniLookup>("Color__values") + static const type = $Example_Nested_NestedTwiceType(); + static final _get_ZERO = + jniLookup>( + "get_Example_Nested_NestedTwice__ZERO") .asFunction(); - /// from: static public com.github.dart_lang.jnigen.simple_package.Color[] values() + 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. - static jni.JArray values() { - return const jni.JArrayType($ColorType()).fromRef(_values().object); + factory Example_Nested_NestedTwice() { + return Example_Nested_NestedTwice.fromRef(_new0().object); } +} - static final _valueOf = jniLookup< +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 fromRef(jni.JObjectPtr ref) => + Example_Nested_NestedTwice.fromRef(ref); + + @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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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.fromRef(_new0(value ? 1 : 0).object); + } + + static final _usesAnonymousInnerClass = jniLookup< + ffi + .NativeFunction)>>( + "Example_Nested__usesAnonymousInnerClass") + .asFunction)>(); + + /// from: public void usesAnonymousInnerClass() + void usesAnonymousInnerClass() { + return _usesAnonymousInnerClass(reference).check(); + } + + static final _getValue = jniLookup< + ffi + .NativeFunction)>>( + "Example_Nested__getValue") + .asFunction)>(); + + /// from: public boolean getValue() + bool getValue() { + return _getValue(reference).boolean; + } + + static final _setValue = jniLookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("Color__valueOf") + jni.JniResult Function(ffi.Pointer, + ffi.Uint8)>>("Example_Nested__setValue") + .asFunction, int)>(); + + /// from: public void setValue(boolean value) + void setValue( + bool value, + ) { + return _setValue(reference, 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 fromRef(jni.JObjectPtr ref) => Example_Nested.fromRef(ref); + + @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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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).boolean; + + /// from: public boolean ok + set ok(bool value) => _set_ok(reference, value ? 1 : 0).check(); + + static final _new0 = jniLookup< + ffi + .NativeFunction)>>( + "Example_NonStaticNested__new0") .asFunction)>(); - /// from: static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name) + /// 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. - static Color valueOf( - jni.JString name, + factory Example_NonStaticNested( + Example $parent, ) { - return const $ColorType().fromRef(_valueOf(name.reference).object); + return Example_NonStaticNested.fromRef(_new0($parent.reference).object); } } -final class $ColorType extends jni.JObjType { - const $ColorType(); +final class $Example_NonStaticNestedType + extends jni.JObjType { + const $Example_NonStaticNestedType(); @override - String get signature => r"Lcom/github/dart_lang/jnigen/simple_package/Color;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;"; @override - Color fromRef(jni.JObjectPtr ref) => Color.fromRef(ref); + Example_NonStaticNested fromRef(jni.JObjectPtr ref) => + Example_NonStaticNested.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -82,11 +250,12 @@ final class $ColorType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($ColorType).hashCode; + int get hashCode => ($Example_NonStaticNestedType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($ColorType) && other is $ColorType; + return other.runtimeType == ($Example_NonStaticNestedType) && + other is $Example_NonStaticNestedType; } } @@ -809,75 +978,52 @@ final class $ExampleType extends jni.JObjType { } } -/// from: com.github.dart_lang.jnigen.simple_package.Example$Nested -class Example_Nested extends jni.JObject { +/// from: com.github.dart_lang.jnigen.pkg2.C2 +class C2 extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - Example_Nested.fromRef( + C2.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $Example_NestedType(); - static final _new0 = - jniLookup>( - "Example_Nested__new0") + static const type = $C2Type(); + static final _get_CONSTANT = + jniLookup>( + "get_C2__CONSTANT") + .asFunction(); + + static final _set_CONSTANT = + jniLookup>( + "set_C2__CONSTANT") .asFunction(); - /// from: public void (boolean value) + /// 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 Example_Nested( - bool value, - ) { - return Example_Nested.fromRef(_new0(value ? 1 : 0).object); + factory C2() { + return C2.fromRef(_new0().object); } +} - static final _usesAnonymousInnerClass = jniLookup< - ffi - .NativeFunction)>>( - "Example_Nested__usesAnonymousInnerClass") - .asFunction)>(); - - /// from: public void usesAnonymousInnerClass() - void usesAnonymousInnerClass() { - return _usesAnonymousInnerClass(reference).check(); - } - - static final _getValue = jniLookup< - ffi - .NativeFunction)>>( - "Example_Nested__getValue") - .asFunction)>(); - - /// from: public boolean getValue() - bool getValue() { - return _getValue(reference).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, - ) { - return _setValue(reference, value ? 1 : 0).check(); - } -} - -final class $Example_NestedType extends jni.JObjType { - const $Example_NestedType(); +final class $C2Type extends jni.JObjType { + const $C2Type(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;"; + String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/C2;"; @override - Example_Nested fromRef(jni.JObjectPtr ref) => Example_Nested.fromRef(ref); + C2 fromRef(jni.JObjectPtr ref) => C2.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -886,64 +1032,55 @@ final class $Example_NestedType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($Example_NestedType).hashCode; + int get hashCode => ($C2Type).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($Example_NestedType) && - other is $Example_NestedType; + return other.runtimeType == ($C2Type) && other is $C2Type; } } -/// from: com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice -class Example_Nested_NestedTwice extends jni.JObject { +/// from: com.github.dart_lang.jnigen.pkg2.Example +class Example1 extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - Example_Nested_NestedTwice.fromRef( + Example1.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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") + static const type = $Example1Type(); + static final _new0 = + jniLookup>("Example1__new0") .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.fromRef(_new0().object); + factory Example1() { + return Example1.fromRef(_new0().object); + } + + static final _whichExample = jniLookup< + ffi + .NativeFunction)>>( + "Example1__whichExample") + .asFunction)>(); + + /// from: public int whichExample() + int whichExample() { + return _whichExample(reference).integer; } } -final class $Example_Nested_NestedTwiceType - extends jni.JObjType { - const $Example_Nested_NestedTwiceType(); +final class $Example1Type extends jni.JObjType { + const $Example1Type(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;"; + String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/Example;"; @override - Example_Nested_NestedTwice fromRef(jni.JObjectPtr ref) => - Example_Nested_NestedTwice.fromRef(ref); + Example1 fromRef(jni.JObjectPtr ref) => Example1.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -952,317 +1089,320 @@ final class $Example_Nested_NestedTwiceType final superCount = 1; @override - int get hashCode => ($Example_Nested_NestedTwiceType).hashCode; + int get hashCode => ($Example1Type).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested_NestedTwiceType) && - other is $Example_Nested_NestedTwiceType; + return other.runtimeType == ($Example1Type) && other is $Example1Type; } } -/// from: com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested -class Example_NonStaticNested extends jni.JObject { +/// 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; + late final jni.JObjType> $type = + type(T, S, U); - Example_NonStaticNested.fromRef( + final jni.JObjType<$T> T; + final jni.JObjType<$S> S; + final jni.JObjType<$U> U; + + GrandParent_Parent_Child.fromRef( + this.T, + this.S, + this.U, jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $Example_NonStaticNestedType(); - static final _get_ok = jniLookup< + 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_Example_NonStaticNested__ok") + )>>("get_GrandParent_Parent_Child__grandParentValue") .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).boolean; - - /// from: public boolean ok - set ok(bool value) => _set_ok(reference, value ? 1 : 0).check(); - - static final _new0 = jniLookup< - ffi - .NativeFunction)>>( - "Example_NonStaticNested__new0") - .asFunction)>(); + 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 void (com.github.dart_lang.jnigen.simple_package.Example $parent) + /// from: public T grandParentValue /// The returned object must be released after use, by calling the [release] method. - factory Example_NonStaticNested( - Example $parent, - ) { - return Example_NonStaticNested.fromRef(_new0($parent.reference).object); - } -} + $T get grandParentValue => T.fromRef(_get_grandParentValue(reference).object); -final class $Example_NonStaticNestedType - extends jni.JObjType { - const $Example_NonStaticNestedType(); + /// from: public T grandParentValue + /// The returned object must be released after use, by calling the [release] method. + set grandParentValue($T value) => + _set_grandParentValue(reference, value.reference).check(); - @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;"; + static final _get_parentValue = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>>("get_GrandParent_Parent_Child__parentValue") + .asFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>(); - @override - Example_NonStaticNested fromRef(jni.JObjectPtr ref) => - Example_NonStaticNested.fromRef(ref); + 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)>(); - @override - jni.JObjType get superType => const jni.JObjectType(); + /// from: public S parentValue + /// The returned object must be released after use, by calling the [release] method. + $S get parentValue => S.fromRef(_get_parentValue(reference).object); - @override - final superCount = 1; + /// from: public S parentValue + /// The returned object must be released after use, by calling the [release] method. + set parentValue($S value) => + _set_parentValue(reference, value.reference).check(); - @override - int get hashCode => ($Example_NonStaticNestedType).hashCode; + static final _get_value = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>>("get_GrandParent_Parent_Child__value") + .asFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($Example_NonStaticNestedType) && - other is $Example_NonStaticNestedType; - } -} + 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: com.github.dart_lang.jnigen.simple_package.Exceptions -class Exceptions extends jni.JObject { - @override - late final jni.JObjType $type = type; + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + $U get value => U.fromRef(_get_value(reference).object); - Exceptions.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + set value($U value) => _set_value(reference, value.reference).check(); - /// The type which includes information such as the signature of this class. - static const type = $ExceptionsType(); - static final _new0 = jniLookup>( - "Exceptions__new0") - .asFunction(); + 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 () + /// 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 Exceptions() { - return Exceptions.fromRef(_new0().object); + 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.fromRef( + T, S, U, _new0($parent.reference, newValue.reference).object); } +} - static final _new1 = - jniLookup>( - "Exceptions__new1") - .asFunction(); +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; - /// 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.fromRef(_new1(x).object); - } + const $GrandParent_Parent_ChildType( + this.T, + this.S, + this.U, + ); - static final _new2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, - ffi.Int32, ffi.Int32)>>("Exceptions__new2") - .asFunction(); + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;"; - /// 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.fromRef(_new2(a, b, c, d, e, f).object); - } + @override + GrandParent_Parent_Child<$T, $S, $U> fromRef(jni.JObjectPtr ref) => + GrandParent_Parent_Child.fromRef(T, S, U, ref); - static final _staticObjectMethod = - jniLookup>( - "Exceptions__staticObjectMethod") - .asFunction(); + @override + jni.JObjType get superType => const jni.JObjectType(); - /// 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 const jni.JObjectType().fromRef(_staticObjectMethod().object); - } + @override + final superCount = 1; - static final _staticIntMethod = - jniLookup>( - "Exceptions__staticIntMethod") - .asFunction(); + @override + int get hashCode => Object.hash($GrandParent_Parent_ChildType, T, S, U); - /// from: static public int staticIntMethod() - static int staticIntMethod() { - return _staticIntMethod().integer; + @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; } +} - static final _staticObjectArrayMethod = - jniLookup>( - "Exceptions__staticObjectArrayMethod") - .asFunction(); +/// 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); - /// 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 const jni.JArrayType(jni.JObjectType()) - .fromRef(_staticObjectArrayMethod().object); - } + final jni.JObjType<$T> T; + final jni.JObjType<$S> S; - static final _staticIntArrayMethod = - jniLookup>( - "Exceptions__staticIntArrayMethod") - .asFunction(); + GrandParent_Parent.fromRef( + this.T, + this.S, + jni.JObjectPtr ref, + ) : super.fromRef(ref); - /// from: static public int[] staticIntArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray staticIntArrayMethod() { - return const jni.JArrayType(jni.jintType()) - .fromRef(_staticIntArrayMethod().object); + /// 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 _objectMethod = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__objectMethod") - .asFunction)>(); + static final _get_parentValue = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>>("get_GrandParent_Parent__parentValue") + .asFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>(); - /// from: public java.lang.Object objectMethod() + 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. - jni.JObject objectMethod() { - return const jni.JObjectType().fromRef(_objectMethod(reference).object); - } + $T get parentValue => T.fromRef(_get_parentValue(reference).object); - static final _intMethod = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__intMethod") - .asFunction)>(); + /// from: public T parentValue + /// The returned object must be released after use, by calling the [release] method. + set parentValue($T value) => + _set_parentValue(reference, value.reference).check(); - /// from: public int intMethod() - int intMethod() { - return _intMethod(reference).integer; - } + static final _get_value = jniLookup< + ffi.NativeFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>>("get_GrandParent_Parent__value") + .asFunction< + jni.JniResult Function( + jni.JObjectPtr, + )>(); - static final _objectArrayMethod = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__objectArrayMethod") - .asFunction)>(); + 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 java.lang.Object[] objectArrayMethod() + /// from: public S value /// The returned object must be released after use, by calling the [release] method. - jni.JArray objectArrayMethod() { - return const jni.JArrayType(jni.JObjectType()) - .fromRef(_objectArrayMethod(reference).object); - } - - static final _intArrayMethod = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__intArrayMethod") - .asFunction)>(); + $S get value => S.fromRef(_get_value(reference).object); - /// from: public int[] intArrayMethod() + /// from: public S value /// The returned object must be released after use, by calling the [release] method. - jni.JArray intArrayMethod() { - return const jni.JArrayType(jni.jintType()) - .fromRef(_intArrayMethod(reference).object); - } - - static final _throwNullPointerException = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__throwNullPointerException") - .asFunction)>(); - - /// from: public int throwNullPointerException() - int throwNullPointerException() { - return _throwNullPointerException(reference).integer; - } + set value($S value) => _set_value(reference, value.reference).check(); - static final _throwFileNotFoundException = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__throwFileNotFoundException") - .asFunction)>(); + 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 java.io.InputStream throwFileNotFoundException() + /// 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. - jni.JObject throwFileNotFoundException() { - return const jni.JObjectType() - .fromRef(_throwFileNotFoundException(reference).object); - } - - static final _throwClassCastException = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__throwClassCastException") - .asFunction)>(); - - /// from: public java.io.FileInputStream throwClassCastException() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwClassCastException() { - return const jni.JObjectType() - .fromRef(_throwClassCastException(reference).object); - } - - static final _throwArrayIndexException = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__throwArrayIndexException") - .asFunction)>(); - - /// from: public int throwArrayIndexException() - int throwArrayIndexException() { - return _throwArrayIndexException(reference).integer; - } - - static final _throwArithmeticException = jniLookup< - ffi - .NativeFunction)>>( - "Exceptions__throwArithmeticException") - .asFunction)>(); - - /// from: public int throwArithmeticException() - int throwArithmeticException() { - return _throwArithmeticException(reference).integer; - } - - static final _throwLoremIpsum = - jniLookup>( - "Exceptions__throwLoremIpsum") - .asFunction(); - - /// from: static public void throwLoremIpsum() - static void throwLoremIpsum() { - return _throwLoremIpsum().check(); + 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.fromRef( + T, S, _new0($parent.reference, newValue.reference).object); } } -final class $ExceptionsType extends jni.JObjType { - const $ExceptionsType(); +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/simple_package/Exceptions;"; + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"; @override - Exceptions fromRef(jni.JObjectPtr ref) => Exceptions.fromRef(ref); + GrandParent_Parent<$T, $S> fromRef(jni.JObjectPtr ref) => + GrandParent_Parent.fromRef(T, S, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1271,253 +1411,149 @@ final class $ExceptionsType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($ExceptionsType).hashCode; + int get hashCode => Object.hash($GrandParent_ParentType, T, S); @override bool operator ==(Object other) { - return other.runtimeType == ($ExceptionsType) && other is $ExceptionsType; + 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.simple_package.Fields -class Fields extends jni.JObject { +/// 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; + late final jni.JObjType> $type = + type(S, U); - Fields.fromRef( + final jni.JObjType<$S> S; + final jni.JObjType<$U> U; + + GrandParent_StaticParent_Child.fromRef( + this.S, + this.U, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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 => - const jni.JStringType().fromRef(_get_name().object); - - /// 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).check(); + 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_i = jniLookup< + static final _get_parentValue = jniLookup< ffi.NativeFunction< jni.JniResult Function( jni.JObjectPtr, - )>>("get_Fields__i") + )>>("get_GrandParent_StaticParent_Child__parentValue") .asFunction< jni.JniResult Function( jni.JObjectPtr, )>(); - static final _set_i = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>("set_Fields__i") + 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 java.lang.Integer i + /// from: public S parentValue /// The returned object must be released after use, by calling the [release] method. - jni.JInteger get i => - const jni.JIntegerType().fromRef(_get_i(reference).object); + $S get parentValue => S.fromRef(_get_parentValue(reference).object); - /// from: public java.lang.Integer i + /// from: public S parentValue /// The returned object must be released after use, by calling the [release] method. - set i(jni.JInteger value) => _set_i(reference, value.reference).check(); + set parentValue($S value) => + _set_parentValue(reference, value.reference).check(); - static final _get_trillion = jniLookup< + static final _get_value = jniLookup< ffi.NativeFunction< jni.JniResult Function( jni.JObjectPtr, - )>>("get_Fields__trillion") + )>>("get_GrandParent_StaticParent_Child__value") .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).long; - - /// from: public long trillion - set trillion(int value) => _set_trillion(reference, value).check(); - - static final _get_isAchillesDead = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__isAchillesDead") + 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, - )>(); - - static final _set_isAchillesDead = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Uint8)>>("set_Fields__isAchillesDead") - .asFunction(); + jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - /// from: public boolean isAchillesDead - bool get isAchillesDead => _get_isAchillesDead(reference).boolean; + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + $U get value => U.fromRef(_get_value(reference).object); - /// from: public boolean isAchillesDead - set isAchillesDead(bool value) => - _set_isAchillesDead(reference, value ? 1 : 0).check(); + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + set value($U value) => _set_value(reference, value.reference).check(); - static final _get_bestFighterInGreece = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_Fields__bestFighterInGreece") + static final _new0 = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( + "GrandParent_StaticParent_Child__new0") .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 => const jni.JStringType() - .fromRef(_get_bestFighterInGreece(reference).object); - - /// 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, value.reference).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 => - const jni.JObjectType().fromRef(_get_random(reference).object); - - /// 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, value.reference).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(); + jni.JniResult Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - /// from: public void () + /// 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 Fields() { - return Fields.fromRef(_new0().object); + 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.fromRef( + S, + U, + _new0($parent.reference, parentValue.reference, value.reference) + .object); } } -final class $FieldsType extends jni.JObjType { - const $FieldsType(); +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/simple_package/Fields;"; + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;"; @override - Fields fromRef(jni.JObjectPtr ref) => Fields.fromRef(ref); + GrandParent_StaticParent_Child<$S, $U> fromRef(jni.JObjectPtr ref) => + GrandParent_StaticParent_Child.fromRef(S, U, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1526,88 +1562,98 @@ final class $FieldsType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($FieldsType).hashCode; + int get hashCode => Object.hash($GrandParent_StaticParent_ChildType, S, U); @override bool operator ==(Object other) { - return other.runtimeType == ($FieldsType) && other is $FieldsType; + 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.simple_package.Fields$Nested -class Fields_Nested extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(S); - Fields_Nested.fromRef( + final jni.JObjType<$S> S; + + GrandParent_StaticParent.fromRef( + this.S, jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $Fields_NestedType(); - static final _get_hundred = jniLookup< + 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_Fields_Nested__hundred") + )>>("get_GrandParent_StaticParent__value") .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).long; + 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 long hundred - set hundred(int value) => _set_hundred(reference, value).check(); + /// from: public S value + /// The returned object must be released after use, by calling the [release] method. + $S get value => S.fromRef(_get_value(reference).object); - static final _get_BEST_GOD = - jniLookup>( - "get_Fields_Nested__BEST_GOD") - .asFunction(); + /// from: public S value + /// The returned object must be released after use, by calling the [release] method. + set value($S value) => _set_value(reference, value.reference).check(); - static final _set_BEST_GOD = jniLookup< + static final _new0 = jniLookup< ffi .NativeFunction)>>( - "set_Fields_Nested__BEST_GOD") + "GrandParent_StaticParent__new0") .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 => - const jni.JStringType().fromRef(_get_BEST_GOD().object); - - /// 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).check(); - - static final _new0 = jniLookup>( - "Fields_Nested__new0") - .asFunction(); - - /// from: public void () + /// from: public void (S value) /// The returned object must be released after use, by calling the [release] method. - factory Fields_Nested() { - return Fields_Nested.fromRef(_new0().object); + factory GrandParent_StaticParent( + $S value, { + jni.JObjType<$S>? S, + }) { + S ??= jni.lowestCommonSuperType([ + value.$type, + ]) as jni.JObjType<$S>; + return GrandParent_StaticParent.fromRef(S, _new0(value.reference).object); } } -final class $Fields_NestedType extends jni.JObjType { - const $Fields_NestedType(); +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/simple_package/Fields$Nested;"; + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"; @override - Fields_Nested fromRef(jni.JObjectPtr ref) => Fields_Nested.fromRef(ref); + GrandParent_StaticParent<$S> fromRef(jni.JObjectPtr ref) => + GrandParent_StaticParent.fromRef(S, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1616,241 +1662,46 @@ final class $Fields_NestedType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($Fields_NestedType).hashCode; + int get hashCode => Object.hash($GrandParent_StaticParentType, S); @override bool operator ==(Object other) { - return other.runtimeType == ($Fields_NestedType) && - other is $Fields_NestedType; + return other.runtimeType == ($GrandParent_StaticParentType<$S>) && + other is $GrandParent_StaticParentType<$S> && + S == other.S; } } -/// from: com.github.dart_lang.jnigen.pkg2.C2 -class C2 extends jni.JObject { +/// from: com.github.dart_lang.jnigen.generics.GrandParent +class GrandParent<$T extends jni.JObject> extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType> $type = type(T); - C2.fromRef( + final jni.JObjType<$T> T; + + GrandParent.fromRef( + this.T, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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(); + static $GrandParentType<$T> type<$T extends jni.JObject>( + jni.JObjType<$T> T, + ) { + return $GrandParentType( + T, + ); + } - /// 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.fromRef(_new0().object); - } -} - -final class $C2Type extends jni.JObjType { - const $C2Type(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/C2;"; - - @override - C2 fromRef(jni.JObjectPtr ref) => C2.fromRef(ref); - - @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.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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.fromRef(_new0().object); - } - - static final _whichExample = jniLookup< - ffi - .NativeFunction)>>( - "Example1__whichExample") - .asFunction)>(); - - /// from: public int whichExample() - int whichExample() { - return _whichExample(reference).integer; - } -} - -final class $Example1Type extends jni.JObjType { - const $Example1Type(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/Example;"; - - @override - Example1 fromRef(jni.JObjectPtr ref) => Example1.fromRef(ref); - - @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.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.fromRef( - this.S, - this.K, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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.fromRef(S, K, _new0().object); - } -} - -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> fromRef(jni.JObjectPtr ref) => - GenericTypeParams.fromRef(S, K, ref); - - @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.GrandParent -class GrandParent<$T extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(T); - - final jni.JObjType<$T> T; - - GrandParent.fromRef( - this.T, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - /// 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 _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< @@ -1995,65 +1846,63 @@ final class $GrandParentType<$T extends jni.JObject> } } -/// from: com.github.dart_lang.jnigen.generics.GrandParent$Parent -class GrandParent_Parent<$T extends jni.JObject, $S extends jni.JObject> +/// 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(T, S); + late final jni.JObjType> $type = type(K, V); - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; + final jni.JObjType<$K> K; + final jni.JObjType<$V> V; - GrandParent_Parent.fromRef( - this.T, - this.S, + MyMap_MyEntry.fromRef( + this.K, + this.V, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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, + static $MyMap_MyEntryType<$K, $V> + type<$K extends jni.JObject, $V extends jni.JObject>( + jni.JObjType<$K> K, + jni.JObjType<$V> V, ) { - return $GrandParent_ParentType( - T, - S, + return $MyMap_MyEntryType( + K, + V, ); } - static final _get_parentValue = jniLookup< + static final _get_key = jniLookup< ffi.NativeFunction< jni.JniResult Function( jni.JObjectPtr, - )>>("get_GrandParent_Parent__parentValue") + )>>("get_MyMap_MyEntry__key") .asFunction< jni.JniResult Function( jni.JObjectPtr, )>(); - static final _set_parentValue = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, ffi.Pointer)>>( - "set_GrandParent_Parent__parentValue") + 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 T parentValue + /// from: public K key /// The returned object must be released after use, by calling the [release] method. - $T get parentValue => T.fromRef(_get_parentValue(reference).object); + $K get key => K.fromRef(_get_key(reference).object); - /// from: public T parentValue + /// from: public K key /// The returned object must be released after use, by calling the [release] method. - set parentValue($T value) => - _set_parentValue(reference, value.reference).check(); + set key($K value) => _set_key(reference, value.reference).check(); static final _get_value = jniLookup< ffi.NativeFunction< jni.JniResult Function( jni.JObjectPtr, - )>>("get_GrandParent_Parent__value") + )>>("get_MyMap_MyEntry__value") .asFunction< jni.JniResult Function( jni.JObjectPtr, @@ -2062,62 +1911,67 @@ class GrandParent_Parent<$T extends jni.JObject, $S extends jni.JObject> static final _set_value = jniLookup< ffi.NativeFunction< jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_GrandParent_Parent__value") + ffi.Pointer)>>("set_MyMap_MyEntry__value") .asFunction< jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); - /// from: public S value + /// from: public V value /// The returned object must be released after use, by calling the [release] method. - $S get value => S.fromRef(_get_value(reference).object); + $V get value => V.fromRef(_get_value(reference).object); - /// from: public S value + /// from: public V value /// The returned object must be released after use, by calling the [release] method. - set value($S value) => _set_value(reference, value.reference).check(); + set value($V value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("GrandParent_Parent__new0") + jni.JniResult Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>("MyMap_MyEntry__new0") .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + jni.JniResult Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - /// from: public void (com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue) + /// 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 GrandParent_Parent( - GrandParent<$T> $parent, - $S newValue, { - jni.JObjType<$T>? T, - jni.JObjType<$S>? S, + factory MyMap_MyEntry( + MyMap<$K, $V> $parent, + $K key, + $V value, { + jni.JObjType<$K>? K, + jni.JObjType<$V>? V, }) { - T ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParentType).T, - ]) as jni.JObjType<$T>; - S ??= jni.lowestCommonSuperType([ - newValue.$type, - ]) as jni.JObjType<$S>; - return GrandParent_Parent.fromRef( - T, S, _new0($parent.reference, newValue.reference).object); + 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.fromRef( + K, V, _new0($parent.reference, key.reference, value.reference).object); } } -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; +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 $GrandParent_ParentType( - this.T, - this.S, + const $MyMap_MyEntryType( + this.K, + this.V, ); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"; + r"Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;"; @override - GrandParent_Parent<$T, $S> fromRef(jni.JObjectPtr ref) => - GrandParent_Parent.fromRef(T, S, ref); + MyMap_MyEntry<$K, $V> fromRef(jni.JObjectPtr ref) => + MyMap_MyEntry.fromRef(K, V, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -2126,180 +1980,120 @@ final class $GrandParent_ParentType<$T extends jni.JObject, final superCount = 1; @override - int get hashCode => Object.hash($GrandParent_ParentType, T, S); + int get hashCode => Object.hash($MyMap_MyEntryType, K, V); @override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_ParentType<$T, $S>) && - other is $GrandParent_ParentType<$T, $S> && - T == other.T && - S == other.S; + 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.GrandParent$Parent$Child -class GrandParent_Parent_Child<$T extends jni.JObject, $S extends jni.JObject, - $U extends jni.JObject> extends jni.JObject { +/// 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(T, S, U); + late final jni.JObjType> $type = type(K, V); - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; + final jni.JObjType<$K> K; + final jni.JObjType<$V> V; - GrandParent_Parent_Child.fromRef( - this.T, - this.S, - this.U, + MyMap.fromRef( + this.K, + this.V, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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, + static $MyMapType<$K, $V> + type<$K extends jni.JObject, $V extends jni.JObject>( + jni.JObjType<$K> K, + jni.JObjType<$V> V, ) { - return $GrandParent_Parent_ChildType( - T, - S, - U, + return $MyMapType( + K, + V, ); } - 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 => T.fromRef(_get_grandParentValue(reference).object); + static final _new0 = + jniLookup>("MyMap__new0") + .asFunction(); - /// from: public T grandParentValue + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - set grandParentValue($T value) => - _set_grandParentValue(reference, value.reference).check(); + factory MyMap({ + required jni.JObjType<$K> K, + required jni.JObjType<$V> V, + }) { + return MyMap.fromRef(K, V, _new0().object); + } - static final _get_parentValue = jniLookup< + static final _get0 = jniLookup< ffi.NativeFunction< jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_Parent_Child__parentValue") + ffi.Pointer, ffi.Pointer)>>("MyMap__get0") .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 => S.fromRef(_get_parentValue(reference).object); + ffi.Pointer, ffi.Pointer)>(); - /// from: public S parentValue + /// from: public V get(K key) /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => - _set_parentValue(reference, value.reference).check(); + $V get0( + $K key, + ) { + return V.fromRef(_get0(reference, key.reference).object); + } - static final _get_value = jniLookup< + static final _put = 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") + jni.JniResult Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>("MyMap__put") .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 => U.fromRef(_get_value(reference).object); + jni.JniResult Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - /// from: public U value + /// from: public V put(K key, V value) /// The returned object must be released after use, by calling the [release] method. - set value($U value) => _set_value(reference, value.reference).check(); + $V put( + $K key, + $V value, + ) { + return V.fromRef(_put(reference, key.reference, value.reference).object); + } - 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)>(); + static final _entryStack = jniLookup< + ffi + .NativeFunction)>>( + "MyMap__entryStack") + .asFunction)>(); - /// from: public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $parent, U newValue) + /// from: public com.github.dart_lang.jnigen.generics.MyStack.MyEntry> entryStack() /// 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.fromRef( - T, S, U, _new0($parent.reference, newValue.reference).object); + MyStack> entryStack() { + return const $MyStackType( + $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType())) + .fromRef(_entryStack(reference).object); } } -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; +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 $GrandParent_Parent_ChildType( - this.T, - this.S, - this.U, + const $MyMapType( + this.K, + this.V, ); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyMap;"; @override - GrandParent_Parent_Child<$T, $S, $U> fromRef(jni.JObjectPtr ref) => - GrandParent_Parent_Child.fromRef(T, S, U, ref); + MyMap<$K, $V> fromRef(jni.JObjectPtr ref) => MyMap.fromRef(K, V, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -2308,99 +2102,191 @@ final class $GrandParent_Parent_ChildType<$T extends jni.JObject, final superCount = 1; @override - int get hashCode => Object.hash($GrandParent_Parent_ChildType, T, S, U); + int get hashCode => Object.hash($MyMapType, K, V); @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; + return other.runtimeType == ($MyMapType<$K, $V>) && + other is $MyMapType<$K, $V> && + K == other.K && + V == other.V; } } -/// from: com.github.dart_lang.jnigen.generics.GrandParent$StaticParent -class GrandParent_StaticParent<$S extends jni.JObject> extends jni.JObject { +/// from: com.github.dart_lang.jnigen.generics.MyStack +class MyStack<$T extends jni.JObject> extends jni.JObject { @override - late final jni.JObjType> $type = type(S); + late final jni.JObjType> $type = type(T); - final jni.JObjType<$S> S; + final jni.JObjType<$T> T; - GrandParent_StaticParent.fromRef( - this.S, + MyStack.fromRef( + this.T, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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, + static $MyStackType<$T> type<$T extends jni.JObject>( + jni.JObjType<$T> T, ) { - return $GrandParent_StaticParentType( - S, + return $MyStackType( + T, ); } - 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)>(); + static final _new0 = + jniLookup>("MyStack__new0") + .asFunction(); - /// from: public S value + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - $S get value => S.fromRef(_get_value(reference).object); + factory MyStack({ + required jni.JObjType<$T> T, + }) { + return MyStack.fromRef(T, _new0().object); + } - /// from: public S value + 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. - set value($S value) => _set_value(reference, value.reference).check(); + 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 $MyStackType(T).fromRef(_fromArray(arr.reference).object); + } - static final _new0 = jniLookup< + static final _fromArrayOfArrayOfGrandParents = jniLookup< ffi .NativeFunction)>>( - "GrandParent_StaticParent__new0") + "MyStack__fromArrayOfArrayOfGrandParents") .asFunction)>(); - /// from: public void (S value) + /// 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. - factory GrandParent_StaticParent( - $S value, { + static MyStack<$S> fromArrayOfArrayOfGrandParents<$S extends jni.JObject>( + jni.JArray>> arr, { jni.JObjType<$S>? S, }) { S ??= jni.lowestCommonSuperType([ - value.$type, + (((((arr.$type as jni.JArrayType).elementType as jni.JObjType) + as jni.JArrayType) + .elementType as jni.JObjType) as $GrandParentType) + .T, ]) as jni.JObjType<$S>; - return GrandParent_StaticParent.fromRef(S, _new0(value.reference).object); + return $MyStackType(S) + .fromRef(_fromArrayOfArrayOfGrandParents(arr.reference).object); + } + + 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 $MyStackType(T).fromRef(_of().object); + } + + 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 $MyStackType(T).fromRef(_of1(obj.reference).object); + } + + 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 $MyStackType(T).fromRef(_of2(obj.reference, obj2.reference).object); + } + + 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, + ) { + return _push(reference, item.reference).check(); + } + + static final _pop = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer)>>("MyStack__pop") + .asFunction)>(); + + /// from: public T pop() + /// The returned object must be released after use, by calling the [release] method. + $T pop() { + return T.fromRef(_pop(reference).object); + } + + static final _size = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer)>>("MyStack__size") + .asFunction)>(); + + /// from: public int size() + int size() { + return _size(reference).integer; } } -final class $GrandParent_StaticParentType<$S extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$S> S; +final class $MyStackType<$T extends jni.JObject> + extends jni.JObjType> { + final jni.JObjType<$T> T; - const $GrandParent_StaticParentType( - this.S, + const $MyStackType( + this.T, ); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyStack;"; @override - GrandParent_StaticParent<$S> fromRef(jni.JObjectPtr ref) => - GrandParent_StaticParent.fromRef(S, ref); + MyStack<$T> fromRef(jni.JObjectPtr ref) => MyStack.fromRef(T, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -2409,608 +2295,458 @@ final class $GrandParent_StaticParentType<$S extends jni.JObject> final superCount = 1; @override - int get hashCode => Object.hash($GrandParent_StaticParentType, S); + int get hashCode => Object.hash($MyStackType, T); @override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_StaticParentType<$S>) && - other is $GrandParent_StaticParentType<$S> && - S == other.S; + return other.runtimeType == ($MyStackType<$T>) && + other is $MyStackType<$T> && + T == other.T; } } -/// 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 { +/// from: com.github.dart_lang.jnigen.generics.StringKeyedMap +class StringKeyedMap<$V extends jni.JObject> extends MyMap { @override - late final jni.JObjType> $type = - type(S, U); + late final jni.JObjType> $type = type(V); - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; + final jni.JObjType<$V> V; - GrandParent_StaticParent_Child.fromRef( - this.S, - this.U, + StringKeyedMap.fromRef( + this.V, jni.JObjectPtr ref, - ) : super.fromRef(ref); + ) : super.fromRef(const jni.JStringType(), V, ref); /// 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, + static $StringKeyedMapType<$V> type<$V extends jni.JObject>( + jni.JObjType<$V> V, ) { - return $GrandParent_StaticParent_ChildType( - S, - U, + return $StringKeyedMapType( + V, ); } - 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)>(); + static final _new0 = jniLookup>( + "StringKeyedMap__new0") + .asFunction(); - /// from: public S parentValue + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => S.fromRef(_get_parentValue(reference).object); + factory StringKeyedMap({ + required jni.JObjType<$V> V, + }) { + return StringKeyedMap.fromRef(V, _new0().object); + } +} - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => - _set_parentValue(reference, value.reference).check(); +final class $StringKeyedMapType<$V extends jni.JObject> + extends jni.JObjType> { + final jni.JObjType<$V> V; - static final _get_value = jniLookup< - ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_GrandParent_StaticParent_Child__value") - .asFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>(); + const $StringKeyedMapType( + this.V, + ); - 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)>(); + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;"; - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - $U get value => U.fromRef(_get_value(reference).object); + @override + StringKeyedMap<$V> fromRef(jni.JObjectPtr ref) => + StringKeyedMap.fromRef(V, ref); - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - set value($U value) => _set_value(reference, value.reference).check(); + @override + jni.JObjType get superType => $MyMapType(const jni.JStringType(), V); - 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)>(); + @override + final superCount = 2; - /// 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.fromRef( - S, - U, - _new0($parent.reference, parentValue.reference, value.reference) - .object); + @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; } } -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; +/// from: com.github.dart_lang.jnigen.generics.StringStack +class StringStack extends MyStack { + @override + late final jni.JObjType $type = type; - const $GrandParent_StaticParent_ChildType( - this.S, - this.U, - ); + StringStack.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(const jni.JStringType(), ref); + + /// 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.fromRef(_new0().object); + } +} + +final class $StringStackType extends jni.JObjType { + const $StringStackType(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringStack;"; @override - GrandParent_StaticParent_Child<$S, $U> fromRef(jni.JObjectPtr ref) => - GrandParent_StaticParent_Child.fromRef(S, U, ref); + StringStack fromRef(jni.JObjectPtr ref) => StringStack.fromRef(ref); @override - jni.JObjType get superType => const jni.JObjectType(); + jni.JObjType get superType => const $MyStackType(jni.JStringType()); @override - final superCount = 1; + final superCount = 2; @override - int get hashCode => Object.hash($GrandParent_StaticParent_ChildType, S, U); + int get hashCode => ($StringStackType).hashCode; @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; + return other.runtimeType == ($StringStackType) && other is $StringStackType; } } -/// from: com.github.dart_lang.jnigen.generics.MyMap -class MyMap<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObject { +/// 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, V); + late final jni.JObjType> $type = type(K); final jni.JObjType<$K> K; - final jni.JObjType<$V> V; - MyMap.fromRef( + StringValuedMap.fromRef( this.K, - this.V, jni.JObjectPtr ref, - ) : super.fromRef(ref); + ) : super.fromRef(K, const jni.JStringType(), ref); /// 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>( + static $StringValuedMapType<$K> type<$K extends jni.JObject>( jni.JObjType<$K> K, - jni.JObjType<$V> V, ) { - return $MyMapType( + return $StringValuedMapType( K, - V, ); } - static final _new0 = - jniLookup>("MyMap__new0") - .asFunction(); + static final _new0 = jniLookup>( + "StringValuedMap__new0") + .asFunction(); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory MyMap({ + factory StringValuedMap({ required jni.JObjType<$K> K, - required jni.JObjType<$V> V, }) { - return MyMap.fromRef(K, V, _new0().object); - } - - 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 V.fromRef(_get0(reference, key.reference).object); - } - - 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 V.fromRef(_put(reference, key.reference, value.reference).object); - } - - static final _entryStack = jniLookup< - ffi - .NativeFunction)>>( - "MyMap__entryStack") - .asFunction)>(); - - /// 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 const $MyStackType( - $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType())) - .fromRef(_entryStack(reference).object); + return StringValuedMap.fromRef(K, _new0().object); } } -final class $MyMapType<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObjType> { +final class $StringValuedMapType<$K extends jni.JObject> + extends jni.JObjType> { final jni.JObjType<$K> K; - final jni.JObjType<$V> V; - const $MyMapType( + const $StringValuedMapType( this.K, - this.V, ); @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyMap;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/generics/StringValuedMap;"; @override - MyMap<$K, $V> fromRef(jni.JObjectPtr ref) => MyMap.fromRef(K, V, ref); + StringValuedMap<$K> fromRef(jni.JObjectPtr ref) => + StringValuedMap.fromRef(K, ref); @override - jni.JObjType get superType => const jni.JObjectType(); + jni.JObjType get superType => $MyMapType(K, const jni.JStringType()); @override - final superCount = 1; + final superCount = 2; @override - int get hashCode => Object.hash($MyMapType, K, V); + int get hashCode => Object.hash($StringValuedMapType, K); @override bool operator ==(Object other) { - return other.runtimeType == ($MyMapType<$K, $V>) && - other is $MyMapType<$K, $V> && - K == other.K && - V == other.V; + return other.runtimeType == ($StringValuedMapType<$K>) && + other is $StringValuedMapType<$K> && + K == other.K; } } -/// from: com.github.dart_lang.jnigen.generics.MyMap$MyEntry -class MyMap_MyEntry<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObject { +/// from: com.github.dart_lang.jnigen.interfaces.MyInterface +class MyInterface<$T extends jni.JObject> extends jni.JObject { @override - late final jni.JObjType> $type = type(K, V); + late final jni.JObjType> $type = type(T); - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; + final jni.JObjType<$T> T; - MyMap_MyEntry.fromRef( - this.K, - this.V, + MyInterface.fromRef( + this.T, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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, + static $MyInterfaceType<$T> type<$T extends jni.JObject>( + jni.JObjType<$T> T, ) { - return $MyMap_MyEntryType( - K, - V, + return $MyInterfaceType( + T, ); } - static final _get_key = jniLookup< + static final _voidCallback = jniLookup< ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_MyMap_MyEntry__key") + jni.JniResult Function(ffi.Pointer, + ffi.Pointer)>>("MyInterface__voidCallback") .asFunction< jni.JniResult Function( - jni.JObjectPtr, - )>(); + ffi.Pointer, ffi.Pointer)>(); - static final _set_key = jniLookup< + /// from: public abstract void voidCallback(java.lang.String s) + void voidCallback( + jni.JString s, + ) { + return _voidCallback(reference, s.reference).check(); + } + + static final _stringCallback = jniLookup< ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_MyMap_MyEntry__key") + jni.JniResult Function(ffi.Pointer, + ffi.Pointer)>>("MyInterface__stringCallback") .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 => K.fromRef(_get_key(reference).object); + jni.JniResult Function( + ffi.Pointer, ffi.Pointer)>(); - /// from: public K key + /// from: public abstract java.lang.String stringCallback(java.lang.String s) /// The returned object must be released after use, by calling the [release] method. - set key($K value) => _set_key(reference, value.reference).check(); + jni.JString stringCallback( + jni.JString s, + ) { + return const jni.JStringType() + .fromRef(_stringCallback(reference, s.reference).object); + } - static final _get_value = jniLookup< + static final _varCallback = jniLookup< ffi.NativeFunction< - jni.JniResult Function( - jni.JObjectPtr, - )>>("get_MyMap_MyEntry__value") + jni.JniResult Function(ffi.Pointer, + ffi.Pointer)>>("MyInterface__varCallback") .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 => V.fromRef(_get_value(reference).object); + ffi.Pointer, ffi.Pointer)>(); - /// from: public V value + /// from: public abstract T varCallback(T t) /// The returned object must be released after use, by calling the [release] method. - set value($V value) => _set_value(reference, value.reference).check(); + $T varCallback( + $T t, + ) { + return T.fromRef(_varCallback(reference, t.reference).object); + } - static final _new0 = jniLookup< + static final _manyPrimitives = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>("MyMap_MyEntry__new0") + ffi.Int32, + ffi.Uint8, + ffi.Uint16, + ffi.Double)>>("MyInterface__manyPrimitives") .asFunction< - jni.JniResult Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + jni.JniResult Function( + ffi.Pointer, int, int, int, double)>(); - /// 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.fromRef( - K, V, _new0($parent.reference, key.reference, value.reference).object); + /// 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, a, b ? 1 : 0, c, d).long; } -} - -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> fromRef(jni.JObjectPtr ref) => - MyMap_MyEntry.fromRef(K, V, ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - @override - int get hashCode => Object.hash($MyMap_MyEntryType, K, V); + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyMap_MyEntryType<$K, $V>) && - other is $MyMap_MyEntryType<$K, $V> && - K == other.K && - V == other.V; + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); } -} - -/// 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.fromRef( - this.T, - jni.JObjectPtr ref, - ) : super.fromRef(ref); + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - /// The type which includes information such as the signature of this class. - static $MyStackType<$T> type<$T extends jni.JObject>( - jni.JObjType<$T> T, + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, ) { - return $MyStackType( - T, - ); + 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()).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()).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).toPointer(); + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e.toString()); + } + return jni.nullptr; } - 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.fromRef(T, _new0().object); - } - - 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 $MyStackType(T).fromRef(_fromArray(arr.reference).object); - } - - 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 $MyStackType(S) - .fromRef(_fromArrayOfArrayOfGrandParents(arr.reference).object); + factory MyInterface.implement( + $MyInterfaceImpl<$T> $impl, + ) { + final $p = ReceivePort(); + final $x = MyInterface.fromRef( + $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; +} - 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>({ +abstract interface class $MyInterfaceImpl<$T extends jni.JObject> { + factory $MyInterfaceImpl({ required jni.JObjType<$T> T, - }) { - return $MyStackType(T).fromRef(_of().object); - } + 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; - static final _of1 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("MyStack__of1") - .asFunction)>(); + jni.JObjType<$T> get T; - /// 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 $MyStackType(T).fromRef(_of1(obj.reference).object); - } + 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); +} - static final _of2 = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyStack__of2") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); +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; - /// 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 $MyStackType(T).fromRef(_of2(obj.reference, obj2.reference).object); - } + @override + final jni.JObjType<$T> T; - static final _push = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyStack__push") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + 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; - /// from: public void push(T item) - void push( - $T item, - ) { - return _push(reference, item.reference).check(); + void voidCallback(jni.JString s) { + return _voidCallback(s); } - static final _pop = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("MyStack__pop") - .asFunction)>(); - - /// from: public T pop() - /// The returned object must be released after use, by calling the [release] method. - $T pop() { - return T.fromRef(_pop(reference).object); + jni.JString stringCallback(jni.JString s) { + return _stringCallback(s); } - static final _size = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer)>>("MyStack__size") - .asFunction)>(); + $T varCallback($T t) { + return _varCallback(t); + } - /// from: public int size() - int size() { - return _size(reference).integer; + int manyPrimitives(int a, bool b, int c, double d) { + return _manyPrimitives(a, b, c, d); } } -final class $MyStackType<$T extends jni.JObject> - extends jni.JObjType> { +final class $MyInterfaceType<$T extends jni.JObject> + extends jni.JObjType> { final jni.JObjType<$T> T; - const $MyStackType( + const $MyInterfaceType( this.T, ); @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyStack;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/interfaces/MyInterface;"; @override - MyStack<$T> fromRef(jni.JObjectPtr ref) => MyStack.fromRef(T, ref); + MyInterface<$T> fromRef(jni.JObjectPtr ref) => MyInterface.fromRef(T, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3019,335 +2755,463 @@ final class $MyStackType<$T extends jni.JObject> final superCount = 1; @override - int get hashCode => Object.hash($MyStackType, T); + int get hashCode => Object.hash($MyInterfaceType, T); @override bool operator ==(Object other) { - return other.runtimeType == ($MyStackType<$T>) && - other is $MyStackType<$T> && + return other.runtimeType == ($MyInterfaceType<$T>) && + other is $MyInterfaceType<$T> && T == other.T; } } -/// from: com.github.dart_lang.jnigen.generics.StringKeyedMap -class StringKeyedMap<$V extends jni.JObject> extends MyMap { +/// from: com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer +class MyInterfaceConsumer extends jni.JObject { @override - late final jni.JObjType> $type = type(V); - - final jni.JObjType<$V> V; + late final jni.JObjType $type = type; - StringKeyedMap.fromRef( - this.V, + MyInterfaceConsumer.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(const jni.JStringType(), V, ref); + ) : super.fromRef(ref); /// 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 const type = $MyInterfaceConsumerType(); static final _new0 = jniLookup>( - "StringKeyedMap__new0") + "MyInterfaceConsumer__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.fromRef(V, _new0().object); + factory MyInterfaceConsumer() { + return MyInterfaceConsumer.fromRef(_new0().object); } -} - -final class $StringKeyedMapType<$V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$V> V; - const $StringKeyedMapType( - this.V, - ); + 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>; + return _consumeOnAnotherThread( + myInterface.reference, s.reference, a, b ? 1 : 0, c, d, t.reference) + .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>; + return _consumeOnSameThread( + myInterface.reference, s.reference, a, b ? 1 : 0, c, d, t.reference) + .check(); + } +} + +final class $MyInterfaceConsumerType extends jni.JObjType { + const $MyInterfaceConsumerType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;"; + r"Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;"; @override - StringKeyedMap<$V> fromRef(jni.JObjectPtr ref) => - StringKeyedMap.fromRef(V, ref); + MyInterfaceConsumer fromRef(jni.JObjectPtr ref) => + MyInterfaceConsumer.fromRef(ref); @override - jni.JObjType get superType => $MyMapType(const jni.JStringType(), V); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 2; + final superCount = 1; @override - int get hashCode => Object.hash($StringKeyedMapType, V); + int get hashCode => ($MyInterfaceConsumerType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($StringKeyedMapType<$V>) && - other is $StringKeyedMapType<$V> && - V == other.V; + return other.runtimeType == ($MyInterfaceConsumerType) && + other is $MyInterfaceConsumerType; } } -/// from: com.github.dart_lang.jnigen.generics.StringMap -class StringMap extends StringKeyedMap { +/// from: com.github.dart_lang.jnigen.interfaces.MyRunnable +class MyRunnable extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - StringMap.fromRef( + MyRunnable.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(const jni.JStringType(), ref); + ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $StringMapType(); - static final _new0 = - jniLookup>("StringMap__new0") - .asFunction(); + static const type = $MyRunnableType(); + static final _run = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer)>>("MyRunnable__run") + .asFunction)>(); - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringMap() { - return StringMap.fromRef(_new0().object); + /// from: public abstract void run() + void run() { + return _run(reference).check(); } -} - -final class $StringMapType extends jni.JObjType { - const $StringMapType(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringMap;"; - @override - StringMap fromRef(jni.JObjectPtr ref) => StringMap.fromRef(ref); + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; - @override - jni.JObjType get superType => const $StringKeyedMapType(jni.JStringType()); + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } - @override - final superCount = 3; + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - @override - int get hashCode => ($StringMapType).hashCode; + 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; + } - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringMapType) && other is $StringMapType; + factory MyRunnable.implement( + $MyRunnableImpl $impl, + ) { + final $p = ReceivePort(); + final $x = MyRunnable.fromRef( + 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; } } -/// from: com.github.dart_lang.jnigen.generics.StringStack -class StringStack extends MyStack { - @override - late final jni.JObjType $type = type; +abstract interface class $MyRunnableImpl { + factory $MyRunnableImpl({ + required void Function() run, + }) = _$MyRunnableImpl; - StringStack.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(const jni.JStringType(), ref); + void run(); +} - /// The type which includes information such as the signature of this class. - static const type = $StringStackType(); - static final _new0 = jniLookup>( - "StringStack__new0") - .asFunction(); +class _$MyRunnableImpl implements $MyRunnableImpl { + _$MyRunnableImpl({ + required void Function() run, + }) : _run = run; - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringStack() { - return StringStack.fromRef(_new0().object); + final void Function() _run; + + void run() { + return _run(); } } -final class $StringStackType extends jni.JObjType { - const $StringStackType(); +final class $MyRunnableType extends jni.JObjType { + const $MyRunnableType(); @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringStack;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;"; @override - StringStack fromRef(jni.JObjectPtr ref) => StringStack.fromRef(ref); + MyRunnable fromRef(jni.JObjectPtr ref) => MyRunnable.fromRef(ref); @override - jni.JObjType get superType => const $MyStackType(jni.JStringType()); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 2; + final superCount = 1; @override - int get hashCode => ($StringStackType).hashCode; + int get hashCode => ($MyRunnableType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($StringStackType) && other is $StringStackType; + return other.runtimeType == ($MyRunnableType) && other is $MyRunnableType; } } -/// from: com.github.dart_lang.jnigen.generics.StringValuedMap -class StringValuedMap<$K extends jni.JObject> extends MyMap<$K, jni.JString> { +/// from: com.github.dart_lang.jnigen.interfaces.MyRunnableRunner +class MyRunnableRunner extends jni.JObject { @override - late final jni.JObjType> $type = type(K); - - final jni.JObjType<$K> K; + late final jni.JObjType $type = type; - StringValuedMap.fromRef( - this.K, + MyRunnableRunner.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(K, const jni.JStringType(), ref); + ) : super.fromRef(ref); /// 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.fromRef(K, _new0().object); + 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 => + const jni.JObjectType().fromRef(_get_error(reference).object); + + /// 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, value.reference).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.fromRef(_new0(runnable.reference).object); } -} -final class $StringValuedMapType<$K extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; + static final _runOnSameThread = jniLookup< + ffi + .NativeFunction)>>( + "MyRunnableRunner__runOnSameThread") + .asFunction)>(); - const $StringValuedMapType( - this.K, - ); + /// from: public void runOnSameThread() + void runOnSameThread() { + return _runOnSameThread(reference).check(); + } + + static final _runOnAnotherThread = jniLookup< + ffi + .NativeFunction)>>( + "MyRunnableRunner__runOnAnotherThread") + .asFunction)>(); + + /// from: public void runOnAnotherThread() + void runOnAnotherThread() { + return _runOnAnotherThread(reference).check(); + } +} + +final class $MyRunnableRunnerType extends jni.JObjType { + const $MyRunnableRunnerType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/StringValuedMap;"; + r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;"; @override - StringValuedMap<$K> fromRef(jni.JObjectPtr ref) => - StringValuedMap.fromRef(K, ref); + MyRunnableRunner fromRef(jni.JObjectPtr ref) => MyRunnableRunner.fromRef(ref); @override - jni.JObjType get superType => $MyMapType(K, const jni.JStringType()); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 2; + final superCount = 1; @override - int get hashCode => Object.hash($StringValuedMapType, K); + int get hashCode => ($MyRunnableRunnerType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($StringValuedMapType<$K>) && - other is $StringValuedMapType<$K> && - K == other.K; + return other.runtimeType == ($MyRunnableRunnerType) && + other is $MyRunnableRunnerType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyInterface -class MyInterface<$T extends jni.JObject> extends jni.JObject { +/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable$Case +class JsonSerializable_Case extends jni.JObject { @override - late final jni.JObjType> $type = type(T); - - final jni.JObjType<$T> T; + late final jni.JObjType $type = type; - MyInterface.fromRef( - this.T, + JsonSerializable_Case.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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)>(); + static const type = $JsonSerializable_CaseType(); + static final _values = + jniLookup>( + "JsonSerializable_Case__values") + .asFunction(); - /// from: public abstract void voidCallback(java.lang.String s) - void voidCallback( - jni.JString s, - ) { - return _voidCallback(reference, s.reference).check(); + /// 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 const jni.JArrayType($JsonSerializable_CaseType()) + .fromRef(_values().object); } - static final _stringCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyInterface__stringCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); + static final _valueOf = jniLookup< + ffi + .NativeFunction)>>( + "JsonSerializable_Case__valueOf") + .asFunction)>(); - /// from: public abstract java.lang.String stringCallback(java.lang.String s) + /// 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. - jni.JString stringCallback( - jni.JString s, + static JsonSerializable_Case valueOf( + jni.JString name, ) { - return const jni.JStringType() - .fromRef(_stringCallback(reference, s.reference).object); + return const $JsonSerializable_CaseType() + .fromRef(_valueOf(name.reference).object); } +} - static final _varCallback = jniLookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - ffi.Pointer)>>("MyInterface__varCallback") - .asFunction< - jni.JniResult Function( - ffi.Pointer, ffi.Pointer)>(); +final class $JsonSerializable_CaseType + extends jni.JObjType { + const $JsonSerializable_CaseType(); - /// 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 T.fromRef(_varCallback(reference, t.reference).object); + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"; + + @override + JsonSerializable_Case fromRef(jni.JObjectPtr ref) => + JsonSerializable_Case.fromRef(ref); + + @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; } +} - 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: com.github.dart_lang.jnigen.annotations.JsonSerializable +class JsonSerializable extends jni.JObject { + @override + late final jni.JObjType $type = type; - /// 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, a, b ? 1 : 0, c, d).long; + JsonSerializable.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// The type which includes information such as the signature of this class. + static const type = $JsonSerializableType(); + static final _value = jniLookup< + ffi + .NativeFunction)>>( + "JsonSerializable__value") + .asFunction)>(); + + /// 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 const $JsonSerializable_CaseType().fromRef(_value(reference).object); } /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; + static final Map _$impls = {}; ReceivePort? _$p; static jni.JObjectPtr _$invoke( @@ -3378,55 +3242,24 @@ class MyInterface<$T extends jni.JObject> extends jni.JObject { 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()).toPointer(); - } - if ($d == r"varCallback(Ljava/lang/Object;)Ljava/lang/Object;") { - final $r = _$impls[$p]!.varCallback( - $a[0].castTo(_$impls[$p]!.T, releaseOriginal: true), - ); + 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()).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).toPointer(); - } } catch (e) { return ProtectedJniExtensions.newDartException(e.toString()); } return jni.nullptr; } - factory MyInterface.implement( - $MyInterfaceImpl<$T> $impl, + factory JsonSerializable.implement( + $JsonSerializableImpl $impl, ) { final $p = ReceivePort(); - final $x = MyInterface.fromRef( - $impl.T, + final $x = JsonSerializable.fromRef( ProtectedJniExtensions.newPortProxy( - r"com.github.dart_lang.jnigen.interfaces.MyInterface", + r"com.github.dart_lang.jnigen.annotations.JsonSerializable", $p, _$invokePointer, ), @@ -3445,78 +3278,85 @@ class MyInterface<$T extends jni.JObject> extends jni.JObject { }); 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; +abstract interface class $JsonSerializableImpl { + factory $JsonSerializableImpl({ + required JsonSerializable_Case Function() value, + }) = _$JsonSerializableImpl; - jni.JObjType<$T> get T; + JsonSerializable_Case value(); +} - 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 _$JsonSerializableImpl implements $JsonSerializableImpl { + _$JsonSerializableImpl({ + required JsonSerializable_Case Function() value, + }) : _value = value; + + final JsonSerializable_Case Function() _value; + + JsonSerializable_Case value() { + return _value(); + } } -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; +final class $JsonSerializableType extends jni.JObjType { + const $JsonSerializableType(); @override - final jni.JObjType<$T> T; + String get signature => + r"Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;"; - 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; + @override + JsonSerializable fromRef(jni.JObjectPtr ref) => JsonSerializable.fromRef(ref); - void voidCallback(jni.JString s) { - return _voidCallback(s); - } + @override + jni.JObjType get superType => const jni.JObjectType(); - jni.JString stringCallback(jni.JString s) { - return _stringCallback(s); - } + @override + final superCount = 1; - $T varCallback($T t) { - return _varCallback(t); - } + @override + int get hashCode => ($JsonSerializableType).hashCode; - int manyPrimitives(int a, bool b, int c, double d) { - return _manyPrimitives(a, b, c, d); + @override + bool operator ==(Object other) { + return other.runtimeType == ($JsonSerializableType) && + other is $JsonSerializableType; } } -final class $MyInterfaceType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; +/// from: com.github.dart_lang.jnigen.annotations.MyDataClass +class MyDataClass extends jni.JObject { + @override + late final jni.JObjType $type = type; - const $MyInterfaceType( - this.T, - ); + MyDataClass.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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.fromRef(_new0().object); + } +} + +final class $MyDataClassType extends jni.JObjType { + const $MyDataClassType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyInterface;"; + r"Lcom/github/dart_lang/jnigen/annotations/MyDataClass;"; @override - MyInterface<$T> fromRef(jni.JObjectPtr ref) => MyInterface.fromRef(T, ref); + MyDataClass fromRef(jni.JObjectPtr ref) => MyDataClass.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3525,118 +3365,57 @@ final class $MyInterfaceType<$T extends jni.JObject> final superCount = 1; @override - int get hashCode => Object.hash($MyInterfaceType, T); + int get hashCode => ($MyDataClassType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceType<$T>) && - other is $MyInterfaceType<$T> && - T == other.T; + return other.runtimeType == ($MyDataClassType) && other is $MyDataClassType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer -class MyInterfaceConsumer extends jni.JObject { +/// from: com.github.dart_lang.jnigen.simple_package.Color +class Color extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyInterfaceConsumer.fromRef( + Color.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $MyInterfaceConsumerType(); - static final _new0 = jniLookup>( - "MyInterfaceConsumer__new0") - .asFunction(); + static const type = $ColorType(); + static final _values = + jniLookup>("Color__values") + .asFunction(); - /// from: public void () + /// 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. - factory MyInterfaceConsumer() { - return MyInterfaceConsumer.fromRef(_new0().object); - } - - 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>; - return _consumeOnAnotherThread( - myInterface.reference, s.reference, a, b ? 1 : 0, c, d, t.reference) - .check(); + static jni.JArray values() { + return const jni.JArrayType($ColorType()).fromRef(_values().object); } - 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)>(); + static final _valueOf = jniLookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer)>>("Color__valueOf") + .asFunction)>(); - /// 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>; - return _consumeOnSameThread( - myInterface.reference, s.reference, a, b ? 1 : 0, c, d, t.reference) - .check(); + /// 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 const $ColorType().fromRef(_valueOf(name.reference).object); } } -final class $MyInterfaceConsumerType extends jni.JObjType { - const $MyInterfaceConsumerType(); +final class $ColorType extends jni.JObjType { + const $ColorType(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;"; + String get signature => r"Lcom/github/dart_lang/jnigen/simple_package/Color;"; @override - MyInterfaceConsumer fromRef(jni.JObjectPtr ref) => - MyInterfaceConsumer.fromRef(ref); + Color fromRef(jni.JObjectPtr ref) => Color.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3645,134 +3424,495 @@ final class $MyInterfaceConsumerType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($MyInterfaceConsumerType).hashCode; + int get hashCode => ($ColorType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceConsumerType) && - other is $MyInterfaceConsumerType; + return other.runtimeType == ($ColorType) && other is $ColorType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyRunnable -class MyRunnable extends jni.JObject { +/// from: com.github.dart_lang.jnigen.simple_package.Exceptions +class Exceptions extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyRunnable.fromRef( + Exceptions.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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)>(); + static const type = $ExceptionsType(); + static final _new0 = jniLookup>( + "Exceptions__new0") + .asFunction(); - /// from: public abstract void run() - void run() { - return _run(reference).check(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory Exceptions() { + return Exceptions.fromRef(_new0().object); } - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; + static final _new1 = + jniLookup>( + "Exceptions__new1") + .asFunction(); - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, + /// from: public void (float x) + /// The returned object must be released after use, by calling the [release] method. + factory Exceptions.new1( + double x, ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); + return Exceptions.fromRef(_new1(x).object); } - static final ffi.Pointer< + static final _new2 = jniLookup< ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, + ffi.Int32, ffi.Int32)>>("Exceptions__new2") + .asFunction(); - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, + /// 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, ) { - 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; + return Exceptions.fromRef(_new2(a, b, c, d, e, f).object); } - factory MyRunnable.implement( - $MyRunnableImpl $impl, - ) { - final $p = ReceivePort(); - final $x = MyRunnable.fromRef( - 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; + 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 const jni.JObjectType().fromRef(_staticObjectMethod().object); + } + + 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 const jni.JArrayType(jni.JObjectType()) + .fromRef(_staticObjectArrayMethod().object); + } + + 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 const jni.JArrayType(jni.jintType()) + .fromRef(_staticIntArrayMethod().object); + } + + static final _objectMethod = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__objectMethod") + .asFunction)>(); + + /// from: public java.lang.Object objectMethod() + /// The returned object must be released after use, by calling the [release] method. + jni.JObject objectMethod() { + return const jni.JObjectType().fromRef(_objectMethod(reference).object); + } + + static final _intMethod = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__intMethod") + .asFunction)>(); + + /// from: public int intMethod() + int intMethod() { + return _intMethod(reference).integer; + } + + static final _objectArrayMethod = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__objectArrayMethod") + .asFunction)>(); + + /// from: public java.lang.Object[] objectArrayMethod() + /// The returned object must be released after use, by calling the [release] method. + jni.JArray objectArrayMethod() { + return const jni.JArrayType(jni.JObjectType()) + .fromRef(_objectArrayMethod(reference).object); + } + + static final _intArrayMethod = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__intArrayMethod") + .asFunction)>(); + + /// from: public int[] intArrayMethod() + /// The returned object must be released after use, by calling the [release] method. + jni.JArray intArrayMethod() { + return const jni.JArrayType(jni.jintType()) + .fromRef(_intArrayMethod(reference).object); + } + + static final _throwNullPointerException = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__throwNullPointerException") + .asFunction)>(); + + /// from: public int throwNullPointerException() + int throwNullPointerException() { + return _throwNullPointerException(reference).integer; + } + + static final _throwFileNotFoundException = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__throwFileNotFoundException") + .asFunction)>(); + + /// from: public java.io.InputStream throwFileNotFoundException() + /// The returned object must be released after use, by calling the [release] method. + jni.JObject throwFileNotFoundException() { + return const jni.JObjectType() + .fromRef(_throwFileNotFoundException(reference).object); + } + + static final _throwClassCastException = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__throwClassCastException") + .asFunction)>(); + + /// from: public java.io.FileInputStream throwClassCastException() + /// The returned object must be released after use, by calling the [release] method. + jni.JObject throwClassCastException() { + return const jni.JObjectType() + .fromRef(_throwClassCastException(reference).object); + } + + static final _throwArrayIndexException = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__throwArrayIndexException") + .asFunction)>(); + + /// from: public int throwArrayIndexException() + int throwArrayIndexException() { + return _throwArrayIndexException(reference).integer; + } + + static final _throwArithmeticException = jniLookup< + ffi + .NativeFunction)>>( + "Exceptions__throwArithmeticException") + .asFunction)>(); + + /// from: public int throwArithmeticException() + int throwArithmeticException() { + return _throwArithmeticException(reference).integer; + } + + static final _throwLoremIpsum = + jniLookup>( + "Exceptions__throwLoremIpsum") + .asFunction(); + + /// from: static public void throwLoremIpsum() + static void throwLoremIpsum() { + return _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 fromRef(jni.JObjectPtr ref) => Exceptions.fromRef(ref); + + @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; } } -abstract interface class $MyRunnableImpl { - factory $MyRunnableImpl({ - required void Function() run, - }) = _$MyRunnableImpl; +/// from: com.github.dart_lang.jnigen.simple_package.Fields +class Fields extends jni.JObject { + @override + late final jni.JObjType $type = type; + + Fields.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + /// 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 => + const jni.JStringType().fromRef(_get_name().object); + + /// 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).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 => + const jni.JIntegerType().fromRef(_get_i(reference).object); + + /// 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, value.reference).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).long; + + /// from: public long trillion + set trillion(int value) => _set_trillion(reference, 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).boolean; + + /// from: public boolean isAchillesDead + set isAchillesDead(bool value) => + _set_isAchillesDead(reference, 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 => const jni.JStringType() + .fromRef(_get_bestFighterInGreece(reference).object); + + /// 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, value.reference).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 => + const jni.JObjectType().fromRef(_get_random(reference).object); + + /// 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, value.reference).check(); + + static final _get_euroSymbol = + jniLookup>( + "get_Fields__euroSymbol") + .asFunction(); + + static final _set_euroSymbol = + jniLookup>( + "set_Fields__euroSymbol") + .asFunction(); - void run(); -} + /// from: static public char euroSymbol + static int get euroSymbol => _get_euroSymbol().char; -class _$MyRunnableImpl implements $MyRunnableImpl { - _$MyRunnableImpl({ - required void Function() run, - }) : _run = run; + /// from: static public char euroSymbol + static set euroSymbol(int value) => _set_euroSymbol(value).check(); - final void Function() _run; + static final _new0 = + jniLookup>("Fields__new0") + .asFunction(); - void run() { - return _run(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory Fields() { + return Fields.fromRef(_new0().object); } } -final class $MyRunnableType extends jni.JObjType { - const $MyRunnableType(); +final class $FieldsType extends jni.JObjType { + const $FieldsType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;"; + r"Lcom/github/dart_lang/jnigen/simple_package/Fields;"; @override - MyRunnable fromRef(jni.JObjectPtr ref) => MyRunnable.fromRef(ref); + Fields fromRef(jni.JObjectPtr ref) => Fields.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3781,98 +3921,88 @@ final class $MyRunnableType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($MyRunnableType).hashCode; + int get hashCode => ($FieldsType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableType) && other is $MyRunnableType; + return other.runtimeType == ($FieldsType) && other is $FieldsType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyRunnableRunner -class MyRunnableRunner extends jni.JObject { +/// from: com.github.dart_lang.jnigen.simple_package.Fields$Nested +class Fields_Nested extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyRunnableRunner.fromRef( + Fields_Nested.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); /// The type which includes information such as the signature of this class. - static const type = $MyRunnableRunnerType(); - static final _get_error = jniLookup< + static const type = $Fields_NestedType(); + static final _get_hundred = jniLookup< ffi.NativeFunction< jni.JniResult Function( jni.JObjectPtr, - )>>("get_MyRunnableRunner__error") + )>>("get_Fields_Nested__hundred") .asFunction< jni.JniResult Function( jni.JObjectPtr, )>(); - static final _set_error = jniLookup< + static final _set_hundred = jniLookup< ffi.NativeFunction< - jni.JniResult Function(jni.JObjectPtr, - ffi.Pointer)>>("set_MyRunnableRunner__error") - .asFunction< - jni.JniResult Function(jni.JObjectPtr, ffi.Pointer)>(); + jni.JniResult Function( + jni.JObjectPtr, ffi.Int64)>>("set_Fields_Nested__hundred") + .asFunction(); - /// from: public java.lang.Throwable error - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get error => - const jni.JObjectType().fromRef(_get_error(reference).object); + /// from: public long hundred + int get hundred => _get_hundred(reference).long; - /// 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, value.reference).check(); + /// from: public long hundred + set hundred(int value) => _set_hundred(reference, value).check(); - static final _new0 = jniLookup< + static final _get_BEST_GOD = + jniLookup>( + "get_Fields_Nested__BEST_GOD") + .asFunction(); + + static final _set_BEST_GOD = jniLookup< ffi .NativeFunction)>>( - "MyRunnableRunner__new0") + "set_Fields_Nested__BEST_GOD") .asFunction)>(); - /// from: public void (com.github.dart_lang.jnigen.interfaces.MyRunnable runnable) + /// from: static public java.lang.String BEST_GOD /// The returned object must be released after use, by calling the [release] method. - factory MyRunnableRunner( - MyRunnable runnable, - ) { - return MyRunnableRunner.fromRef(_new0(runnable.reference).object); - } - - static final _runOnSameThread = jniLookup< - ffi - .NativeFunction)>>( - "MyRunnableRunner__runOnSameThread") - .asFunction)>(); + static jni.JString get BEST_GOD => + const jni.JStringType().fromRef(_get_BEST_GOD().object); - /// from: public void runOnSameThread() - void runOnSameThread() { - return _runOnSameThread(reference).check(); - } + /// 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).check(); - static final _runOnAnotherThread = jniLookup< - ffi - .NativeFunction)>>( - "MyRunnableRunner__runOnAnotherThread") - .asFunction)>(); + static final _new0 = jniLookup>( + "Fields_Nested__new0") + .asFunction(); - /// from: public void runOnAnotherThread() - void runOnAnotherThread() { - return _runOnAnotherThread(reference).check(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory Fields_Nested() { + return Fields_Nested.fromRef(_new0().object); } } -final class $MyRunnableRunnerType extends jni.JObjType { - const $MyRunnableRunnerType(); +final class $Fields_NestedType extends jni.JObjType { + const $Fields_NestedType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;"; + r"Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;"; @override - MyRunnableRunner fromRef(jni.JObjectPtr ref) => MyRunnableRunner.fromRef(ref); + Fields_Nested fromRef(jni.JObjectPtr ref) => Fields_Nested.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3881,65 +4011,73 @@ final class $MyRunnableRunnerType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($MyRunnableRunnerType).hashCode; + int get hashCode => ($Fields_NestedType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableRunnerType) && - other is $MyRunnableRunnerType; + return other.runtimeType == ($Fields_NestedType) && + other is $Fields_NestedType; } } -/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable$Case -class JsonSerializable_Case extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(S, K); - JsonSerializable_Case.fromRef( + final jni.JObjType<$S> S; + final jni.JObjType<$K> K; + + GenericTypeParams.fromRef( + this.S, + this.K, jni.JObjectPtr ref, ) : super.fromRef(ref); /// 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 const jni.JArrayType($JsonSerializable_CaseType()) - .fromRef(_values().object); + 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 _valueOf = jniLookup< - ffi - .NativeFunction)>>( - "JsonSerializable_Case__valueOf") - .asFunction)>(); + static final _new0 = jniLookup>( + "GenericTypeParams__new0") + .asFunction(); - /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case valueOf(java.lang.String name) + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case valueOf( - jni.JString name, - ) { - return const $JsonSerializable_CaseType() - .fromRef(_valueOf(name.reference).object); + factory GenericTypeParams({ + required jni.JObjType<$S> S, + required jni.JObjType<$K> K, + }) { + return GenericTypeParams.fromRef(S, K, _new0().object); } } -final class $JsonSerializable_CaseType - extends jni.JObjType { - const $JsonSerializable_CaseType(); +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/annotations/JsonSerializable$Case;"; + r"Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;"; @override - JsonSerializable_Case fromRef(jni.JObjectPtr ref) => - JsonSerializable_Case.fromRef(ref); + GenericTypeParams<$S, $K> fromRef(jni.JObjectPtr ref) => + GenericTypeParams.fromRef(S, K, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3948,58 +4086,59 @@ final class $JsonSerializable_CaseType final superCount = 1; @override - int get hashCode => ($JsonSerializable_CaseType).hashCode; + int get hashCode => Object.hash($GenericTypeParamsType, S, K); @override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_CaseType) && - other is $JsonSerializable_CaseType; + return other.runtimeType == ($GenericTypeParamsType<$S, $K>) && + other is $GenericTypeParamsType<$S, $K> && + S == other.S && + K == other.K; } } -/// from: com.github.dart_lang.jnigen.annotations.MyDataClass -class MyDataClass extends jni.JObject { +/// from: com.github.dart_lang.jnigen.generics.StringMap +class StringMap extends StringKeyedMap { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyDataClass.fromRef( + StringMap.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(ref); + ) : super.fromRef(const jni.JStringType(), ref); /// The type which includes information such as the signature of this class. - static const type = $MyDataClassType(); - static final _new0 = jniLookup>( - "MyDataClass__new0") - .asFunction(); + 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 MyDataClass() { - return MyDataClass.fromRef(_new0().object); + factory StringMap() { + return StringMap.fromRef(_new0().object); } } -final class $MyDataClassType extends jni.JObjType { - const $MyDataClassType(); +final class $StringMapType extends jni.JObjType { + const $StringMapType(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/annotations/MyDataClass;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringMap;"; @override - MyDataClass fromRef(jni.JObjectPtr ref) => MyDataClass.fromRef(ref); + StringMap fromRef(jni.JObjectPtr ref) => StringMap.fromRef(ref); @override - jni.JObjType get superType => const jni.JObjectType(); + jni.JObjType get superType => const $StringKeyedMapType(jni.JStringType()); @override - final superCount = 1; + final superCount = 3; @override - int get hashCode => ($MyDataClassType).hashCode; + int get hashCode => ($StringMapType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyDataClassType) && other is $MyDataClassType; + return other.runtimeType == ($StringMapType) && other is $StringMapType; } } diff --git a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart index cfb8fcf79d..619d75bed5 100644 --- a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart @@ -26,57 +26,139 @@ import "dart:ffi" as ffi; import "package:jni/internal_helpers_for_jnigen.dart"; import "package:jni/jni.dart" as jni; -/// from: com.github.dart_lang.jnigen.simple_package.Color -class Color extends jni.JObject { +/// 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; + late final jni.JObjType $type = type; - Color.fromRef( + Example_Nested_NestedTwice.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/simple_package/Color"); + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice"); /// The type which includes information such as the signature of this class. - static const type = $ColorType(); - static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"values", - r"()[Lcom/github/dart_lang/jnigen/simple_package/Color;"); + static const type = $Example_Nested_NestedTwiceType(); + static final _id_ZERO = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"ZERO", + r"I", + ); - /// from: static public com.github.dart_lang.jnigen.simple_package.Color[] values() + /// from: static public int ZERO + static int get ZERO => jni.Jni.accessors + .getStaticField(_class.reference, _id_ZERO, jni.JniCallType.intType) + .integer; + + /// from: static public int ZERO + static set ZERO(int value) => + jni.Jni.env.SetStaticIntField(_class.reference, _id_ZERO, value); + + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return const jni.JArrayType($ColorType()).fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_values, - jni.JniCallType.objectType, []).object); + factory Example_Nested_NestedTwice() { + return Example_Nested_NestedTwice.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } +} - static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"valueOf", - r"(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;"); +final class $Example_Nested_NestedTwiceType + extends jni.JObjType { + const $Example_Nested_NestedTwiceType(); - /// from: static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name) + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;"; + + @override + Example_Nested_NestedTwice fromRef(jni.JObjectPtr ref) => + Example_Nested_NestedTwice.fromRef(ref); + + @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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/simple_package/Example$Nested"); + + /// The type which includes information such as the signature of this class. + static const type = $Example_NestedType(); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"(Z)V"); + + /// from: public void (boolean value) /// The returned object must be released after use, by calling the [release] method. - static Color valueOf( - jni.JString name, + factory Example_Nested( + bool value, ) { - return const $ColorType().fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_valueOf, - jni.JniCallType.objectType, [name.reference]).object); + return Example_Nested.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, [value ? 1 : 0]).object); + } + + static final _id_usesAnonymousInnerClass = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"usesAnonymousInnerClass", r"()V"); + + /// from: public void usesAnonymousInnerClass() + void usesAnonymousInnerClass() { + return jni.Jni.accessors.callMethodWithArgs(reference, + _id_usesAnonymousInnerClass, jni.JniCallType.voidType, []).check(); + } + + static final _id_getValue = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"getValue", r"()Z"); + + /// from: public boolean getValue() + bool getValue() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_getValue, jni.JniCallType.booleanType, []).boolean; + } + + static final _id_setValue = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"setValue", r"(Z)V"); + + /// from: public void setValue(boolean value) + void setValue( + bool value, + ) { + return jni.Jni.accessors.callMethodWithArgs(reference, _id_setValue, + jni.JniCallType.voidType, [value ? 1 : 0]).check(); } } -final class $ColorType extends jni.JObjType { - const $ColorType(); +final class $Example_NestedType extends jni.JObjType { + const $Example_NestedType(); @override - String get signature => r"Lcom/github/dart_lang/jnigen/simple_package/Color;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;"; @override - Color fromRef(jni.JObjectPtr ref) => Color.fromRef(ref); + Example_Nested fromRef(jni.JObjectPtr ref) => Example_Nested.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -85,11 +167,82 @@ final class $ColorType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($ColorType).hashCode; + int get hashCode => ($Example_NestedType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($ColorType) && other is $ColorType; + 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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested"); + + /// The type which includes information such as the signature of this class. + static const type = $Example_NonStaticNestedType(); + static final _id_ok = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"ok", + r"Z", + ); + + /// from: public boolean ok + bool get ok => jni.Jni.accessors + .getField(reference, _id_ok, jni.JniCallType.booleanType) + .boolean; + + /// from: public boolean ok + set ok(bool value) => + jni.Jni.env.SetBooleanField(reference, _id_ok, value ? 1 : 0); + + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, + r"", r"(Lcom/github/dart_lang/jnigen/simple_package/Example;)V"); + + /// 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.fromRef(jni.Jni.accessors.newObjectWithArgs( + _class.reference, _id_new0, [$parent.reference]).object); + } +} + +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 fromRef(jni.JObjectPtr ref) => + Example_NonStaticNested.fromRef(ref); + + @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; } } @@ -754,71 +907,54 @@ final class $ExampleType extends jni.JObjType { } } -/// from: com.github.dart_lang.jnigen.simple_package.Example$Nested -class Example_Nested extends jni.JObject { +/// from: com.github.dart_lang.jnigen.pkg2.C2 +class C2 extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - Example_Nested.fromRef( + C2.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/simple_package/Example$Nested"); + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/pkg2/C2"); /// The type which includes information such as the signature of this class. - static const type = $Example_NestedType(); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"(Z)V"); + static const type = $C2Type(); + static final _id_CONSTANT = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"CONSTANT", + r"I", + ); - /// 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.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, [value ? 1 : 0]).object); - } + /// from: static public int CONSTANT + static int get CONSTANT => jni.Jni.accessors + .getStaticField(_class.reference, _id_CONSTANT, jni.JniCallType.intType) + .integer; - static final _id_usesAnonymousInnerClass = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"usesAnonymousInnerClass", r"()V"); + /// from: static public int CONSTANT + static set CONSTANT(int value) => + jni.Jni.env.SetStaticIntField(_class.reference, _id_CONSTANT, value); - /// from: public void usesAnonymousInnerClass() - void usesAnonymousInnerClass() { - return jni.Jni.accessors.callMethodWithArgs(reference, - _id_usesAnonymousInnerClass, jni.JniCallType.voidType, []).check(); - } - - static final _id_getValue = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"getValue", r"()Z"); - - /// from: public boolean getValue() - bool getValue() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_getValue, jni.JniCallType.booleanType, []).boolean; - } - - static final _id_setValue = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"setValue", r"(Z)V"); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - /// from: public void setValue(boolean value) - void setValue( - bool value, - ) { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_setValue, - jni.JniCallType.voidType, [value ? 1 : 0]).check(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory C2() { + return C2.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } -final class $Example_NestedType extends jni.JObjType { - const $Example_NestedType(); +final class $C2Type extends jni.JObjType { + const $C2Type(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;"; + String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/C2;"; @override - Example_Nested fromRef(jni.JObjectPtr ref) => Example_Nested.fromRef(ref); + C2 fromRef(jni.JObjectPtr ref) => C2.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -827,66 +963,56 @@ final class $Example_NestedType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($Example_NestedType).hashCode; + int get hashCode => ($C2Type).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($Example_NestedType) && - other is $Example_NestedType; + return other.runtimeType == ($C2Type) && other is $C2Type; } } -/// from: com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice -class Example_Nested_NestedTwice extends jni.JObject { +/// from: com.github.dart_lang.jnigen.pkg2.Example +class Example1 extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - Example_Nested_NestedTwice.fromRef( + Example1.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice"); + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/pkg2/Example"); /// The type which includes information such as the signature of this class. - static const type = $Example_Nested_NestedTwiceType(); - static final _id_ZERO = jni.Jni.accessors.getStaticFieldIDOf( - _class.reference, - r"ZERO", - r"I", - ); - - /// from: static public int ZERO - static int get ZERO => jni.Jni.accessors - .getStaticField(_class.reference, _id_ZERO, jni.JniCallType.intType) - .integer; - - /// from: static public int ZERO - static set ZERO(int value) => - jni.Jni.env.SetStaticIntField(_class.reference, _id_ZERO, value); - + static const type = $Example1Type(); static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory Example_Nested_NestedTwice() { - return Example_Nested_NestedTwice.fromRef(jni.Jni.accessors + factory Example1() { + return Example1.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); } + + static final _id_whichExample = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"whichExample", r"()I"); + + /// from: public int whichExample() + int whichExample() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_whichExample, jni.JniCallType.intType, []).integer; + } } -final class $Example_Nested_NestedTwiceType - extends jni.JObjType { - const $Example_Nested_NestedTwiceType(); +final class $Example1Type extends jni.JObjType { + const $Example1Type(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;"; + String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/Example;"; @override - Example_Nested_NestedTwice fromRef(jni.JObjectPtr ref) => - Example_Nested_NestedTwice.fromRef(ref); + Example1 fromRef(jni.JObjectPtr ref) => Example1.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -895,68 +1021,152 @@ final class $Example_Nested_NestedTwiceType final superCount = 1; @override - int get hashCode => ($Example_Nested_NestedTwiceType).hashCode; + int get hashCode => ($Example1Type).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested_NestedTwiceType) && - other is $Example_Nested_NestedTwiceType; + return other.runtimeType == ($Example1Type) && other is $Example1Type; } } -/// from: com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested -class Example_NonStaticNested extends jni.JObject { +/// 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; + late final jni.JObjType> $type = + type(T, S, U); - Example_NonStaticNested.fromRef( + final jni.JObjType<$T> T; + final jni.JObjType<$S> S; + final jni.JObjType<$U> U; + + GrandParent_Parent_Child.fromRef( + this.T, + this.S, + this.U, jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested"); + r"com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); /// The type which includes information such as the signature of this class. - static const type = $Example_NonStaticNestedType(); - static final _id_ok = jni.Jni.accessors.getFieldIDOf( + 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 _id_grandParentValue = jni.Jni.accessors.getFieldIDOf( _class.reference, - r"ok", - r"Z", + r"grandParentValue", + r"Ljava/lang/Object;", ); - /// from: public boolean ok - bool get ok => jni.Jni.accessors - .getField(reference, _id_ok, jni.JniCallType.booleanType) - .boolean; + /// from: public T grandParentValue + /// The returned object must be released after use, by calling the [release] method. + $T get grandParentValue => T.fromRef(jni.Jni.accessors + .getField(reference, _id_grandParentValue, jni.JniCallType.objectType) + .object); - /// from: public boolean ok - set ok(bool value) => - jni.Jni.env.SetBooleanField(reference, _id_ok, value ? 1 : 0); + /// from: public T grandParentValue + /// The returned object must be released after use, by calling the [release] method. + set grandParentValue($T value) => jni.Jni.env + .SetObjectField(reference, _id_grandParentValue, value.reference); - static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, - r"", r"(Lcom/github/dart_lang/jnigen/simple_package/Example;)V"); + static final _id_parentValue = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"parentValue", + r"Ljava/lang/Object;", + ); - /// from: public void (com.github.dart_lang.jnigen.simple_package.Example $parent) + /// from: public S parentValue /// The returned object must be released after use, by calling the [release] method. - factory Example_NonStaticNested( - Example $parent, - ) { - return Example_NonStaticNested.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_new0, [$parent.reference]).object); + $S get parentValue => S.fromRef(jni.Jni.accessors + .getField(reference, _id_parentValue, jni.JniCallType.objectType) + .object); + + /// from: public S parentValue + /// The returned object must be released after use, by calling the [release] method. + set parentValue($S value) => + jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); + + static final _id_value = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"value", + r"Ljava/lang/Object;", + ); + + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + $U get value => U.fromRef(jni.Jni.accessors + .getField(reference, _id_value, jni.JniCallType.objectType) + .object); + + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + set value($U value) => + jni.Jni.env.SetObjectField(reference, _id_value, value.reference); + + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"", + r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V"); + + /// 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.fromRef( + T, + S, + U, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, + [$parent.reference, newValue.reference]).object); } } -final class $Example_NonStaticNestedType - extends jni.JObjType { - const $Example_NonStaticNestedType(); +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/simple_package/Example$NonStaticNested;"; + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;"; @override - Example_NonStaticNested fromRef(jni.JObjectPtr ref) => - Example_NonStaticNested.fromRef(ref); + GrandParent_Parent_Child<$T, $S, $U> fromRef(jni.JObjectPtr ref) => + GrandParent_Parent_Child.fromRef(T, S, U, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -965,233 +1175,260 @@ final class $Example_NonStaticNestedType final superCount = 1; @override - int get hashCode => ($Example_NonStaticNestedType).hashCode; + int get hashCode => Object.hash($GrandParent_Parent_ChildType, T, S, U); @override bool operator ==(Object other) { - return other.runtimeType == ($Example_NonStaticNestedType) && - other is $Example_NonStaticNestedType; + 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.simple_package.Exceptions -class Exceptions extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(T, S); - Exceptions.fromRef( + final jni.JObjType<$T> T; + final jni.JObjType<$S> S; + + GrandParent_Parent.fromRef( + this.T, + this.S, jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/simple_package/Exceptions"); + r"com/github/dart_lang/jnigen/generics/GrandParent$Parent"); /// The type which includes information such as the signature of this class. - static const type = $ExceptionsType(); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory Exceptions() { - return Exceptions.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + 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 _id_new1 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"(F)V"); + static final _id_parentValue = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"parentValue", + r"Ljava/lang/Object;", + ); - /// from: public void (float x) + /// from: public T parentValue /// The returned object must be released after use, by calling the [release] method. - factory Exceptions.new1( - double x, - ) { - return Exceptions.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_new1, [jni.JValueFloat(x)]).object); - } - - static final _id_new2 = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"", r"(IIIIII)V"); + $T get parentValue => T.fromRef(jni.Jni.accessors + .getField(reference, _id_parentValue, jni.JniCallType.objectType) + .object); - /// from: public void (int a, int b, int c, int d, int e, int f) + /// from: public T parentValue /// 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.fromRef( - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new2, [ - jni.JValueInt(a), - jni.JValueInt(b), - jni.JValueInt(c), - jni.JValueInt(d), - jni.JValueInt(e), - jni.JValueInt(f) - ]).object); - } + set parentValue($T value) => + jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); - static final _id_staticObjectMethod = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, r"staticObjectMethod", r"()Ljava/lang/Object;"); + static final _id_value = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"value", + r"Ljava/lang/Object;", + ); - /// from: static public java.lang.Object staticObjectMethod() + /// from: public S value /// The returned object must be released after use, by calling the [release] method. - static jni.JObject staticObjectMethod() { - return const jni.JObjectType().fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_staticObjectMethod, - jni.JniCallType.objectType, []).object); - } - - static final _id_staticIntMethod = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"staticIntMethod", r"()I"); + $S get value => S.fromRef(jni.Jni.accessors + .getField(reference, _id_value, jni.JniCallType.objectType) + .object); - /// from: static public int staticIntMethod() - static int staticIntMethod() { - return jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, - _id_staticIntMethod, jni.JniCallType.intType, []).integer; - } + /// from: public S value + /// The returned object must be released after use, by calling the [release] method. + set value($S value) => + jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_staticObjectArrayMethod = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"staticObjectArrayMethod", - r"()[Ljava/lang/Object;"); + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"", + r"(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V"); - /// from: static public java.lang.Object[] staticObjectArrayMethod() + /// 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. - static jni.JArray staticObjectArrayMethod() { - return const jni.JArrayType(jni.JObjectType()).fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_staticObjectArrayMethod, - jni.JniCallType.objectType, []).object); + 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.fromRef( + T, + S, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, + [$parent.reference, newValue.reference]).object); } +} - static final _id_staticIntArrayMethod = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"staticIntArrayMethod", r"()[I"); +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; - /// from: static public int[] staticIntArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray staticIntArrayMethod() { - return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_staticIntArrayMethod, - jni.JniCallType.objectType, []).object); - } + const $GrandParent_ParentType( + this.T, + this.S, + ); - static final _id_objectMethod = jni.Jni.accessors.getMethodIDOf( - _class.reference, r"objectMethod", r"()Ljava/lang/Object;"); + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"; - /// from: public java.lang.Object objectMethod() - /// The returned object must be released after use, by calling the [release] method. - jni.JObject objectMethod() { - return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( - reference, _id_objectMethod, jni.JniCallType.objectType, []).object); - } + @override + GrandParent_Parent<$T, $S> fromRef(jni.JObjectPtr ref) => + GrandParent_Parent.fromRef(T, S, ref); - static final _id_intMethod = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"intMethod", r"()I"); + @override + jni.JObjType get superType => const jni.JObjectType(); - /// from: public int intMethod() - int intMethod() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_intMethod, jni.JniCallType.intType, []).integer; - } + @override + final superCount = 1; - static final _id_objectArrayMethod = jni.Jni.accessors.getMethodIDOf( - _class.reference, r"objectArrayMethod", r"()[Ljava/lang/Object;"); + @override + int get hashCode => Object.hash($GrandParent_ParentType, T, S); - /// from: public java.lang.Object[] objectArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - jni.JArray objectArrayMethod() { - return const jni.JArrayType(jni.JObjectType()).fromRef(jni.Jni.accessors - .callMethodWithArgs(reference, _id_objectArrayMethod, - jni.JniCallType.objectType, []).object); + @override + bool operator ==(Object other) { + return other.runtimeType == ($GrandParent_ParentType<$T, $S>) && + other is $GrandParent_ParentType<$T, $S> && + T == other.T && + S == other.S; } +} - static final _id_intArrayMethod = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"intArrayMethod", r"()[I"); +/// 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); - /// from: public int[] intArrayMethod() - /// The returned object must be released after use, by calling the [release] method. - jni.JArray intArrayMethod() { - return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors - .callMethodWithArgs(reference, _id_intArrayMethod, - jni.JniCallType.objectType, []).object); - } + final jni.JObjType<$S> S; + final jni.JObjType<$U> U; - static final _id_throwNullPointerException = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"throwNullPointerException", r"()I"); + GrandParent_StaticParent_Child.fromRef( + this.S, + this.U, + jni.JObjectPtr ref, + ) : super.fromRef(ref); - /// from: public int throwNullPointerException() - int throwNullPointerException() { - return jni.Jni.accessors.callMethodWithArgs(reference, - _id_throwNullPointerException, jni.JniCallType.intType, []).integer; + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); + + /// 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 _id_throwFileNotFoundException = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"throwFileNotFoundException", - r"()Ljava/io/InputStream;"); + static final _id_parentValue = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"parentValue", + r"Ljava/lang/Object;", + ); - /// from: public java.io.InputStream throwFileNotFoundException() + /// from: public S parentValue /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwFileNotFoundException() { - return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( - reference, - _id_throwFileNotFoundException, - jni.JniCallType.objectType, []).object); - } + $S get parentValue => S.fromRef(jni.Jni.accessors + .getField(reference, _id_parentValue, jni.JniCallType.objectType) + .object); - static final _id_throwClassCastException = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"throwClassCastException", - r"()Ljava/io/FileInputStream;"); - - /// from: public java.io.FileInputStream throwClassCastException() + /// from: public S parentValue /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwClassCastException() { - return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( - reference, - _id_throwClassCastException, - jni.JniCallType.objectType, []).object); - } - - static final _id_throwArrayIndexException = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"throwArrayIndexException", r"()I"); + set parentValue($S value) => + jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); - /// from: public int throwArrayIndexException() - int throwArrayIndexException() { - return jni.Jni.accessors.callMethodWithArgs(reference, - _id_throwArrayIndexException, jni.JniCallType.intType, []).integer; - } + static final _id_value = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"value", + r"Ljava/lang/Object;", + ); - static final _id_throwArithmeticException = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"throwArithmeticException", r"()I"); + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + $U get value => U.fromRef(jni.Jni.accessors + .getField(reference, _id_value, jni.JniCallType.objectType) + .object); - /// from: public int throwArithmeticException() - int throwArithmeticException() { - return jni.Jni.accessors.callMethodWithArgs(reference, - _id_throwArithmeticException, jni.JniCallType.intType, []).integer; - } + /// from: public U value + /// The returned object must be released after use, by calling the [release] method. + set value($U value) => + jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_throwLoremIpsum = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"throwLoremIpsum", r"()V"); + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"", + r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V"); - /// from: static public void throwLoremIpsum() - static void throwLoremIpsum() { - return jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, - _id_throwLoremIpsum, jni.JniCallType.voidType, []).check(); + /// 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.fromRef( + S, + U, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, [ + $parent.reference, + parentValue.reference, + value.reference + ]).object); } } -final class $ExceptionsType extends jni.JObjType { - const $ExceptionsType(); +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/simple_package/Exceptions;"; + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;"; @override - Exceptions fromRef(jni.JObjectPtr ref) => Exceptions.fromRef(ref); + GrandParent_StaticParent_Child<$S, $U> fromRef(jni.JObjectPtr ref) => + GrandParent_StaticParent_Child.fromRef(S, U, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1200,209 +1437,260 @@ final class $ExceptionsType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($ExceptionsType).hashCode; + int get hashCode => Object.hash($GrandParent_StaticParent_ChildType, S, U); @override bool operator ==(Object other) { - return other.runtimeType == ($ExceptionsType) && other is $ExceptionsType; + 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.simple_package.Fields -class Fields extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(S); - Fields.fromRef( + final jni.JObjType<$S> S; + + GrandParent_StaticParent.fromRef( + this.S, jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/simple_package/Fields"); + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); /// The type which includes information such as the signature of this class. - static const type = $FieldsType(); - static final _id_amount = jni.Jni.accessors.getStaticFieldIDOf( - _class.reference, - r"amount", - r"I", - ); - - /// from: static public int amount - static int get amount => jni.Jni.accessors - .getStaticField(_class.reference, _id_amount, jni.JniCallType.intType) - .integer; - - /// from: static public int amount - static set amount(int value) => - jni.Jni.env.SetStaticIntField(_class.reference, _id_amount, value); - - static final _id_pi = jni.Jni.accessors.getStaticFieldIDOf( - _class.reference, - r"pi", - r"D", - ); - - /// from: static public double pi - static double get pi => jni.Jni.accessors - .getStaticField(_class.reference, _id_pi, jni.JniCallType.doubleType) - .doubleFloat; - - /// from: static public double pi - static set pi(double value) => - jni.Jni.env.SetStaticDoubleField(_class.reference, _id_pi, value); - - static final _id_asterisk = jni.Jni.accessors.getStaticFieldIDOf( - _class.reference, - r"asterisk", - r"C", - ); - - /// from: static public char asterisk - static int get asterisk => jni.Jni.accessors - .getStaticField(_class.reference, _id_asterisk, jni.JniCallType.charType) - .char; - - /// from: static public char asterisk - static set asterisk(int value) => - jni.Jni.env.SetStaticCharField(_class.reference, _id_asterisk, value); + static $GrandParent_StaticParentType<$S> type<$S extends jni.JObject>( + jni.JObjType<$S> S, + ) { + return $GrandParent_StaticParentType( + S, + ); + } - static final _id_name = jni.Jni.accessors.getStaticFieldIDOf( + static final _id_value = jni.Jni.accessors.getFieldIDOf( _class.reference, - r"name", - r"Ljava/lang/String;", + r"value", + r"Ljava/lang/Object;", ); - /// from: static public java.lang.String name + /// from: public S value /// The returned object must be released after use, by calling the [release] method. - static jni.JString get name => const jni.JStringType().fromRef(jni - .Jni.accessors - .getStaticField(_class.reference, _id_name, jni.JniCallType.objectType) + $S get value => S.fromRef(jni.Jni.accessors + .getField(reference, _id_value, jni.JniCallType.objectType) .object); - /// from: static public java.lang.String name + /// from: public S value /// The returned object must be released after use, by calling the [release] method. - static set name(jni.JString value) => jni.Jni.env - .SetStaticObjectField(_class.reference, _id_name, value.reference); + set value($S value) => + jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_i = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"i", - r"Ljava/lang/Integer;", - ); + static final _id_new0 = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"", r"(Ljava/lang/Object;)V"); - /// from: public java.lang.Integer i + /// from: public void (S value) /// The returned object must be released after use, by calling the [release] method. - jni.JInteger get i => const jni.JIntegerType().fromRef(jni.Jni.accessors - .getField(reference, _id_i, jni.JniCallType.objectType) - .object); + factory GrandParent_StaticParent( + $S value, { + jni.JObjType<$S>? S, + }) { + S ??= jni.lowestCommonSuperType([ + value.$type, + ]) as jni.JObjType<$S>; + return GrandParent_StaticParent.fromRef( + S, + jni.Jni.accessors.newObjectWithArgs( + _class.reference, _id_new0, [value.reference]).object); + } +} - /// from: public java.lang.Integer i - /// The returned object must be released after use, by calling the [release] method. - set i(jni.JInteger value) => - jni.Jni.env.SetObjectField(reference, _id_i, value.reference); +final class $GrandParent_StaticParentType<$S extends jni.JObject> + extends jni.JObjType> { + final jni.JObjType<$S> S; - static final _id_trillion = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"trillion", - r"J", + const $GrandParent_StaticParentType( + this.S, ); - /// from: public long trillion - int get trillion => jni.Jni.accessors - .getField(reference, _id_trillion, jni.JniCallType.longType) - .long; - - /// from: public long trillion - set trillion(int value) => - jni.Jni.env.SetLongField(reference, _id_trillion, value); + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"; - static final _id_isAchillesDead = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"isAchillesDead", - r"Z", - ); + @override + GrandParent_StaticParent<$S> fromRef(jni.JObjectPtr ref) => + GrandParent_StaticParent.fromRef(S, ref); - /// from: public boolean isAchillesDead - bool get isAchillesDead => jni.Jni.accessors - .getField(reference, _id_isAchillesDead, jni.JniCallType.booleanType) - .boolean; + @override + jni.JObjType get superType => const jni.JObjectType(); - /// from: public boolean isAchillesDead - set isAchillesDead(bool value) => - jni.Jni.env.SetBooleanField(reference, _id_isAchillesDead, value ? 1 : 0); + @override + final superCount = 1; - static final _id_bestFighterInGreece = jni.Jni.accessors.getFieldIDOf( + @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.fromRef( + this.T, + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/GrandParent"); + + /// 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 _id_value = jni.Jni.accessors.getFieldIDOf( _class.reference, - r"bestFighterInGreece", - r"Ljava/lang/String;", + r"value", + r"Ljava/lang/Object;", ); - /// from: public java.lang.String bestFighterInGreece + /// from: public T value /// The returned object must be released after use, by calling the [release] method. - jni.JString get bestFighterInGreece => const jni.JStringType().fromRef(jni - .Jni.accessors - .getField(reference, _id_bestFighterInGreece, jni.JniCallType.objectType) + $T get value => T.fromRef(jni.Jni.accessors + .getField(reference, _id_value, jni.JniCallType.objectType) .object); - /// from: public java.lang.String bestFighterInGreece + /// from: public T value /// The returned object must be released after use, by calling the [release] method. - set bestFighterInGreece(jni.JString value) => jni.Jni.env - .SetObjectField(reference, _id_bestFighterInGreece, value.reference); + set value($T value) => + jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_random = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"random", - r"Ljava/util/Random;", - ); + static final _id_new0 = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"", r"(Ljava/lang/Object;)V"); - /// from: public java.util.Random random + /// from: public void (T value) /// The returned object must be released after use, by calling the [release] method. - jni.JObject get random => const jni.JObjectType().fromRef(jni.Jni.accessors - .getField(reference, _id_random, jni.JniCallType.objectType) - .object); + factory GrandParent( + $T value, { + jni.JObjType<$T>? T, + }) { + T ??= jni.lowestCommonSuperType([ + value.$type, + ]) as jni.JObjType<$T>; + return GrandParent.fromRef( + T, + jni.Jni.accessors.newObjectWithArgs( + _class.reference, _id_new0, [value.reference]).object); + } - /// from: public java.util.Random random + static final _id_stringParent = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"stringParent", + r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); + + /// from: public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent() /// The returned object must be released after use, by calling the [release] method. - set random(jni.JObject value) => - jni.Jni.env.SetObjectField(reference, _id_random, value.reference); + GrandParent_Parent stringParent() { + return const $GrandParent_ParentType(jni.JObjectType(), jni.JStringType()) + .fromRef(jni.Jni.accessors.callMethodWithArgs(reference, + _id_stringParent, jni.JniCallType.objectType, []).object); + } - static final _id_euroSymbol = jni.Jni.accessors.getStaticFieldIDOf( - _class.reference, - r"euroSymbol", - r"C", - ); + static final _id_varParent = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"varParent", + r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); - /// from: static public char euroSymbol - static int get euroSymbol => jni.Jni.accessors - .getStaticField( - _class.reference, _id_euroSymbol, jni.JniCallType.charType) - .char; + /// 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 $GrandParent_ParentType(const jni.JObjectType(), S).fromRef( + jni.Jni.accessors.callMethodWithArgs(reference, _id_varParent, + jni.JniCallType.objectType, [nestedValue.reference]).object); + } - /// from: static public char euroSymbol - static set euroSymbol(int value) => - jni.Jni.env.SetStaticCharField(_class.reference, _id_euroSymbol, value); + static final _id_stringStaticParent = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"stringStaticParent", + r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + /// 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 const $GrandParent_StaticParentType(jni.JStringType()).fromRef( + jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, + _id_stringStaticParent, jni.JniCallType.objectType, []).object); + } - /// from: public void () + static final _id_varStaticParent = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"varStaticParent", + r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); + + /// 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. - factory Fields() { - return Fields.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + 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 $GrandParent_StaticParentType(S).fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_varStaticParent, + jni.JniCallType.objectType, [value.reference]).object); + } + + static final _id_staticParentWithSameType = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"staticParentWithSameType", + r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); + + /// 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 $GrandParent_StaticParentType(T).fromRef(jni.Jni.accessors + .callMethodWithArgs(reference, _id_staticParentWithSameType, + jni.JniCallType.objectType, []).object); } } -final class $FieldsType extends jni.JObjType { - const $FieldsType(); +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/simple_package/Fields;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/GrandParent;"; @override - Fields fromRef(jni.JObjectPtr ref) => Fields.fromRef(ref); + GrandParent<$T> fromRef(jni.JObjectPtr ref) => GrandParent.fromRef(T, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1411,82 +1699,127 @@ final class $FieldsType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($FieldsType).hashCode; + int get hashCode => Object.hash($GrandParentType, T); @override bool operator ==(Object other) { - return other.runtimeType == ($FieldsType) && other is $FieldsType; + return other.runtimeType == ($GrandParentType<$T>) && + other is $GrandParentType<$T> && + T == other.T; } } -/// from: com.github.dart_lang.jnigen.simple_package.Fields$Nested -class Fields_Nested extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(K, V); - Fields_Nested.fromRef( + final jni.JObjType<$K> K; + final jni.JObjType<$V> V; + + MyMap_MyEntry.fromRef( + this.K, + this.V, jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/simple_package/Fields$Nested"); + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); /// The type which includes information such as the signature of this class. - static const type = $Fields_NestedType(); - static final _id_hundred = jni.Jni.accessors.getFieldIDOf( + 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 _id_key = jni.Jni.accessors.getFieldIDOf( _class.reference, - r"hundred", - r"J", + r"key", + r"Ljava/lang/Object;", ); - /// from: public long hundred - int get hundred => jni.Jni.accessors - .getField(reference, _id_hundred, jni.JniCallType.longType) - .long; + /// from: public K key + /// The returned object must be released after use, by calling the [release] method. + $K get key => K.fromRef(jni.Jni.accessors + .getField(reference, _id_key, jni.JniCallType.objectType) + .object); - /// from: public long hundred - set hundred(int value) => - jni.Jni.env.SetLongField(reference, _id_hundred, value); + /// from: public K key + /// The returned object must be released after use, by calling the [release] method. + set key($K value) => + jni.Jni.env.SetObjectField(reference, _id_key, value.reference); - static final _id_BEST_GOD = jni.Jni.accessors.getStaticFieldIDOf( + static final _id_value = jni.Jni.accessors.getFieldIDOf( _class.reference, - r"BEST_GOD", - r"Ljava/lang/String;", + r"value", + r"Ljava/lang/Object;", ); - /// from: static public java.lang.String BEST_GOD + /// from: public V value /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BEST_GOD => - const jni.JStringType().fromRef(jni.Jni.accessors - .getStaticField( - _class.reference, _id_BEST_GOD, jni.JniCallType.objectType) - .object); + $V get value => V.fromRef(jni.Jni.accessors + .getField(reference, _id_value, jni.JniCallType.objectType) + .object); - /// from: static public java.lang.String BEST_GOD + /// from: public V value /// The returned object must be released after use, by calling the [release] method. - static set BEST_GOD(jni.JString value) => jni.Jni.env - .SetStaticObjectField(_class.reference, _id_BEST_GOD, value.reference); + set value($V value) => + jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"", + r"(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V"); - /// from: public void () + /// 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 Fields_Nested() { - return Fields_Nested.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + 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.fromRef( + K, + V, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, + [$parent.reference, key.reference, value.reference]).object); } } -final class $Fields_NestedType extends jni.JObjType { - const $Fields_NestedType(); +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/simple_package/Fields$Nested;"; + r"Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;"; @override - Fields_Nested fromRef(jni.JObjectPtr ref) => Fields_Nested.fromRef(ref); + MyMap_MyEntry<$K, $V> fromRef(jni.JObjectPtr ref) => + MyMap_MyEntry.fromRef(K, V, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1495,121 +1828,118 @@ final class $Fields_NestedType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($Fields_NestedType).hashCode; + int get hashCode => Object.hash($MyMap_MyEntryType, K, V); @override bool operator ==(Object other) { - return other.runtimeType == ($Fields_NestedType) && - other is $Fields_NestedType; + 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.pkg2.C2 -class C2 extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(K, V); - C2.fromRef( + final jni.JObjType<$K> K; + final jni.JObjType<$V> V; + + MyMap.fromRef( + this.K, + this.V, jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/pkg2/C2"); + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/MyMap"); /// The type which includes information such as the signature of this class. - static const type = $C2Type(); - static final _id_CONSTANT = jni.Jni.accessors.getStaticFieldIDOf( - _class.reference, - r"CONSTANT", - r"I", - ); - - /// from: static public int CONSTANT - static int get CONSTANT => jni.Jni.accessors - .getStaticField(_class.reference, _id_CONSTANT, jni.JniCallType.intType) - .integer; - - /// from: static public int CONSTANT - static set CONSTANT(int value) => - jni.Jni.env.SetStaticIntField(_class.reference, _id_CONSTANT, value); + 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 _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory C2() { - return C2.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + factory MyMap({ + required jni.JObjType<$K> K, + required jni.JObjType<$V> V, + }) { + return MyMap.fromRef( + K, + V, + jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } -} - -final class $C2Type extends jni.JObjType { - const $C2Type(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/pkg2/C2;"; - - @override - C2 fromRef(jni.JObjectPtr ref) => C2.fromRef(ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - @override - int get hashCode => ($C2Type).hashCode; + static final _id_get0 = jni.Jni.accessors.getMethodIDOf( + _class.reference, r"get", r"(Ljava/lang/Object;)Ljava/lang/Object;"); - @override - bool operator ==(Object other) { - return other.runtimeType == ($C2Type) && other is $C2Type; + /// from: public V get(K key) + /// The returned object must be released after use, by calling the [release] method. + $V get0( + $K key, + ) { + return V.fromRef(jni.Jni.accessors.callMethodWithArgs(reference, _id_get0, + jni.JniCallType.objectType, [key.reference]).object); } -} - -/// from: com.github.dart_lang.jnigen.pkg2.Example -class Example1 extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Example1.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/pkg2/Example"); - /// The type which includes information such as the signature of this class. - static const type = $Example1Type(); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + static final _id_put = jni.Jni.accessors.getMethodIDOf(_class.reference, + r"put", r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - /// from: public void () + /// from: public V put(K key, V value) /// The returned object must be released after use, by calling the [release] method. - factory Example1() { - return Example1.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + $V put( + $K key, + $V value, + ) { + return V.fromRef(jni.Jni.accessors.callMethodWithArgs(reference, _id_put, + jni.JniCallType.objectType, [key.reference, value.reference]).object); } - static final _id_whichExample = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"whichExample", r"()I"); + static final _id_entryStack = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"entryStack", + r"()Lcom/github/dart_lang/jnigen/generics/MyStack;"); - /// from: public int whichExample() - int whichExample() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_whichExample, jni.JniCallType.intType, []).integer; + /// 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 const $MyStackType( + $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType())) + .fromRef(jni.Jni.accessors.callMethodWithArgs( + reference, _id_entryStack, jni.JniCallType.objectType, []).object); } } -final class $Example1Type extends jni.JObjType { - const $Example1Type(); +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/pkg2/Example;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyMap;"; @override - Example1 fromRef(jni.JObjectPtr ref) => Example1.fromRef(ref); + MyMap<$K, $V> fromRef(jni.JObjectPtr ref) => MyMap.fromRef(K, V, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1618,41 +1948,38 @@ final class $Example1Type extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($Example1Type).hashCode; + int get hashCode => Object.hash($MyMapType, K, V); @override bool operator ==(Object other) { - return other.runtimeType == ($Example1Type) && other is $Example1Type; + return other.runtimeType == ($MyMapType<$K, $V>) && + other is $MyMapType<$K, $V> && + K == other.K && + V == other.V; } } -/// from: com.github.dart_lang.jnigen.generics.GenericTypeParams -class GenericTypeParams<$S extends jni.JObject, $K extends jni.JObject> - extends jni.JObject { +/// from: com.github.dart_lang.jnigen.generics.MyStack +class MyStack<$T extends jni.JObject> extends jni.JObject { @override - late final jni.JObjType> $type = type(S, K); + late final jni.JObjType> $type = type(T); - final jni.JObjType<$S> S; - final jni.JObjType<$K> K; + final jni.JObjType<$T> T; - GenericTypeParams.fromRef( - this.S, - this.K, + MyStack.fromRef( + this.T, jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/GenericTypeParams"); + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/MyStack"); /// 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, + static $MyStackType<$T> type<$T extends jni.JObject>( + jni.JObjType<$T> T, ) { - return $GenericTypeParamsType( - S, - K, + return $MyStackType( + T, ); } @@ -1661,204 +1988,159 @@ class GenericTypeParams<$S extends jni.JObject, $K extends jni.JObject> /// 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, + factory MyStack({ + required jni.JObjType<$T> T, }) { - return GenericTypeParams.fromRef( - S, - K, + return MyStack.fromRef( + T, jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); } -} -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> fromRef(jni.JObjectPtr ref) => - GenericTypeParams.fromRef(S, K, ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GenericTypeParamsType, S, K); + static final _id_fromArray = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"fromArray", + r"([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - @override - bool operator ==(Object other) { - return other.runtimeType == ($GenericTypeParamsType<$S, $K>) && - other is $GenericTypeParamsType<$S, $K> && - S == other.S && - K == other.K; + /// 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 $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( + _class.reference, + _id_fromArray, + jni.JniCallType.objectType, + [arr.reference]).object); } -} - -/// 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.fromRef( - this.T, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/GrandParent"); + static final _id_fromArrayOfArrayOfGrandParents = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"fromArrayOfArrayOfGrandParents", + r"([[Lcom/github/dart_lang/jnigen/generics/GrandParent;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - /// 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, - ); + /// 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 $MyStackType(S).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( + _class.reference, + _id_fromArrayOfArrayOfGrandParents, + jni.JniCallType.objectType, + [arr.reference]).object); } - static final _id_value = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"value", - r"Ljava/lang/Object;", - ); - - /// from: public T value - /// The returned object must be released after use, by calling the [release] method. - $T get value => T.fromRef(jni.Jni.accessors - .getField(reference, _id_value, jni.JniCallType.objectType) - .object); + static final _id_of = jni.Jni.accessors.getStaticMethodIDOf(_class.reference, + r"of", r"()Lcom/github/dart_lang/jnigen/generics/MyStack;"); - /// from: public T value + /// from: static public com.github.dart_lang.jnigen.generics.MyStack of() /// The returned object must be released after use, by calling the [release] method. - set value($T value) => - jni.Jni.env.SetObjectField(reference, _id_value, value.reference); + static MyStack<$T> of<$T extends jni.JObject>({ + required jni.JObjType<$T> T, + }) { + return $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( + _class.reference, _id_of, jni.JniCallType.objectType, []).object); + } - static final _id_new0 = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"", r"(Ljava/lang/Object;)V"); + static final _id_of1 = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"of", + r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - /// from: public void (T value) + /// 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. - factory GrandParent( - $T value, { + static MyStack<$T> of1<$T extends jni.JObject>( + $T obj, { jni.JObjType<$T>? T, }) { T ??= jni.lowestCommonSuperType([ - value.$type, + obj.$type, ]) as jni.JObjType<$T>; - return GrandParent.fromRef( - T, - jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_new0, [value.reference]).object); - } - - static final _id_stringParent = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"stringParent", - r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); - - /// 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 const $GrandParent_ParentType(jni.JObjectType(), jni.JStringType()) - .fromRef(jni.Jni.accessors.callMethodWithArgs(reference, - _id_stringParent, jni.JniCallType.objectType, []).object); + return $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( + _class.reference, + _id_of1, + jni.JniCallType.objectType, + [obj.reference]).object); } - static final _id_varParent = jni.Jni.accessors.getMethodIDOf( + static final _id_of2 = jni.Jni.accessors.getStaticMethodIDOf( _class.reference, - r"varParent", - r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); + r"of", + r"(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - /// from: public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S nestedValue) + /// 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. - GrandParent_Parent varParent<$S extends jni.JObject>( - $S nestedValue, { - jni.JObjType<$S>? S, + static MyStack<$T> of2<$T extends jni.JObject>( + $T obj, + $T obj2, { + jni.JObjType<$T>? T, }) { - S ??= jni.lowestCommonSuperType([ - nestedValue.$type, - ]) as jni.JObjType<$S>; - return $GrandParent_ParentType(const jni.JObjectType(), S).fromRef( - jni.Jni.accessors.callMethodWithArgs(reference, _id_varParent, - jni.JniCallType.objectType, [nestedValue.reference]).object); + T ??= jni.lowestCommonSuperType([ + obj2.$type, + obj.$type, + ]) as jni.JObjType<$T>; + return $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( + _class.reference, + _id_of2, + jni.JniCallType.objectType, + [obj.reference, obj2.reference]).object); } - static final _id_stringStaticParent = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"stringStaticParent", - r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); + static final _id_push = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"push", r"(Ljava/lang/Object;)V"); - /// 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 const $GrandParent_StaticParentType(jni.JStringType()).fromRef( - jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, - _id_stringStaticParent, jni.JniCallType.objectType, []).object); + /// from: public void push(T item) + void push( + $T item, + ) { + return jni.Jni.accessors.callMethodWithArgs(reference, _id_push, + jni.JniCallType.voidType, [item.reference]).check(); } - static final _id_varStaticParent = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"varStaticParent", - r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); + static final _id_pop = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"pop", r"()Ljava/lang/Object;"); - /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent varStaticParent(S value) + /// from: public T pop() /// 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 $GrandParent_StaticParentType(S).fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_varStaticParent, - jni.JniCallType.objectType, [value.reference]).object); + $T pop() { + return T.fromRef(jni.Jni.accessors.callMethodWithArgs( + reference, _id_pop, jni.JniCallType.objectType, []).object); } - static final _id_staticParentWithSameType = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"staticParentWithSameType", - r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); + static final _id_size = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"size", r"()I"); - /// 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 $GrandParent_StaticParentType(T).fromRef(jni.Jni.accessors - .callMethodWithArgs(reference, _id_staticParentWithSameType, - jni.JniCallType.objectType, []).object); + /// from: public int size() + int size() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_size, jni.JniCallType.intType, []).integer; } } -final class $GrandParentType<$T extends jni.JObject> - extends jni.JObjType> { +final class $MyStackType<$T extends jni.JObject> + extends jni.JObjType> { final jni.JObjType<$T> T; - const $GrandParentType( + const $MyStackType( this.T, ); @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/GrandParent;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyStack;"; @override - GrandParent<$T> fromRef(jni.JObjectPtr ref) => GrandParent.fromRef(T, ref); + MyStack<$T> fromRef(jni.JObjectPtr ref) => MyStack.fromRef(T, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -1867,960 +2149,580 @@ final class $GrandParentType<$T extends jni.JObject> final superCount = 1; @override - int get hashCode => Object.hash($GrandParentType, T); + int get hashCode => Object.hash($MyStackType, T); @override bool operator ==(Object other) { - return other.runtimeType == ($GrandParentType<$T>) && - other is $GrandParentType<$T> && + return other.runtimeType == ($MyStackType<$T>) && + other is $MyStackType<$T> && T == other.T; } } -/// from: com.github.dart_lang.jnigen.generics.GrandParent$Parent -class GrandParent_Parent<$T extends jni.JObject, $S extends jni.JObject> - extends jni.JObject { +/// from: com.github.dart_lang.jnigen.generics.StringKeyedMap +class StringKeyedMap<$V extends jni.JObject> extends MyMap { @override - late final jni.JObjType> $type = type(T, S); + late final jni.JObjType> $type = type(V); - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; + final jni.JObjType<$V> V; - GrandParent_Parent.fromRef( - this.T, - this.S, + StringKeyedMap.fromRef( + this.V, jni.JObjectPtr ref, - ) : super.fromRef(ref); + ) : super.fromRef(const jni.JStringType(), V, ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/GrandParent$Parent"); + r"com/github/dart_lang/jnigen/generics/StringKeyedMap"); /// 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, + static $StringKeyedMapType<$V> type<$V extends jni.JObject>( + jni.JObjType<$V> V, ) { - return $GrandParent_ParentType( - T, - S, + return $StringKeyedMapType( + V, ); } - static final _id_parentValue = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"parentValue", - r"Ljava/lang/Object;", - ); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - /// from: public T parentValue + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - $T get parentValue => T.fromRef(jni.Jni.accessors - .getField(reference, _id_parentValue, jni.JniCallType.objectType) - .object); + factory StringKeyedMap({ + required jni.JObjType<$V> V, + }) { + return StringKeyedMap.fromRef( + V, + jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); + } +} - /// from: public T parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($T value) => - jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); +final class $StringKeyedMapType<$V extends jni.JObject> + extends jni.JObjType> { + final jni.JObjType<$V> V; - static final _id_value = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"value", - r"Ljava/lang/Object;", + const $StringKeyedMapType( + this.V, ); - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - $S get value => S.fromRef(jni.Jni.accessors - .getField(reference, _id_value, jni.JniCallType.objectType) - .object); + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;"; - /// from: public S value + @override + StringKeyedMap<$V> fromRef(jni.JObjectPtr ref) => + StringKeyedMap.fromRef(V, ref); + + @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.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(const jni.JStringType(), ref); + + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/StringStack"); + + /// The type which includes information such as the signature of this class. + static const type = $StringStackType(); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - set value($S value) => - jni.Jni.env.SetObjectField(reference, _id_value, value.reference); + factory StringStack() { + return StringStack.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); + } +} - static final _id_new0 = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"", - r"(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V"); +final class $StringStackType extends jni.JObjType { + const $StringStackType(); - /// from: public void (com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue) + @override + String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringStack;"; + + @override + StringStack fromRef(jni.JObjectPtr ref) => StringStack.fromRef(ref); + + @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.fromRef( + this.K, + jni.JObjectPtr ref, + ) : super.fromRef(K, const jni.JStringType(), ref); + + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/generics/StringValuedMap"); + + /// 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 _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + + /// from: public void () /// 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, + factory StringValuedMap({ + required jni.JObjType<$K> K, }) { - T ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParentType).T, - ]) as jni.JObjType<$T>; - S ??= jni.lowestCommonSuperType([ - newValue.$type, - ]) as jni.JObjType<$S>; - return GrandParent_Parent.fromRef( - T, - S, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, - [$parent.reference, newValue.reference]).object); + return StringValuedMap.fromRef( + K, + jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } -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; +final class $StringValuedMapType<$K extends jni.JObject> + extends jni.JObjType> { + final jni.JObjType<$K> K; - const $GrandParent_ParentType( - this.T, - this.S, + const $StringValuedMapType( + this.K, ); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"; + r"Lcom/github/dart_lang/jnigen/generics/StringValuedMap;"; @override - GrandParent_Parent<$T, $S> fromRef(jni.JObjectPtr ref) => - GrandParent_Parent.fromRef(T, S, ref); + StringValuedMap<$K> fromRef(jni.JObjectPtr ref) => + StringValuedMap.fromRef(K, ref); @override - jni.JObjType get superType => const jni.JObjectType(); + jni.JObjType get superType => $MyMapType(K, const jni.JStringType()); @override - final superCount = 1; + final superCount = 2; @override - int get hashCode => Object.hash($GrandParent_ParentType, T, S); + int get hashCode => Object.hash($StringValuedMapType, K); @override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_ParentType<$T, $S>) && - other is $GrandParent_ParentType<$T, $S> && - T == other.T && - S == other.S; + return other.runtimeType == ($StringValuedMapType<$K>) && + other is $StringValuedMapType<$K> && + K == other.K; } } -/// 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 { +/// 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, S, U); + late final jni.JObjType> $type = type(T); final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; - GrandParent_Parent_Child.fromRef( + MyInterface.fromRef( this.T, - this.S, - this.U, jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/interfaces/MyInterface"); /// 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>( + static $MyInterfaceType<$T> type<$T extends jni.JObject>( jni.JObjType<$T> T, - jni.JObjType<$S> S, - jni.JObjType<$U> U, ) { - return $GrandParent_Parent_ChildType( + return $MyInterfaceType( T, - S, - U, ); } - static final _id_grandParentValue = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"grandParentValue", - r"Ljava/lang/Object;", - ); + static final _id_voidCallback = jni.Jni.accessors.getMethodIDOf( + _class.reference, r"voidCallback", r"(Ljava/lang/String;)V"); - /// from: public T grandParentValue - /// The returned object must be released after use, by calling the [release] method. - $T get grandParentValue => T.fromRef(jni.Jni.accessors - .getField(reference, _id_grandParentValue, jni.JniCallType.objectType) - .object); - - /// from: public T grandParentValue - /// The returned object must be released after use, by calling the [release] method. - set grandParentValue($T value) => jni.Jni.env - .SetObjectField(reference, _id_grandParentValue, value.reference); - - static final _id_parentValue = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"parentValue", - r"Ljava/lang/Object;", - ); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => S.fromRef(jni.Jni.accessors - .getField(reference, _id_parentValue, jni.JniCallType.objectType) - .object); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => - jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); - - static final _id_value = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"value", - r"Ljava/lang/Object;", - ); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - $U get value => U.fromRef(jni.Jni.accessors - .getField(reference, _id_value, jni.JniCallType.objectType) - .object); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - set value($U value) => - jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - - static final _id_new0 = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"", - r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V"); - - /// 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.fromRef( - T, - S, - U, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, - [$parent.reference, newValue.reference]).object); - } -} - -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> fromRef(jni.JObjectPtr ref) => - GrandParent_Parent_Child.fromRef(T, S, U, ref); - - @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$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.fromRef( - this.S, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); - - /// 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 _id_value = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"value", - r"Ljava/lang/Object;", - ); - - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - $S get value => S.fromRef(jni.Jni.accessors - .getField(reference, _id_value, jni.JniCallType.objectType) - .object); - - /// from: public S value - /// The returned object must be released after use, by calling the [release] method. - set value($S value) => - jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - - static final _id_new0 = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"", r"(Ljava/lang/Object;)V"); - - /// 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.fromRef( - S, - jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_new0, [value.reference]).object); - } -} - -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> fromRef(jni.JObjectPtr ref) => - GrandParent_StaticParent.fromRef(S, ref); - - @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$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.fromRef( - this.S, - this.U, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child"); - - /// 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 _id_parentValue = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"parentValue", - r"Ljava/lang/Object;", - ); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => S.fromRef(jni.Jni.accessors - .getField(reference, _id_parentValue, jni.JniCallType.objectType) - .object); - - /// from: public S parentValue - /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => - jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); - - static final _id_value = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"value", - r"Ljava/lang/Object;", - ); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - $U get value => U.fromRef(jni.Jni.accessors - .getField(reference, _id_value, jni.JniCallType.objectType) - .object); - - /// from: public U value - /// The returned object must be released after use, by calling the [release] method. - set value($U value) => - jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - - static final _id_new0 = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"", - r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V"); - - /// 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.fromRef( - S, - U, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, [ - $parent.reference, - parentValue.reference, - value.reference - ]).object); - } -} - -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> fromRef(jni.JObjectPtr ref) => - GrandParent_StaticParent_Child.fromRef(S, U, ref); - - @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.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.fromRef( - this.K, - this.V, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/MyMap"); - - /// 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, + /// from: public abstract void voidCallback(java.lang.String s) + void voidCallback( + jni.JString s, ) { - return $MyMapType( - K, - V, - ); + return jni.Jni.accessors.callMethodWithArgs(reference, _id_voidCallback, + jni.JniCallType.voidType, [s.reference]).check(); } - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + static final _id_stringCallback = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"stringCallback", + r"(Ljava/lang/String;)Ljava/lang/String;"); - /// from: public void () + /// from: public abstract java.lang.String stringCallback(java.lang.String s) /// 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.fromRef( - K, - V, - jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + jni.JString stringCallback( + jni.JString s, + ) { + return const jni.JStringType().fromRef(jni.Jni.accessors.callMethodWithArgs( + reference, + _id_stringCallback, + jni.JniCallType.objectType, + [s.reference]).object); } - static final _id_get0 = jni.Jni.accessors.getMethodIDOf( - _class.reference, r"get", r"(Ljava/lang/Object;)Ljava/lang/Object;"); + static final _id_varCallback = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"varCallback", + r"(Ljava/lang/Object;)Ljava/lang/Object;"); - /// from: public V get(K key) + /// from: public abstract T varCallback(T t) /// The returned object must be released after use, by calling the [release] method. - $V get0( - $K key, + $T varCallback( + $T t, ) { - return V.fromRef(jni.Jni.accessors.callMethodWithArgs(reference, _id_get0, - jni.JniCallType.objectType, [key.reference]).object); + return T.fromRef(jni.Jni.accessors.callMethodWithArgs(reference, + _id_varCallback, jni.JniCallType.objectType, [t.reference]).object); } - static final _id_put = jni.Jni.accessors.getMethodIDOf(_class.reference, - r"put", r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); + static final _id_manyPrimitives = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"manyPrimitives", r"(IZCD)J"); - /// 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, + /// from: public abstract long manyPrimitives(int a, boolean b, char c, double d) + int manyPrimitives( + int a, + bool b, + int c, + double d, ) { - return V.fromRef(jni.Jni.accessors.callMethodWithArgs(reference, _id_put, - jni.JniCallType.objectType, [key.reference, value.reference]).object); + return jni.Jni.accessors.callMethodWithArgs( + reference, + _id_manyPrimitives, + jni.JniCallType.longType, + [jni.JValueInt(a), b ? 1 : 0, jni.JValueChar(c), d]).long; } - static final _id_entryStack = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"entryStack", - r"()Lcom/github/dart_lang/jnigen/generics/MyStack;"); + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; - /// 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 const $MyStackType( - $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType())) - .fromRef(jni.Jni.accessors.callMethodWithArgs( - reference, _id_entryStack, jni.JniCallType.objectType, []).object); + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); } -} - -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> fromRef(jni.JObjectPtr ref) => MyMap.fromRef(K, V, ref); - - @override - jni.JObjType get superType => const jni.JObjectType(); - @override - final superCount = 1; + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - @override - int get hashCode => Object.hash($MyMapType, K, V); + 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()).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()).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).toPointer(); + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e.toString()); + } + return jni.nullptr; + } - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyMapType<$K, $V>) && - other is $MyMapType<$K, $V> && - K == other.K && - V == other.V; + factory MyInterface.implement( + $MyInterfaceImpl<$T> $impl, + ) { + final $p = ReceivePort(); + final $x = MyInterface.fromRef( + $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; } -/// 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.fromRef( - this.K, - this.V, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); +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; - /// 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, - ); - } + jni.JObjType<$T> get T; - static final _id_key = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"key", - r"Ljava/lang/Object;", - ); + 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); +} - /// from: public K key - /// The returned object must be released after use, by calling the [release] method. - $K get key => K.fromRef(jni.Jni.accessors - .getField(reference, _id_key, jni.JniCallType.objectType) - .object); +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; - /// from: public K key - /// The returned object must be released after use, by calling the [release] method. - set key($K value) => - jni.Jni.env.SetObjectField(reference, _id_key, value.reference); + @override + final jni.JObjType<$T> T; - static final _id_value = jni.Jni.accessors.getFieldIDOf( - _class.reference, - r"value", - r"Ljava/lang/Object;", - ); + 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; - /// from: public V value - /// The returned object must be released after use, by calling the [release] method. - $V get value => V.fromRef(jni.Jni.accessors - .getField(reference, _id_value, jni.JniCallType.objectType) - .object); + void voidCallback(jni.JString s) { + return _voidCallback(s); + } - /// from: public V value - /// The returned object must be released after use, by calling the [release] method. - set value($V value) => - jni.Jni.env.SetObjectField(reference, _id_value, value.reference); + jni.JString stringCallback(jni.JString s) { + return _stringCallback(s); + } - static final _id_new0 = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"", - r"(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V"); + $T varCallback($T t) { + return _varCallback(t); + } - /// 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.fromRef( - K, - V, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, - [$parent.reference, key.reference, value.reference]).object); + int manyPrimitives(int a, bool b, int c, double d) { + return _manyPrimitives(a, b, c, d); } } -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; +final class $MyInterfaceType<$T extends jni.JObject> + extends jni.JObjType> { + final jni.JObjType<$T> T; - const $MyMap_MyEntryType( - this.K, - this.V, + const $MyInterfaceType( + this.T, ); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;"; + r"Lcom/github/dart_lang/jnigen/interfaces/MyInterface;"; @override - MyMap_MyEntry<$K, $V> fromRef(jni.JObjectPtr ref) => - MyMap_MyEntry.fromRef(K, V, ref); + MyInterface<$T> fromRef(jni.JObjectPtr ref) => MyInterface.fromRef(T, ref); @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.MyStack -class MyStack<$T extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(T); - - final jni.JObjType<$T> T; - - MyStack.fromRef( - this.T, - jni.JObjectPtr ref, - ) : super.fromRef(ref); - - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/MyStack"); - - /// 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 _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - - /// 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.fromRef( - T, - jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); - } - - static final _id_fromArray = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"fromArray", - r"([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - - /// 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 $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( - _class.reference, - _id_fromArray, - jni.JniCallType.objectType, - [arr.reference]).object); - } - - static final _id_fromArrayOfArrayOfGrandParents = jni.Jni.accessors - .getStaticMethodIDOf(_class.reference, r"fromArrayOfArrayOfGrandParents", - r"([[Lcom/github/dart_lang/jnigen/generics/GrandParent;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); - - /// 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 $MyStackType(S).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( - _class.reference, - _id_fromArrayOfArrayOfGrandParents, - jni.JniCallType.objectType, - [arr.reference]).object); + + @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; } +} - static final _id_of = jni.Jni.accessors.getStaticMethodIDOf(_class.reference, - r"of", r"()Lcom/github/dart_lang/jnigen/generics/MyStack;"); +/// from: com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer +class MyInterfaceConsumer extends jni.JObject { + @override + late final jni.JObjType $type = type; - /// from: static public com.github.dart_lang.jnigen.generics.MyStack of() + MyInterfaceConsumer.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer"); + + /// The type which includes information such as the signature of this class. + static const type = $MyInterfaceConsumerType(); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + + /// from: public void () /// 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 $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( - _class.reference, _id_of, jni.JniCallType.objectType, []).object); + factory MyInterfaceConsumer() { + return MyInterfaceConsumer.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } - static final _id_of1 = jni.Jni.accessors.getStaticMethodIDOf( + static final _id_consumeOnAnotherThread = jni.Jni.accessors.getStaticMethodIDOf( _class.reference, - r"of", - r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); + r"consumeOnAnotherThread", + r"(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V"); - /// 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, { + /// 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([ - obj.$type, + t.$type, + (myInterface.$type as $MyInterfaceType).T, ]) as jni.JObjType<$T>; - return $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( - _class.reference, - _id_of1, - jni.JniCallType.objectType, - [obj.reference]).object); + return jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, + _id_consumeOnAnotherThread, jni.JniCallType.voidType, [ + myInterface.reference, + s.reference, + jni.JValueInt(a), + b ? 1 : 0, + jni.JValueChar(c), + d, + t.reference + ]).check(); } - static final _id_of2 = jni.Jni.accessors.getStaticMethodIDOf( + static final _id_consumeOnSameThread = jni.Jni.accessors.getStaticMethodIDOf( _class.reference, - r"of", - r"(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); + r"consumeOnSameThread", + r"(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V"); - /// 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, { + /// 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([ - obj2.$type, - obj.$type, + t.$type, + (myInterface.$type as $MyInterfaceType).T, ]) as jni.JObjType<$T>; - return $MyStackType(T).fromRef(jni.Jni.accessors.callStaticMethodWithArgs( - _class.reference, - _id_of2, - jni.JniCallType.objectType, - [obj.reference, obj2.reference]).object); - } - - static final _id_push = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"push", r"(Ljava/lang/Object;)V"); - - /// from: public void push(T item) - void push( - $T item, - ) { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_push, - jni.JniCallType.voidType, [item.reference]).check(); - } - - static final _id_pop = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"pop", r"()Ljava/lang/Object;"); - - /// from: public T pop() - /// The returned object must be released after use, by calling the [release] method. - $T pop() { - return T.fromRef(jni.Jni.accessors.callMethodWithArgs( - reference, _id_pop, jni.JniCallType.objectType, []).object); - } - - static final _id_size = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"size", r"()I"); - - /// from: public int size() - int size() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_size, jni.JniCallType.intType, []).integer; + return jni.Jni.accessors.callStaticMethodWithArgs( + _class.reference, _id_consumeOnSameThread, jni.JniCallType.voidType, [ + myInterface.reference, + s.reference, + jni.JValueInt(a), + b ? 1 : 0, + jni.JValueChar(c), + d, + t.reference + ]).check(); } } -final class $MyStackType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - - const $MyStackType( - this.T, - ); +final class $MyInterfaceConsumerType extends jni.JObjType { + const $MyInterfaceConsumerType(); @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/MyStack;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;"; @override - MyStack<$T> fromRef(jni.JObjectPtr ref) => MyStack.fromRef(T, ref); + MyInterfaceConsumer fromRef(jni.JObjectPtr ref) => + MyInterfaceConsumer.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -2829,343 +2731,340 @@ final class $MyStackType<$T extends jni.JObject> final superCount = 1; @override - int get hashCode => Object.hash($MyStackType, T); + int get hashCode => ($MyInterfaceConsumerType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyStackType<$T>) && - other is $MyStackType<$T> && - T == other.T; + return other.runtimeType == ($MyInterfaceConsumerType) && + other is $MyInterfaceConsumerType; } } -/// from: com.github.dart_lang.jnigen.generics.StringKeyedMap -class StringKeyedMap<$V extends jni.JObject> extends MyMap { +/// from: com.github.dart_lang.jnigen.interfaces.MyRunnable +class MyRunnable extends jni.JObject { @override - late final jni.JObjType> $type = type(V); + late final jni.JObjType $type = type; - final jni.JObjType<$V> V; + MyRunnable.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/interfaces/MyRunnable"); + + /// The type which includes information such as the signature of this class. + static const type = $MyRunnableType(); + static final _id_run = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"run", r"()V"); + + /// from: public abstract void run() + void run() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_run, jni.JniCallType.voidType, []).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.fromRef( + 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; + } +} - StringKeyedMap.fromRef( - this.V, - jni.JObjectPtr ref, - ) : super.fromRef(const jni.JStringType(), V, ref); +abstract interface class $MyRunnableImpl { + factory $MyRunnableImpl({ + required void Function() run, + }) = _$MyRunnableImpl; - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/StringKeyedMap"); + void run(); +} - /// 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, - ); - } +class _$MyRunnableImpl implements $MyRunnableImpl { + _$MyRunnableImpl({ + required void Function() run, + }) : _run = run; - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + final void Function() _run; - /// 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.fromRef( - V, - jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + void run() { + return _run(); } } -final class $StringKeyedMapType<$V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$V> V; - - const $StringKeyedMapType( - this.V, - ); +final class $MyRunnableType extends jni.JObjType { + const $MyRunnableType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;"; + r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;"; @override - StringKeyedMap<$V> fromRef(jni.JObjectPtr ref) => - StringKeyedMap.fromRef(V, ref); + MyRunnable fromRef(jni.JObjectPtr ref) => MyRunnable.fromRef(ref); @override - jni.JObjType get superType => $MyMapType(const jni.JStringType(), V); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 2; + final superCount = 1; @override - int get hashCode => Object.hash($StringKeyedMapType, V); + int get hashCode => ($MyRunnableType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($StringKeyedMapType<$V>) && - other is $StringKeyedMapType<$V> && - V == other.V; + return other.runtimeType == ($MyRunnableType) && other is $MyRunnableType; } } -/// from: com.github.dart_lang.jnigen.generics.StringMap -class StringMap extends StringKeyedMap { +/// from: com.github.dart_lang.jnigen.interfaces.MyRunnableRunner +class MyRunnableRunner extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - StringMap.fromRef( + MyRunnableRunner.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(const jni.JStringType(), ref); + ) : super.fromRef(ref); - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/StringMap"); + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); /// The type which includes information such as the signature of this class. - static const type = $StringMapType(); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + static const type = $MyRunnableRunnerType(); + static final _id_error = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"error", + r"Ljava/lang/Throwable;", + ); - /// from: public void () + /// from: public java.lang.Throwable error /// The returned object must be released after use, by calling the [release] method. - factory StringMap() { - return StringMap.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); - } -} - -final class $StringMapType extends jni.JObjType { - const $StringMapType(); - - @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringMap;"; - - @override - StringMap fromRef(jni.JObjectPtr ref) => StringMap.fromRef(ref); - - @override - jni.JObjType get superType => const $StringKeyedMapType(jni.JStringType()); + jni.JObject get error => const jni.JObjectType().fromRef(jni.Jni.accessors + .getField(reference, _id_error, jni.JniCallType.objectType) + .object); - @override - final superCount = 3; + /// from: public java.lang.Throwable error + /// The returned object must be released after use, by calling the [release] method. + set error(jni.JObject value) => + jni.Jni.env.SetObjectField(reference, _id_error, value.reference); - @override - int get hashCode => ($StringMapType).hashCode; + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, + r"", r"(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V"); - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringMapType) && other is $StringMapType; + /// 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.fromRef(jni.Jni.accessors.newObjectWithArgs( + _class.reference, _id_new0, [runnable.reference]).object); } -} - -/// from: com.github.dart_lang.jnigen.generics.StringStack -class StringStack extends MyStack { - @override - late final jni.JObjType $type = type; - StringStack.fromRef( - jni.JObjectPtr ref, - ) : super.fromRef(const jni.JStringType(), ref); + static final _id_runOnSameThread = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"runOnSameThread", r"()V"); - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/StringStack"); + /// from: public void runOnSameThread() + void runOnSameThread() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_runOnSameThread, jni.JniCallType.voidType, []).check(); + } - /// The type which includes information such as the signature of this class. - static const type = $StringStackType(); - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + static final _id_runOnAnotherThread = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"runOnAnotherThread", r"()V"); - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory StringStack() { - return StringStack.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + /// from: public void runOnAnotherThread() + void runOnAnotherThread() { + return jni.Jni.accessors.callMethodWithArgs(reference, + _id_runOnAnotherThread, jni.JniCallType.voidType, []).check(); } } -final class $StringStackType extends jni.JObjType { - const $StringStackType(); +final class $MyRunnableRunnerType extends jni.JObjType { + const $MyRunnableRunnerType(); @override - String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringStack;"; + String get signature => + r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;"; @override - StringStack fromRef(jni.JObjectPtr ref) => StringStack.fromRef(ref); + MyRunnableRunner fromRef(jni.JObjectPtr ref) => MyRunnableRunner.fromRef(ref); @override - jni.JObjType get superType => const $MyStackType(jni.JStringType()); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 2; + final superCount = 1; @override - int get hashCode => ($StringStackType).hashCode; + int get hashCode => ($MyRunnableRunnerType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($StringStackType) && other is $StringStackType; + return other.runtimeType == ($MyRunnableRunnerType) && + other is $MyRunnableRunnerType; } } -/// from: com.github.dart_lang.jnigen.generics.StringValuedMap -class StringValuedMap<$K extends jni.JObject> extends MyMap<$K, jni.JString> { +/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable$Case +class JsonSerializable_Case extends jni.JObject { @override - late final jni.JObjType> $type = type(K); - - final jni.JObjType<$K> K; + late final jni.JObjType $type = type; - StringValuedMap.fromRef( - this.K, + JsonSerializable_Case.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(K, const jni.JStringType(), ref); + ) : super.fromRef(ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/generics/StringValuedMap"); + r"com/github/dart_lang/jnigen/annotations/JsonSerializable$Case"); /// 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 const type = $JsonSerializable_CaseType(); + static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"values", + r"()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); + + /// 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 const jni.JArrayType($JsonSerializable_CaseType()).fromRef( + jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, + jni.JniCallType.objectType, []).object); } - static final _id_new0 = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"valueOf", + r"(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); - /// from: public void () + /// 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. - factory StringValuedMap({ - required jni.JObjType<$K> K, - }) { - return StringValuedMap.fromRef( - K, - jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_new0, []).object); + static JsonSerializable_Case valueOf( + jni.JString name, + ) { + return const $JsonSerializable_CaseType().fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_valueOf, + jni.JniCallType.objectType, [name.reference]).object); } } -final class $StringValuedMapType<$K extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - - const $StringValuedMapType( - this.K, - ); +final class $JsonSerializable_CaseType + extends jni.JObjType { + const $JsonSerializable_CaseType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/generics/StringValuedMap;"; + r"Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"; @override - StringValuedMap<$K> fromRef(jni.JObjectPtr ref) => - StringValuedMap.fromRef(K, ref); + JsonSerializable_Case fromRef(jni.JObjectPtr ref) => + JsonSerializable_Case.fromRef(ref); @override - jni.JObjType get superType => $MyMapType(K, const jni.JStringType()); + jni.JObjType get superType => const jni.JObjectType(); @override - final superCount = 2; + final superCount = 1; @override - int get hashCode => Object.hash($StringValuedMapType, K); + int get hashCode => ($JsonSerializable_CaseType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($StringValuedMapType<$K>) && - other is $StringValuedMapType<$K> && - K == other.K; + return other.runtimeType == ($JsonSerializable_CaseType) && + other is $JsonSerializable_CaseType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyInterface -class MyInterface<$T extends jni.JObject> extends jni.JObject { +/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable +class JsonSerializable extends jni.JObject { @override - late final jni.JObjType> $type = type(T); + late final jni.JObjType $type = type; - final jni.JObjType<$T> T; - - MyInterface.fromRef( - this.T, + JsonSerializable.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); - static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/interfaces/MyInterface"); + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/annotations/JsonSerializable"); /// 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 _id_voidCallback = jni.Jni.accessors.getMethodIDOf( - _class.reference, r"voidCallback", r"(Ljava/lang/String;)V"); - - /// from: public abstract void voidCallback(java.lang.String s) - void voidCallback( - jni.JString s, - ) { - return jni.Jni.accessors.callMethodWithArgs(reference, _id_voidCallback, - jni.JniCallType.voidType, [s.reference]).check(); - } - - static final _id_stringCallback = jni.Jni.accessors.getMethodIDOf( - _class.reference, - r"stringCallback", - r"(Ljava/lang/String;)Ljava/lang/String;"); - - /// 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 const jni.JStringType().fromRef(jni.Jni.accessors.callMethodWithArgs( - reference, - _id_stringCallback, - jni.JniCallType.objectType, - [s.reference]).object); - } - - static final _id_varCallback = jni.Jni.accessors.getMethodIDOf( + static const type = $JsonSerializableType(); + static final _id_value = jni.Jni.accessors.getMethodIDOf( _class.reference, - r"varCallback", - r"(Ljava/lang/Object;)Ljava/lang/Object;"); + r"value", + r"()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); - /// from: public abstract T varCallback(T t) + /// 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. - $T varCallback( - $T t, - ) { - return T.fromRef(jni.Jni.accessors.callMethodWithArgs(reference, - _id_varCallback, jni.JniCallType.objectType, [t.reference]).object); - } - - static final _id_manyPrimitives = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"manyPrimitives", r"(IZCD)J"); - - /// from: public abstract long manyPrimitives(int a, boolean b, char c, double d) - int manyPrimitives( - int a, - bool b, - int c, - double d, - ) { - return jni.Jni.accessors.callMethodWithArgs( - reference, - _id_manyPrimitives, - jni.JniCallType.longType, - [jni.JValueInt(a), b ? 1 : 0, jni.JValueChar(c), d]).long; + JsonSerializable_Case value() { + return const $JsonSerializable_CaseType().fromRef(jni.Jni.accessors + .callMethodWithArgs( + reference, _id_value, jni.JniCallType.objectType, []).object); } /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; + static final Map _$impls = {}; ReceivePort? _$p; static jni.JObjectPtr _$invoke( @@ -3196,55 +3095,24 @@ class MyInterface<$T extends jni.JObject> extends jni.JObject { 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()).toPointer(); - } - if ($d == r"varCallback(Ljava/lang/Object;)Ljava/lang/Object;") { - final $r = _$impls[$p]!.varCallback( - $a[0].castTo(_$impls[$p]!.T, releaseOriginal: true), - ); + 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()).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).toPointer(); - } } catch (e) { return ProtectedJniExtensions.newDartException(e.toString()); } return jni.nullptr; } - factory MyInterface.implement( - $MyInterfaceImpl<$T> $impl, + factory JsonSerializable.implement( + $JsonSerializableImpl $impl, ) { final $p = ReceivePort(); - final $x = MyInterface.fromRef( - $impl.T, + final $x = JsonSerializable.fromRef( ProtectedJniExtensions.newPortProxy( - r"com.github.dart_lang.jnigen.interfaces.MyInterface", + r"com.github.dart_lang.jnigen.annotations.JsonSerializable", $p, _$invokePointer, ), @@ -3263,78 +3131,155 @@ class MyInterface<$T extends jni.JObject> extends jni.JObject { }); 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; +abstract interface class $JsonSerializableImpl { + factory $JsonSerializableImpl({ + required JsonSerializable_Case Function() value, + }) = _$JsonSerializableImpl; - jni.JObjType<$T> get T; + JsonSerializable_Case value(); +} - 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 _$JsonSerializableImpl implements $JsonSerializableImpl { + _$JsonSerializableImpl({ + required JsonSerializable_Case Function() value, + }) : _value = value; + + final JsonSerializable_Case Function() _value; + + JsonSerializable_Case value() { + return _value(); + } } -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; +final class $JsonSerializableType extends jni.JObjType { + const $JsonSerializableType(); @override - final jni.JObjType<$T> T; + String get signature => + r"Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;"; - 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; + @override + JsonSerializable fromRef(jni.JObjectPtr ref) => JsonSerializable.fromRef(ref); - void voidCallback(jni.JString s) { - return _voidCallback(s); + @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; } +} - jni.JString stringCallback(jni.JString s) { - return _stringCallback(s); +/// from: com.github.dart_lang.jnigen.annotations.MyDataClass +class MyDataClass extends jni.JObject { + @override + late final jni.JObjType $type = type; + + MyDataClass.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = jni.Jni.findJClass( + r"com/github/dart_lang/jnigen/annotations/MyDataClass"); + + /// The type which includes information such as the signature of this class. + static const type = $MyDataClassType(); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); + + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory MyDataClass() { + return MyDataClass.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } +} - $T varCallback($T t) { - return _varCallback(t); +final class $MyDataClassType extends jni.JObjType { + const $MyDataClassType(); + + @override + String get signature => + r"Lcom/github/dart_lang/jnigen/annotations/MyDataClass;"; + + @override + MyDataClass fromRef(jni.JObjectPtr ref) => MyDataClass.fromRef(ref); + + @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; } +} - int manyPrimitives(int a, bool b, int c, double d) { - return _manyPrimitives(a, b, c, d); +/// from: com.github.dart_lang.jnigen.simple_package.Color +class Color extends jni.JObject { + @override + late final jni.JObjType $type = type; + + Color.fromRef( + jni.JObjectPtr ref, + ) : super.fromRef(ref); + + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/simple_package/Color"); + + /// The type which includes information such as the signature of this class. + static const type = $ColorType(); + static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"values", + r"()[Lcom/github/dart_lang/jnigen/simple_package/Color;"); + + /// 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 const jni.JArrayType($ColorType()).fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_values, + jni.JniCallType.objectType, []).object); + } + + static final _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, + r"valueOf", + r"(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;"); + + /// 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 const $ColorType().fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_valueOf, + jni.JniCallType.objectType, [name.reference]).object); } } -final class $MyInterfaceType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - - const $MyInterfaceType( - this.T, - ); +final class $ColorType extends jni.JObjType { + const $ColorType(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyInterface;"; + String get signature => r"Lcom/github/dart_lang/jnigen/simple_package/Color;"; @override - MyInterface<$T> fromRef(jni.JObjectPtr ref) => MyInterface.fromRef(T, ref); + Color fromRef(jni.JObjectPtr ref) => Color.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3343,115 +3288,232 @@ final class $MyInterfaceType<$T extends jni.JObject> final superCount = 1; @override - int get hashCode => Object.hash($MyInterfaceType, T); + int get hashCode => ($ColorType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceType<$T>) && - other is $MyInterfaceType<$T> && - T == other.T; + return other.runtimeType == ($ColorType) && other is $ColorType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer -class MyInterfaceConsumer extends jni.JObject { +/// from: com.github.dart_lang.jnigen.simple_package.Exceptions +class Exceptions extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyInterfaceConsumer.fromRef( + Exceptions.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer"); + r"com/github/dart_lang/jnigen/simple_package/Exceptions"); /// The type which includes information such as the signature of this class. - static const type = $MyInterfaceConsumerType(); + static const type = $ExceptionsType(); static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory MyInterfaceConsumer() { - return MyInterfaceConsumer.fromRef(jni.Jni.accessors + factory Exceptions() { + return Exceptions.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); } - static final _id_consumeOnAnotherThread = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"consumeOnAnotherThread", - r"(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V"); + static final _id_new1 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"(F)V"); - /// 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, + /// 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.fromRef(jni.Jni.accessors.newObjectWithArgs( + _class.reference, _id_new1, [jni.JValueFloat(x)]).object); + } + + static final _id_new2 = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"", r"(IIIIII)V"); + + /// 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, - bool b, + int 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>; - return jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, - _id_consumeOnAnotherThread, jni.JniCallType.voidType, [ - myInterface.reference, - s.reference, + int d, + int e, + int f, + ) { + return Exceptions.fromRef( + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new2, [ jni.JValueInt(a), - b ? 1 : 0, - jni.JValueChar(c), - d, - t.reference - ]).check(); + jni.JValueInt(b), + jni.JValueInt(c), + jni.JValueInt(d), + jni.JValueInt(e), + jni.JValueInt(f) + ]).object); } - static final _id_consumeOnSameThread = jni.Jni.accessors.getStaticMethodIDOf( + static final _id_staticObjectMethod = jni.Jni.accessors.getStaticMethodIDOf( + _class.reference, r"staticObjectMethod", r"()Ljava/lang/Object;"); + + /// 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 const jni.JObjectType().fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_staticObjectMethod, + jni.JniCallType.objectType, []).object); + } + + static final _id_staticIntMethod = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"staticIntMethod", r"()I"); + + /// from: static public int staticIntMethod() + static int staticIntMethod() { + return jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, + _id_staticIntMethod, jni.JniCallType.intType, []).integer; + } + + static final _id_staticObjectArrayMethod = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"staticObjectArrayMethod", + r"()[Ljava/lang/Object;"); + + /// 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 const jni.JArrayType(jni.JObjectType()).fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_staticObjectArrayMethod, + jni.JniCallType.objectType, []).object); + } + + static final _id_staticIntArrayMethod = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"staticIntArrayMethod", r"()[I"); + + /// from: static public int[] staticIntArrayMethod() + /// The returned object must be released after use, by calling the [release] method. + static jni.JArray staticIntArrayMethod() { + return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors + .callStaticMethodWithArgs(_class.reference, _id_staticIntArrayMethod, + jni.JniCallType.objectType, []).object); + } + + static final _id_objectMethod = jni.Jni.accessors.getMethodIDOf( + _class.reference, r"objectMethod", r"()Ljava/lang/Object;"); + + /// from: public java.lang.Object objectMethod() + /// The returned object must be released after use, by calling the [release] method. + jni.JObject objectMethod() { + return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( + reference, _id_objectMethod, jni.JniCallType.objectType, []).object); + } + + static final _id_intMethod = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"intMethod", r"()I"); + + /// from: public int intMethod() + int intMethod() { + return jni.Jni.accessors.callMethodWithArgs( + reference, _id_intMethod, jni.JniCallType.intType, []).integer; + } + + static final _id_objectArrayMethod = jni.Jni.accessors.getMethodIDOf( + _class.reference, r"objectArrayMethod", r"()[Ljava/lang/Object;"); + + /// from: public java.lang.Object[] objectArrayMethod() + /// The returned object must be released after use, by calling the [release] method. + jni.JArray objectArrayMethod() { + return const jni.JArrayType(jni.JObjectType()).fromRef(jni.Jni.accessors + .callMethodWithArgs(reference, _id_objectArrayMethod, + jni.JniCallType.objectType, []).object); + } + + static final _id_intArrayMethod = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"intArrayMethod", r"()[I"); + + /// from: public int[] intArrayMethod() + /// The returned object must be released after use, by calling the [release] method. + jni.JArray intArrayMethod() { + return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors + .callMethodWithArgs(reference, _id_intArrayMethod, + jni.JniCallType.objectType, []).object); + } + + static final _id_throwNullPointerException = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"throwNullPointerException", r"()I"); + + /// from: public int throwNullPointerException() + int throwNullPointerException() { + return jni.Jni.accessors.callMethodWithArgs(reference, + _id_throwNullPointerException, jni.JniCallType.intType, []).integer; + } + + static final _id_throwFileNotFoundException = jni.Jni.accessors.getMethodIDOf( _class.reference, - r"consumeOnSameThread", - r"(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V"); + r"throwFileNotFoundException", + r"()Ljava/io/InputStream;"); - /// 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>; - return jni.Jni.accessors.callStaticMethodWithArgs( - _class.reference, _id_consumeOnSameThread, jni.JniCallType.voidType, [ - myInterface.reference, - s.reference, - jni.JValueInt(a), - b ? 1 : 0, - jni.JValueChar(c), - d, - t.reference - ]).check(); + /// from: public java.io.InputStream throwFileNotFoundException() + /// The returned object must be released after use, by calling the [release] method. + jni.JObject throwFileNotFoundException() { + return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( + reference, + _id_throwFileNotFoundException, + jni.JniCallType.objectType, []).object); + } + + static final _id_throwClassCastException = jni.Jni.accessors.getMethodIDOf( + _class.reference, + r"throwClassCastException", + r"()Ljava/io/FileInputStream;"); + + /// from: public java.io.FileInputStream throwClassCastException() + /// The returned object must be released after use, by calling the [release] method. + jni.JObject throwClassCastException() { + return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( + reference, + _id_throwClassCastException, + jni.JniCallType.objectType, []).object); + } + + static final _id_throwArrayIndexException = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"throwArrayIndexException", r"()I"); + + /// from: public int throwArrayIndexException() + int throwArrayIndexException() { + return jni.Jni.accessors.callMethodWithArgs(reference, + _id_throwArrayIndexException, jni.JniCallType.intType, []).integer; + } + + static final _id_throwArithmeticException = jni.Jni.accessors + .getMethodIDOf(_class.reference, r"throwArithmeticException", r"()I"); + + /// from: public int throwArithmeticException() + int throwArithmeticException() { + return jni.Jni.accessors.callMethodWithArgs(reference, + _id_throwArithmeticException, jni.JniCallType.intType, []).integer; + } + + static final _id_throwLoremIpsum = jni.Jni.accessors + .getStaticMethodIDOf(_class.reference, r"throwLoremIpsum", r"()V"); + + /// from: static public void throwLoremIpsum() + static void throwLoremIpsum() { + return jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, + _id_throwLoremIpsum, jni.JniCallType.voidType, []).check(); } } -final class $MyInterfaceConsumerType extends jni.JObjType { - const $MyInterfaceConsumerType(); +final class $ExceptionsType extends jni.JObjType { + const $ExceptionsType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;"; + r"Lcom/github/dart_lang/jnigen/simple_package/Exceptions;"; @override - MyInterfaceConsumer fromRef(jni.JObjectPtr ref) => - MyInterfaceConsumer.fromRef(ref); + Exceptions fromRef(jni.JObjectPtr ref) => Exceptions.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3460,136 +3522,209 @@ final class $MyInterfaceConsumerType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($MyInterfaceConsumerType).hashCode; + int get hashCode => ($ExceptionsType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceConsumerType) && - other is $MyInterfaceConsumerType; + return other.runtimeType == ($ExceptionsType) && other is $ExceptionsType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyRunnable -class MyRunnable extends jni.JObject { +/// from: com.github.dart_lang.jnigen.simple_package.Fields +class Fields extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyRunnable.fromRef( + Fields.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = - jni.Jni.findJClass(r"com/github/dart_lang/jnigen/interfaces/MyRunnable"); + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/simple_package/Fields"); /// The type which includes information such as the signature of this class. - static const type = $MyRunnableType(); - static final _id_run = - jni.Jni.accessors.getMethodIDOf(_class.reference, r"run", r"()V"); + static const type = $FieldsType(); + static final _id_amount = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"amount", + r"I", + ); - /// from: public abstract void run() - void run() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_run, jni.JniCallType.voidType, []).check(); - } + /// from: static public int amount + static int get amount => jni.Jni.accessors + .getStaticField(_class.reference, _id_amount, jni.JniCallType.intType) + .integer; - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; + /// from: static public int amount + static set amount(int value) => + jni.Jni.env.SetStaticIntField(_class.reference, _id_amount, value); - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } + static final _id_pi = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"pi", + r"D", + ); - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + /// from: static public double pi + static double get pi => jni.Jni.accessors + .getStaticField(_class.reference, _id_pi, jni.JniCallType.doubleType) + .doubleFloat; - 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; - } + /// from: static public double pi + static set pi(double value) => + jni.Jni.env.SetStaticDoubleField(_class.reference, _id_pi, value); - factory MyRunnable.implement( - $MyRunnableImpl $impl, - ) { - final $p = ReceivePort(); - final $x = MyRunnable.fromRef( - 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; - } -} + static final _id_asterisk = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"asterisk", + r"C", + ); -abstract interface class $MyRunnableImpl { - factory $MyRunnableImpl({ - required void Function() run, - }) = _$MyRunnableImpl; + /// from: static public char asterisk + static int get asterisk => jni.Jni.accessors + .getStaticField(_class.reference, _id_asterisk, jni.JniCallType.charType) + .char; + + /// from: static public char asterisk + static set asterisk(int value) => + jni.Jni.env.SetStaticCharField(_class.reference, _id_asterisk, value); + + static final _id_name = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"name", + r"Ljava/lang/String;", + ); + + /// 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 => const jni.JStringType().fromRef(jni + .Jni.accessors + .getStaticField(_class.reference, _id_name, jni.JniCallType.objectType) + .object); + + /// 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) => jni.Jni.env + .SetStaticObjectField(_class.reference, _id_name, value.reference); + + static final _id_i = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"i", + r"Ljava/lang/Integer;", + ); + + /// from: public java.lang.Integer i + /// The returned object must be released after use, by calling the [release] method. + jni.JInteger get i => const jni.JIntegerType().fromRef(jni.Jni.accessors + .getField(reference, _id_i, jni.JniCallType.objectType) + .object); + + /// from: public java.lang.Integer i + /// The returned object must be released after use, by calling the [release] method. + set i(jni.JInteger value) => + jni.Jni.env.SetObjectField(reference, _id_i, value.reference); + + static final _id_trillion = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"trillion", + r"J", + ); + + /// from: public long trillion + int get trillion => jni.Jni.accessors + .getField(reference, _id_trillion, jni.JniCallType.longType) + .long; + + /// from: public long trillion + set trillion(int value) => + jni.Jni.env.SetLongField(reference, _id_trillion, value); + + static final _id_isAchillesDead = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"isAchillesDead", + r"Z", + ); + + /// from: public boolean isAchillesDead + bool get isAchillesDead => jni.Jni.accessors + .getField(reference, _id_isAchillesDead, jni.JniCallType.booleanType) + .boolean; + + /// from: public boolean isAchillesDead + set isAchillesDead(bool value) => + jni.Jni.env.SetBooleanField(reference, _id_isAchillesDead, value ? 1 : 0); + + static final _id_bestFighterInGreece = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"bestFighterInGreece", + r"Ljava/lang/String;", + ); + + /// from: public java.lang.String bestFighterInGreece + /// The returned object must be released after use, by calling the [release] method. + jni.JString get bestFighterInGreece => const jni.JStringType().fromRef(jni + .Jni.accessors + .getField(reference, _id_bestFighterInGreece, jni.JniCallType.objectType) + .object); + + /// from: public java.lang.String bestFighterInGreece + /// The returned object must be released after use, by calling the [release] method. + set bestFighterInGreece(jni.JString value) => jni.Jni.env + .SetObjectField(reference, _id_bestFighterInGreece, value.reference); + + static final _id_random = jni.Jni.accessors.getFieldIDOf( + _class.reference, + r"random", + r"Ljava/util/Random;", + ); + + /// from: public java.util.Random random + /// The returned object must be released after use, by calling the [release] method. + jni.JObject get random => const jni.JObjectType().fromRef(jni.Jni.accessors + .getField(reference, _id_random, jni.JniCallType.objectType) + .object); + + /// from: public java.util.Random random + /// The returned object must be released after use, by calling the [release] method. + set random(jni.JObject value) => + jni.Jni.env.SetObjectField(reference, _id_random, value.reference); + + static final _id_euroSymbol = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"euroSymbol", + r"C", + ); - void run(); -} + /// from: static public char euroSymbol + static int get euroSymbol => jni.Jni.accessors + .getStaticField( + _class.reference, _id_euroSymbol, jni.JniCallType.charType) + .char; -class _$MyRunnableImpl implements $MyRunnableImpl { - _$MyRunnableImpl({ - required void Function() run, - }) : _run = run; + /// from: static public char euroSymbol + static set euroSymbol(int value) => + jni.Jni.env.SetStaticCharField(_class.reference, _id_euroSymbol, value); - final void Function() _run; + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - void run() { - return _run(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory Fields() { + return Fields.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } -final class $MyRunnableType extends jni.JObjType { - const $MyRunnableType(); +final class $FieldsType extends jni.JObjType { + const $FieldsType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;"; + r"Lcom/github/dart_lang/jnigen/simple_package/Fields;"; @override - MyRunnable fromRef(jni.JObjectPtr ref) => MyRunnable.fromRef(ref); + Fields fromRef(jni.JObjectPtr ref) => Fields.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3598,85 +3733,82 @@ final class $MyRunnableType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($MyRunnableType).hashCode; + int get hashCode => ($FieldsType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableType) && other is $MyRunnableType; + return other.runtimeType == ($FieldsType) && other is $FieldsType; } } -/// from: com.github.dart_lang.jnigen.interfaces.MyRunnableRunner -class MyRunnableRunner extends jni.JObject { +/// from: com.github.dart_lang.jnigen.simple_package.Fields$Nested +class Fields_Nested extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyRunnableRunner.fromRef( + Fields_Nested.fromRef( jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/interfaces/MyRunnableRunner"); + r"com/github/dart_lang/jnigen/simple_package/Fields$Nested"); /// The type which includes information such as the signature of this class. - static const type = $MyRunnableRunnerType(); - static final _id_error = jni.Jni.accessors.getFieldIDOf( + static const type = $Fields_NestedType(); + static final _id_hundred = jni.Jni.accessors.getFieldIDOf( _class.reference, - r"error", - r"Ljava/lang/Throwable;", + r"hundred", + r"J", ); - /// from: public java.lang.Throwable error - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get error => const jni.JObjectType().fromRef(jni.Jni.accessors - .getField(reference, _id_error, jni.JniCallType.objectType) - .object); + /// from: public long hundred + int get hundred => jni.Jni.accessors + .getField(reference, _id_hundred, jni.JniCallType.longType) + .long; - /// from: public java.lang.Throwable error - /// The returned object must be released after use, by calling the [release] method. - set error(jni.JObject value) => - jni.Jni.env.SetObjectField(reference, _id_error, value.reference); + /// from: public long hundred + set hundred(int value) => + jni.Jni.env.SetLongField(reference, _id_hundred, value); - static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, - r"", r"(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V"); + static final _id_BEST_GOD = jni.Jni.accessors.getStaticFieldIDOf( + _class.reference, + r"BEST_GOD", + r"Ljava/lang/String;", + ); - /// from: public void (com.github.dart_lang.jnigen.interfaces.MyRunnable runnable) + /// from: static public java.lang.String BEST_GOD /// The returned object must be released after use, by calling the [release] method. - factory MyRunnableRunner( - MyRunnable runnable, - ) { - return MyRunnableRunner.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_new0, [runnable.reference]).object); - } - - static final _id_runOnSameThread = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"runOnSameThread", r"()V"); + static jni.JString get BEST_GOD => + const jni.JStringType().fromRef(jni.Jni.accessors + .getStaticField( + _class.reference, _id_BEST_GOD, jni.JniCallType.objectType) + .object); - /// from: public void runOnSameThread() - void runOnSameThread() { - return jni.Jni.accessors.callMethodWithArgs( - reference, _id_runOnSameThread, jni.JniCallType.voidType, []).check(); - } + /// 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) => jni.Jni.env + .SetStaticObjectField(_class.reference, _id_BEST_GOD, value.reference); - static final _id_runOnAnotherThread = jni.Jni.accessors - .getMethodIDOf(_class.reference, r"runOnAnotherThread", r"()V"); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - /// from: public void runOnAnotherThread() - void runOnAnotherThread() { - return jni.Jni.accessors.callMethodWithArgs(reference, - _id_runOnAnotherThread, jni.JniCallType.voidType, []).check(); + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory Fields_Nested() { + return Fields_Nested.fromRef(jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } -final class $MyRunnableRunnerType extends jni.JObjType { - const $MyRunnableRunnerType(); +final class $Fields_NestedType extends jni.JObjType { + const $Fields_NestedType(); @override String get signature => - r"Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;"; + r"Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;"; @override - MyRunnableRunner fromRef(jni.JObjectPtr ref) => MyRunnableRunner.fromRef(ref); + Fields_Nested fromRef(jni.JObjectPtr ref) => Fields_Nested.fromRef(ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3685,69 +3817,79 @@ final class $MyRunnableRunnerType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($MyRunnableRunnerType).hashCode; + int get hashCode => ($Fields_NestedType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableRunnerType) && - other is $MyRunnableRunnerType; + return other.runtimeType == ($Fields_NestedType) && + other is $Fields_NestedType; } } -/// from: com.github.dart_lang.jnigen.annotations.JsonSerializable$Case -class JsonSerializable_Case extends jni.JObject { +/// 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; + late final jni.JObjType> $type = type(S, K); - JsonSerializable_Case.fromRef( + final jni.JObjType<$S> S; + final jni.JObjType<$K> K; + + GenericTypeParams.fromRef( + this.S, + this.K, jni.JObjectPtr ref, ) : super.fromRef(ref); static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/annotations/JsonSerializable$Case"); + r"com/github/dart_lang/jnigen/generics/GenericTypeParams"); /// The type which includes information such as the signature of this class. - static const type = $JsonSerializable_CaseType(); - static final _id_values = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"values", - r"()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); - - /// 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 const jni.JArrayType($JsonSerializable_CaseType()).fromRef( - jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, - jni.JniCallType.objectType, []).object); + 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 _id_valueOf = jni.Jni.accessors.getStaticMethodIDOf( - _class.reference, - r"valueOf", - r"(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); + static final _id_new0 = + jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); - /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case valueOf(java.lang.String name) + /// from: public void () /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case valueOf( - jni.JString name, - ) { - return const $JsonSerializable_CaseType().fromRef(jni.Jni.accessors - .callStaticMethodWithArgs(_class.reference, _id_valueOf, - jni.JniCallType.objectType, [name.reference]).object); + factory GenericTypeParams({ + required jni.JObjType<$S> S, + required jni.JObjType<$K> K, + }) { + return GenericTypeParams.fromRef( + S, + K, + jni.Jni.accessors + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } -final class $JsonSerializable_CaseType - extends jni.JObjType { - const $JsonSerializable_CaseType(); +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/annotations/JsonSerializable$Case;"; + r"Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;"; @override - JsonSerializable_Case fromRef(jni.JObjectPtr ref) => - JsonSerializable_Case.fromRef(ref); + GenericTypeParams<$S, $K> fromRef(jni.JObjectPtr ref) => + GenericTypeParams.fromRef(S, K, ref); @override jni.JObjType get superType => const jni.JObjectType(); @@ -3756,61 +3898,62 @@ final class $JsonSerializable_CaseType final superCount = 1; @override - int get hashCode => ($JsonSerializable_CaseType).hashCode; + int get hashCode => Object.hash($GenericTypeParamsType, S, K); @override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_CaseType) && - other is $JsonSerializable_CaseType; + return other.runtimeType == ($GenericTypeParamsType<$S, $K>) && + other is $GenericTypeParamsType<$S, $K> && + S == other.S && + K == other.K; } } -/// from: com.github.dart_lang.jnigen.annotations.MyDataClass -class MyDataClass extends jni.JObject { +/// from: com.github.dart_lang.jnigen.generics.StringMap +class StringMap extends StringKeyedMap { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - MyDataClass.fromRef( + StringMap.fromRef( jni.JObjectPtr ref, - ) : super.fromRef(ref); + ) : super.fromRef(const jni.JStringType(), ref); - static final _class = jni.Jni.findJClass( - r"com/github/dart_lang/jnigen/annotations/MyDataClass"); + static final _class = + jni.Jni.findJClass(r"com/github/dart_lang/jnigen/generics/StringMap"); /// The type which includes information such as the signature of this class. - static const type = $MyDataClassType(); + static const type = $StringMapType(); static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"", r"()V"); /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory MyDataClass() { - return MyDataClass.fromRef(jni.Jni.accessors + factory StringMap() { + return StringMap.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); } } -final class $MyDataClassType extends jni.JObjType { - const $MyDataClassType(); +final class $StringMapType extends jni.JObjType { + const $StringMapType(); @override - String get signature => - r"Lcom/github/dart_lang/jnigen/annotations/MyDataClass;"; + String get signature => r"Lcom/github/dart_lang/jnigen/generics/StringMap;"; @override - MyDataClass fromRef(jni.JObjectPtr ref) => MyDataClass.fromRef(ref); + StringMap fromRef(jni.JObjectPtr ref) => StringMap.fromRef(ref); @override - jni.JObjType get superType => const jni.JObjectType(); + jni.JObjType get superType => const $StringKeyedMapType(jni.JStringType()); @override - final superCount = 1; + final superCount = 3; @override - int get hashCode => ($MyDataClassType).hashCode; + int get hashCode => ($StringMapType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($MyDataClassType) && other is $MyDataClassType; + return other.runtimeType == ($StringMapType) && other is $StringMapType; } } diff --git a/pkgs/jnigen/test/summary_generation_test.dart b/pkgs/jnigen/test/summary_generation_test.dart index 62eee3b8a1..89a6a494d7 100644 --- a/pkgs/jnigen/test/summary_generation_test.dart +++ b/pkgs/jnigen/test/summary_generation_test.dart @@ -145,9 +145,12 @@ void main() async { group('Test summary generation from combination', () { final targetDir = tempDir.createTempSync("combination_test_"); final classesJarPath = join(targetDir.path, 'classes.jar'); - // remove a class from source files and create a source JAR final sourceFiles = javaFiles.toList(); - sourceFiles.removeLast(); + // Remove com/github/dart_lang/jnigen/pkg2/Example.java. + // Instead we expect the summary to find this class from the + // [classesJarPath]. + sourceFiles.removeWhere((element) => + element.contains('pkg2') && element.contains('Example.java')); final sourceJarPath = join(targetDir.path, 'sources.jar'); setUpAll(() async { await createJar( @@ -168,6 +171,24 @@ void main() async { classPath: [classesJarPath], sourcePath: [sourceJarPath], ); + test('Prefer source over bytecode for generation', () async { + final config = getSummaryGenerationConfig( + sourcePath: [sourceJarPath], classPath: [classesJarPath]); + final classes = await getSummary(config); + // Fully qualified name for a class that exists both in .class and in + // .java formats. + const binaryName = 'com.github.dart_lang.jnigen.simple_package.Example'; + final addIntsMethod = classes.decls[binaryName]!.methods + .firstWhere((method) => method.name == 'addInts'); + // No method parameter name remains in the bytecode. Instead generic names + // are used. [addInts] method has two parameters named `a` and `b`. + // Checking if these two names are preserved, which means that the source + // is used for summary when both source and the bytecode exist. + expect( + addIntsMethod.params.map((param) => param.name).toList(), + ['a', 'b'], + ); + }); }); tearDownAll(() => deleteTempDirWithDelay(tempDir));