diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml index 0f0c792ab..764cba199 100644 --- a/.github/workflows/ffigen.yml +++ b/.github/workflows/ffigen.yml @@ -98,6 +98,24 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true + test-mac-flutter: + needs: analyze + runs-on: 'macos-latest' + defaults: + run: + working-directory: pkgs/ffigen/ + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + with: + channel: 'stable' + - name: Install dependencies + run: flutter pub get + - name: Build test dylib and bindings + run: dart test/setup.dart + - name: Run Flutter tests + run: flutter test + test-windows: needs: analyze runs-on: windows-latest diff --git a/.github/workflows/ffigen_weekly.yml b/.github/workflows/ffigen_weekly.yml index 2c246aa2c..9dfb93ccb 100644 --- a/.github/workflows/ffigen_weekly.yml +++ b/.github/workflows/ffigen_weekly.yml @@ -29,4 +29,4 @@ jobs: - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests - run: dart test + run: flutter test diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml index 806251180..42a0577da 100644 --- a/.github/workflows/jnigen.yaml +++ b/.github/workflows/jnigen.yaml @@ -84,7 +84,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' cache: maven ## Committed bindings are formatted with clang-format. ## So this is required to format generated bindings identically @@ -135,7 +135,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a name: 'Check Java formatting with google-java-format' with: @@ -173,7 +173,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - run: | sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev libclang-dev @@ -222,7 +222,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - run: Add-Content $env:GITHUB_PATH "$env:JAVA_HOME\bin\server" - run: dart pub get - run: dart run jni:setup @@ -249,7 +249,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - run: git config --global core.autocrlf true - run: Add-Content $env:GITHUB_PATH "$env:JAVA_HOME\bin\server" - run: dart pub get @@ -275,7 +275,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - run: dart pub get - run: dart run jni:setup - run: dart test --test-randomize-ordering-seed random @@ -300,7 +300,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - run: git config --global core.autocrlf true - run: dart pub get - name: Build summarizer @@ -323,7 +323,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - run: | sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev @@ -347,7 +347,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - run: flutter config --enable-windows-desktop - run: flutter pub get - run: flutter build windows @@ -362,7 +362,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: 'stable' @@ -386,7 +386,7 @@ jobs: - uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - run: | sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev clang-format diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 693b1220e..32b22e01c 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -66,9 +66,6 @@ jobs: - run: dart pub get -C test_data/native_add_duplicate/ if: ${{ matrix.package == 'native_assets_builder' }} - - run: dart pub get -C test_data/native_add_v1_0_0/ - if: ${{ matrix.package == 'native_assets_builder' }} - - run: dart pub get -C test_data/native_add_add_source/ if: ${{ matrix.package == 'native_assets_builder' }} @@ -96,6 +93,9 @@ jobs: - run: dart pub get -C test_data/add_asset_link/ if: ${{ matrix.package == 'native_assets_builder' }} + - run: dart pub get -C test_data/transformer/ + if: ${{ matrix.package == 'native_assets_builder' }} + - run: dart pub get -C test_data/treeshaking_native_libs/ if: ${{ matrix.package == 'native_assets_builder' }} diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6cc74b9eb..436976506 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,7 +1,18 @@ ## 15.0.0-wip -- Dedupe `ObjCBlock` trampolines to reduce generated ObjC code. - Update to latest `package:objective_c`. +- ObjC objects now include the methods from the protocols they implement. Both + required and optional methods are included. Optional methods will throw an + exception if the method isn't implemented. +- __Breaking change__: Only generate ObjC protocol implementation bindings for + protocols that are included by the config filters. This is breaking because + previously super protocols would automatically get implementation bindings, + rather than just being incorporated into the child protocol. If you want those + implementation bindings, you may need to add the super protocol to your + `objc-protocols` filters. +- Fix a bug where ObjC listener blocks could be deleted after being invoked by + ObjC but before the invocation was received by Dart: + https://github.com/dart-lang/native/issues/1571 ## 14.0.1 diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index aa9c0ae53..2e699f395 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -21,7 +21,16 @@ class ObjCBlock extends BindingType { required bool returnsRetained, required ObjCBuiltInFunctions builtInFunctions, }) { - final usr = _getBlockUsr(returnType, params, returnsRetained); + final renamedParams = [ + for (var i = 0; i < params.length; ++i) + Parameter( + name: 'arg$i', + type: params[i].type, + objCConsumed: params[i].objCConsumed, + ), + ]; + + final usr = _getBlockUsr(returnType, renamedParams, returnsRetained); final oldBlock = bindingsIndex.getSeenObjCBlock(usr); if (oldBlock != null) { @@ -30,9 +39,9 @@ class ObjCBlock extends BindingType { final block = ObjCBlock._( usr: usr, - name: _getBlockName(returnType, params.map((a) => a.type)), + name: _getBlockName(returnType, renamedParams.map((a) => a.type)), returnType: returnType, - params: params, + params: renamedParams, returnsRetained: returnsRetained, builtInFunctions: builtInFunctions, ); @@ -103,11 +112,18 @@ class ObjCBlock extends BindingType { w.topLevelUniqueNamer.makeUnique('_${name}_fnPtrTrampoline'); final closureTrampoline = w.topLevelUniqueNamer.makeUnique('_${name}_closureTrampoline'); + final funcPtrCallable = + w.topLevelUniqueNamer.makeUnique('_${name}_fnPtrCallable'); + final closureCallable = + w.topLevelUniqueNamer.makeUnique('_${name}_closureCallable'); + final listenerCallable = + w.topLevelUniqueNamer.makeUnique('_${name}_listenerCallable'); final callExtension = w.topLevelUniqueNamer.makeUnique('${name}_CallExtension'); final newPointerBlock = ObjCBuiltInFunctions.newPointerBlock.gen(w); final newClosureBlock = ObjCBuiltInFunctions.newClosureBlock.gen(w); final getBlockClosure = ObjCBuiltInFunctions.getBlockClosure.gen(w); + final releaseFn = ObjCBuiltInFunctions.objectRelease.gen(w); final trampFuncType = FunctionType(returnType: returnType, parameters: [ Parameter(type: blockPtr, name: 'block', objCConsumed: false), ...params @@ -124,6 +140,8 @@ class ObjCBlock extends BindingType { final returnFfiDartType = returnType.getFfiDartType(w); final blockCType = blockPtr.getCType(w); final blockType = _blockType(w); + final defaultValue = returnType.getDefaultValue(w); + final exceptionalReturn = defaultValue == null ? '' : ', $defaultValue'; final paramsNameOnly = params.map((p) => p.name).join(', '); final paramsFfiDartType = @@ -136,13 +154,28 @@ class ObjCBlock extends BindingType { $returnFfiDartType $funcPtrTrampoline($blockCType block, $paramsFfiDartType) => block.ref.target.cast<${natFnType.getFfiDartType(w)}>() .asFunction<$funcFfiDartType>()($paramsNameOnly); +$voidPtr $funcPtrCallable = ${w.ffiLibraryPrefix}.Pointer.fromFunction< + $trampFuncCType>($funcPtrTrampoline $exceptionalReturn).cast(); '''); // Write the closure based trampoline function. s.write(''' $returnFfiDartType $closureTrampoline($blockCType block, $paramsFfiDartType) => ($getBlockClosure(block) as $funcFfiDartType)($paramsNameOnly); +$voidPtr $closureCallable = ${w.ffiLibraryPrefix}.Pointer.fromFunction< + $trampFuncCType>($closureTrampoline $exceptionalReturn).cast(); +'''); + + if (hasListener) { + // Write the listener trampoline function. + s.write(''' +$nativeCallableType $listenerCallable = $nativeCallableType.listener( + ($blockCType block, $paramsFfiDartType) { + ($getBlockClosure(block) as $funcFfiDartType)($paramsNameOnly); + $releaseFn(block.cast()); +} $exceptionalReturn)..keepIsolateAlive = false; '''); + } // Snippet that converts a Dart typed closure to FfiDart type. This snippet // is used below. Note that the closure being converted is called `fn`. @@ -162,8 +195,6 @@ $returnFfiDartType $closureTrampoline($blockCType block, $paramsFfiDartType) => final convFn = '($paramsFfiDartType) => $convFnInvocation'; // Write the wrapper class. - final defaultValue = returnType.getDefaultValue(w); - final exceptionalReturn = defaultValue == null ? '' : ', $defaultValue'; s.write(''' /// Construction methods for `$blockType`. @@ -179,12 +210,8 @@ abstract final class $name { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static $blockType fromFunctionPointer($natFnPtr ptr) => - $blockType($newPointerBlock( - _cFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< - $trampFuncCType>($funcPtrTrampoline - $exceptionalReturn).cast(), ptr.cast()), + $blockType($newPointerBlock($funcPtrCallable, ptr.cast()), retain: false, release: true); - static $voidPtr? _cFuncTrampoline; /// Creates a block from a Dart function. /// @@ -192,11 +219,8 @@ abstract final class $name { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static $blockType fromFunction($funcDartType fn) => - $blockType($newClosureBlock( - _dartFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< - $trampFuncCType>($closureTrampoline $exceptionalReturn).cast(), - $convFn), retain: false, release: true); - static $voidPtr? _dartFuncTrampoline; + $blockType($newClosureBlock($closureCallable, $convFn), + retain: false, release: true); '''); // Listener block constructor is only available for void blocks. @@ -216,8 +240,7 @@ abstract final class $name { ); final listenerConvFn = '($paramsFfiDartType) => $listenerConvFnInvocation'; - final wrapFn = _wrapListenerBlock?.func.name; - final releaseFn = ObjCBuiltInFunctions.objectRelease.gen(w); + final wrapFn = _wrapListenerBlock!.func.name; s.write(''' @@ -232,21 +255,11 @@ abstract final class $name { /// blocks do not keep the isolate alive. static $blockType listener($funcDartType fn) { final raw = $newClosureBlock( - (_dartFuncListenerTrampoline ??= $nativeCallableType.listener( - $closureTrampoline $exceptionalReturn)..keepIsolateAlive = - false).nativeFunction.cast(), $listenerConvFn);'''); - if (wrapFn != null) { - s.write(''' + $listenerCallable.nativeFunction.cast(), $listenerConvFn); final wrapper = $wrapFn(raw); $releaseFn(raw.cast()); - return $blockType(wrapper, retain: false, release: true);'''); - } else { - s.write(''' - return $blockType(raw, retain: false, release: true);'''); - } - s.write(''' + return $blockType(wrapper, retain: false, release: true); } - static $nativeCallableType? _dartFuncListenerTrampoline; '''); } s.write('}\n\n'); @@ -303,6 +316,7 @@ ref.pointer.ref.invoke.cast<$natTrampFnType>().asFunction<$trampFuncFfiDartType> typedef $blockTypedef; $blockName $fnName($blockName block) NS_RETURNS_RETAINED { return ^void($argStr) { + ${generateRetain('block')}; block(${retains.join(', ')}); }; } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 36f52ed77..5e00c7a5d 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -21,6 +21,7 @@ class ObjCBuiltInFunctions { static const msgSendFpretPointer = ObjCImport('msgSendFpretPointer'); static const msgSendStretPointer = ObjCImport('msgSendStretPointer'); static const useMsgSendVariants = ObjCImport('useMsgSendVariants'); + static const respondsToSelector = ObjCImport('respondsToSelector'); static const newPointerBlock = ObjCImport('newPointerBlock'); static const newClosureBlock = ObjCImport('newClosureBlock'); static const getBlockClosure = ObjCImport('getBlockClosure'); @@ -37,6 +38,8 @@ class ObjCBuiltInFunctions { ObjCImport('ObjCProtocolListenableMethod'); static const protocolBuilder = ObjCImport('ObjCProtocolBuilder'); static const dartProxy = ObjCImport('DartProxy'); + static const unimplementedOptionalMethodException = + ObjCImport('UnimplementedOptionalMethodException'); // Keep in sync with pkgs/objective_c/ffigen_objc.yaml. static const builtInInterfaces = { @@ -145,13 +148,9 @@ class ObjCBuiltInFunctions { ObjCListenerBlockTrampoline? getListenerBlockTrampoline(ObjCBlock block) { assert(!_depsAdded); - var needsTrampoline = false; final paramIds = []; for (final param in block.params) { final retainFunc = param.type.generateRetain(''); - if (retainFunc != null) { - needsTrampoline = true; - } // The trampoline ID is based on the getNativeType of the param. Objects // and blocks both have `id` as their native type, but need separate @@ -159,7 +158,6 @@ class ObjCBuiltInFunctions { // retainFunc (if any) to all the param IDs. paramIds.add('${param.getNativeType()}-${retainFunc ?? ''}'); } - if (!needsTrampoline) return null; final id = paramIds.join(','); return _blockTrampolines[id] ??= ObjCListenerBlockTrampoline(Func( diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 0f7513f4c..86f5f596a 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -41,6 +41,7 @@ class ObjCInterface extends BindingType with ObjCMethods { late final ObjCInternalGlobal _classObject; late final ObjCInternalGlobal _isKindOfClass; late final ObjCMsgSendFunc _isKindOfClassMsgSend; + final _protocols = []; @override final ObjCBuiltInFunctions builtInFunctions; @@ -55,6 +56,7 @@ class ObjCInterface extends BindingType with ObjCMethods { }) : lookupName = lookupName ?? originalName, super(name: name ?? originalName); + void addProtocol(ObjCProtocol proto) => _protocols.add(proto); bool get _isBuiltIn => builtInFunctions.isBuiltInInterface(originalName); @override @@ -185,6 +187,15 @@ class ObjCInterface extends BindingType with ObjCMethods { s.write(' {\n'); // Implementation. + final sel = m.selObject!.name; + if (m.isOptional) { + s.write(''' + if (!${ObjCBuiltInFunctions.respondsToSelector.gen(w)}(ref.pointer, $sel)) { + throw ${ObjCBuiltInFunctions.unimplementedOptionalMethodException.gen(w)}( + '$originalName', '${m.originalName}'); + } +'''); + } final convertReturn = m.kind != ObjCMethodKind.propertySetter && !returnType.sameDartAndFfiDartType; @@ -201,7 +212,7 @@ class ObjCInterface extends BindingType with ObjCMethods { objCRetain: m.consumesSelf, objCAutorelease: false, ), - m.selObject!.name, + sel, m.params.map((p) => p.type.convertDartTypeToFfiDartType( w, p.name, @@ -252,10 +263,17 @@ class ObjCInterface extends BindingType with ObjCMethods { superType!.addDependencies(dependencies); _copyMethodsFromSuperType(); _fixNullabilityOfOverriddenMethods(); + } - // Add dependencies for any methods that were added. - addMethodDependencies(dependencies, needMsgSend: true); + for (final proto in _protocols) { + proto.addDependencies(dependencies); + for (final m in proto.methods) { + addMethod(m); + } } + + // Add dependencies for any methods that were added. + addMethodDependencies(dependencies, needMsgSend: true); } void _copyMethodsFromSuperType() { diff --git a/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart b/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart index e8d0ed8d2..06f6ac86b 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart @@ -12,6 +12,7 @@ class ObjCProtocol extends NoLookUpBinding with ObjCMethods { final superProtocols = []; final String lookupName; late final ObjCInternalGlobal _protocolPointer; + final bool generateBindings; @override final ObjCBuiltInFunctions builtInFunctions; @@ -23,11 +24,17 @@ class ObjCProtocol extends NoLookUpBinding with ObjCMethods { String? lookupName, super.dartDoc, required this.builtInFunctions, + required this.generateBindings, }) : lookupName = lookupName ?? originalName, super(name: name ?? originalName); @override BindingString toBindingString(Writer w) { + if (!generateBindings) { + return const BindingString( + type: BindingStringType.objcProtocol, string: ''); + } + final protocolMethod = ObjCBuiltInFunctions.protocolMethod.gen(w); final protocolListenableMethod = ObjCBuiltInFunctions.protocolListenableMethod.gen(w); @@ -154,11 +161,13 @@ ${makeDartDoc(dartDoc ?? originalName)}abstract final class $name { if (dependencies.contains(this)) return; dependencies.add(this); - _protocolPointer = ObjCInternalGlobal( - '_protocol_$originalName', - (Writer w) => - '${ObjCBuiltInFunctions.getProtocol.gen(w)}("$lookupName")') - ..addDependencies(dependencies); + if (generateBindings) { + _protocolPointer = ObjCInternalGlobal( + '_protocol_$originalName', + (Writer w) => + '${ObjCBuiltInFunctions.getProtocol.gen(w)}("$lookupName")') + ..addDependencies(dependencies); + } for (final superProtocol in superProtocols) { superProtocol.addDependencies(dependencies); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart index d53b46c37..9069a2836 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart @@ -18,7 +18,6 @@ ObjCBlock parseObjCBlock(clang_types.CXType cxtype) { for (var i = 0; i < numArgs; ++i) { final type = clang.clang_getArgType(blk, i); params.add(Parameter( - name: 'arg$i', type: type.toCodeGenType(), objCConsumed: false, )); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index ac3dff85b..83658bebc 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -12,6 +12,7 @@ import '../data.dart'; import '../includer.dart'; import '../utils.dart'; import 'api_availability.dart'; +import 'objcprotocoldecl_parser.dart'; final _logger = Logger('ffigen.header_parser.objcinterfacedecl_parser'); @@ -76,6 +77,9 @@ void _fillInterface(ObjCInterface itf, clang_types.CXCursor cursor) { case clang_types.CXCursorKind.CXCursor_ObjCSuperClassRef: _parseSuperType(child, itf); break; + case clang_types.CXCursorKind.CXCursor_ObjCProtocolRef: + _parseProtocol(child, itf); + break; case clang_types.CXCursorKind.CXCursor_ObjCPropertyDecl: _parseProperty(child, itf, itfDecl); break; @@ -112,6 +116,14 @@ void _parseSuperType(clang_types.CXCursor cursor, ObjCInterface itf) { } } +void _parseProtocol(clang_types.CXCursor cursor, ObjCInterface itf) { + final protoCursor = clang.clang_getCursorDefinition(cursor); + final proto = parseObjCProtocolDeclaration(protoCursor, ignoreFilter: true); + if (proto != null) { + itf.addProtocol(proto); + } +} + void _parseProperty( clang_types.CXCursor cursor, ObjCInterface itf, Declaration itfDecl) { final fieldName = cursor.spelling(); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcprotocoldecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcprotocoldecl_parser.dart index a1ff1107d..3827e53ac 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcprotocoldecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcprotocoldecl_parser.dart @@ -22,18 +22,19 @@ ObjCProtocol? parseObjCProtocolDeclaration(clang_types.CXCursor cursor, } final usr = cursor.usr(); - final cachedProtocol = bindingsIndex.getSeenObjCProtocol(usr); - if (cachedProtocol != null) { - return cachedProtocol; - } - final name = cursor.spelling(); final decl = Declaration(usr: usr, originalName: name); - if (!ignoreFilter && !shouldIncludeObjCProtocol(decl)) { + final included = shouldIncludeObjCProtocol(decl); + if (!ignoreFilter && !included) { return null; } + final cachedProtocol = bindingsIndex.getSeenObjCProtocol(usr); + if (cachedProtocol != null) { + return cachedProtocol; + } + if (!isApiAvailable(cursor)) { _logger.info('Omitting deprecated protocol $name'); return null; @@ -49,6 +50,12 @@ ObjCProtocol? parseObjCProtocolDeclaration(clang_types.CXCursor cursor, lookupName: applyModulePrefix(name, config.protocolModule(decl)), dartDoc: getCursorDocComment(cursor), builtInFunctions: objCBuiltInFunctions, + + // Only generate bindings for the protocol if it is included in the user's + // filters. If this protocol was only parsed because of ignoreFilter, then + // it's being used to add methods to an interface or a child protocol, and + // shouldn't get bindings. + generateBindings: included, ); // Make sure to add the protocol to the index before parsing the AST, to break diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index fc79ac873..75a31ac1a 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 15.0.0 +version: 15.0.0-wip description: > Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. @@ -36,6 +36,7 @@ dev_dependencies: coverage: ^1.8.0 dart_flutter_team_lints: ^2.0.0 json_schema: ^5.1.1 + leak_tracker: ^10.0.7 meta: ^1.11.0 objective_c: ^3.0.0 test: ^1.16.2 diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index 699a0f761..497cb50cc 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -41,5 +41,5 @@ ${strings.headers}: '_expected_dart_handle_bindings.dart' ]); }); - }); + }, skip: isFlutterTester); } diff --git a/pkgs/ffigen/test/large_integration_tests/.gitignore b/pkgs/ffigen/test/large_integration_tests/.gitignore new file mode 100644 index 000000000..dc58d58f5 --- /dev/null +++ b/pkgs/ffigen/test/large_integration_tests/.gitignore @@ -0,0 +1 @@ +large_objc_bindings.* diff --git a/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart b/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart new file mode 100644 index 000000000..a5a2e33fc --- /dev/null +++ b/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart @@ -0,0 +1,123 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +// This is a slow test. +@Timeout(Duration(minutes: 5)) +library; + +import 'dart:async'; +import 'dart:io'; +import 'dart:math'; + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; +import 'package:logging/logging.dart'; +import 'package:pub_semver/pub_semver.dart'; +import 'package:test/test.dart'; + +Future run(String exe, List args) async { + final process = + await Process.start(exe, args, mode: ProcessStartMode.inheritStdio); + return await process.exitCode; +} + +void main() { + test('Large ObjC integration test', () async { + // Reducing the bindings to a random subset so that the test completes in a + // reasonable amount of time. + // TODO(https://github.com/dart-lang/sdk/issues/56247): Remove this. + const inclusionRatio = 0.1; + final rand = Random(1234); + bool randInclude([_, __]) => rand.nextDouble() < inclusionRatio; + final randomFilter = DeclarationFilters( + shouldInclude: randInclude, + shouldIncludeMember: randInclude, + ); + + // TODO(https://github.com/dart-lang/native/issues/1220): Allow these. + const disallowedMethods = { + 'accessKey', + 'allowsConstrainedNetworkAccess', + 'attributedString', + 'cachePolicy', + 'candidateListTouchBarItem', + 'hyphenationFactor', + 'tag', + 'title', + }; + final interfaceFilter = DeclarationFilters( + shouldInclude: randInclude, + shouldIncludeMember: (_, method) => + randInclude() && !disallowedMethods.contains(method), + ); + + const outFile = 'test/large_integration_tests/large_objc_bindings.dart'; + const outObjCFile = 'test/large_integration_tests/large_objc_bindings.m'; + final config = Config( + wrapperName: 'LargeObjCLibrary', + language: Language.objc, + output: Uri.file(outFile), + outputObjC: Uri.file(outObjCFile), + entryPoints: [Uri.file('test/large_integration_tests/large_objc_test.h')], + formatOutput: false, + functionDecl: randomFilter, + structDecl: randomFilter, + unionDecl: randomFilter, + enumClassDecl: randomFilter, + unnamedEnumConstants: randomFilter, + globals: randomFilter, + typedefs: randomFilter, + objcInterfaces: interfaceFilter, + objcProtocols: randomFilter, + externalVersions: ExternalVersions( + ios: Versions(min: Version(12, 0, 0)), + macos: Versions(min: Version(10, 14, 0)), + ), + preamble: ''' +// ignore_for_file: camel_case_types +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: unnecessary_non_null_assertion +// ignore_for_file: unused_element +// ignore_for_file: unused_field +''', + ); + + final timer = Stopwatch()..start(); + FfiGen(logLevel: Level.SEVERE).run(config); + expect(File(outFile).existsSync(), isTrue); + expect(File(outObjCFile).existsSync(), isTrue); + + print('\n\t\tFfigen generation: ${timer.elapsed}\n'); + timer.reset(); + + // Verify Dart bindings pass analysis. + expect(await run('dart', ['analyze', outFile]), 0); + + print('\n\t\tAnalyze dart: ${timer.elapsed}\n'); + timer.reset(); + + // Verify ObjC bindings compile. + expect( + await run('clang', [ + '-x', + 'objective-c', + outObjCFile, + '-fpic', + '-fobjc-arc', + '-shared', + '-framework', + 'Foundation', + '-o', + '/dev/null', + ]), + 0); + + print('\n\t\tCompile ObjC: ${timer.elapsed}\n'); + timer.reset(); + }); +} diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/native_add.dart b/pkgs/ffigen/test/large_integration_tests/large_objc_test.h similarity index 56% rename from pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/native_add.dart rename to pkgs/ffigen/test/large_integration_tests/large_objc_test.h index 9eda681ab..0104d7522 100644 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/native_add.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_objc_test.h @@ -1,5 +1,5 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -export 'src/native_add.dart'; +#import diff --git a/pkgs/ffigen/test/native_objc_test/arc_test.dart b/pkgs/ffigen/test/native_objc_test/arc_test.dart index 55bbf9e9d..c996d9c13 100644 --- a/pkgs/ffigen/test/native_objc_test/arc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/arc_test.dart @@ -72,7 +72,7 @@ void main() { expect(objectRetainCount(obj2raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) allocMethodsInner(Pointer counter) { @@ -109,7 +109,7 @@ void main() { expect(objectRetainCount(obj3raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); ( Pointer, @@ -212,7 +212,7 @@ void main() { expect(objectRetainCount(obj9raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); Pointer autoreleaseMethodsInner(Pointer counter) { final obj1 = ArcTestObject.makeAndAutorelease_(counter); @@ -254,7 +254,7 @@ void main() { expect(objectRetainCount(obj2raw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); Pointer assignPropertiesInnerInner( Pointer counter, ArcTestObject outerObj) { @@ -298,7 +298,7 @@ void main() { expect(objectRetainCount(assignObjRaw), 0); expect(objectRetainCount(outerObjRaw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); Pointer retainPropertiesInnerInner( Pointer counter, ArcTestObject outerObj) { @@ -345,7 +345,7 @@ void main() { expect(objectRetainCount(outerObjRaw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) copyPropertiesInner(Pointer counter) { @@ -394,7 +394,7 @@ void main() { expect(objectRetainCount(copyObjRaw), 0); expect(objectRetainCount(anotherCopyRaw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); test('Manual release', () { final counter = calloc(); @@ -459,7 +459,7 @@ void main() { expect(objectRetainCount(obj1raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); test('objectRetainCount large ref count', () { // Most ObjC API methods return us a reference without incrementing the @@ -473,6 +473,6 @@ void main() { doGC(); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart b/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart index a6aa4ef8f..34f2f62e4 100644 --- a/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart @@ -65,7 +65,7 @@ void main() { BlockAnnotationTest.newObjectProducer(); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('ObjectProducer, defined dart, invoked dart', () { objectProducerTest(() { @@ -74,7 +74,7 @@ void main() { (Pointer _) => EmptyObject.alloc().init()); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('ObjectProducer, defined dart, invoked objC', () { objectProducerTest(() { @@ -83,7 +83,7 @@ void main() { (Pointer _) => EmptyObject.alloc().init()); return BlockAnnotationTest.invokeObjectProducer_(blk); }); - }); + }, skip: !canDoGC); test('RetainedObjectProducer, defined objC, invoked dart', () { objectProducerTest(() { @@ -94,7 +94,7 @@ void main() { release: true); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('RetainedObjectProducer, defined dart, invoked dart', () { objectProducerTest(() { @@ -103,7 +103,7 @@ void main() { (Pointer _) => EmptyObject.alloc().init()); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('RetainedObjectProducer, defined dart, invoked objC', () { objectProducerTest(() { @@ -114,7 +114,7 @@ void main() { ObjCBlock)>(blk.ref.pointer, retain: true, release: true)); }); - }); + }, skip: !canDoGC); test('ObjectReceiver, defined objC, invoked dart', () { objectProducerTest(() { @@ -122,7 +122,7 @@ void main() { BlockAnnotationTest.newObjectReceiver(); return blk(nullptr, EmptyObject.alloc().init()); }); - }); + }, skip: !canDoGC); test('ObjectReceiver, defined dart, invoked dart', () { objectProducerTest(() { @@ -131,7 +131,7 @@ void main() { (Pointer _, EmptyObject obj) => obj); return blk(nullptr, EmptyObject.alloc().init()); }); - }); + }, skip: !canDoGC); test('ObjectReceiver, defined dart, invoked objC', () { objectProducerTest(() { @@ -140,7 +140,7 @@ void main() { (Pointer _, EmptyObject obj) => obj); return BlockAnnotationTest.invokeObjectReceiver_(blk); }); - }); + }, skip: !canDoGC); test('ConsumedObjectReceiver, defined objC, invoked dart', () { objectProducerTest(() { @@ -152,7 +152,7 @@ void main() { release: true); return blk(nullptr, EmptyObject.alloc().init()); }); - }); + }, skip: !canDoGC); test('ConsumedObjectReceiver, defined dart, invoked dart', () { objectProducerTest(() { @@ -161,7 +161,7 @@ void main() { (Pointer _, EmptyObject obj) => obj); return blk(nullptr, EmptyObject.alloc().init()); }); - }); + }, skip: !canDoGC); test('ConsumedObjectReceiver, defined dart, invoked objC', () { objectProducerTest(() { @@ -174,7 +174,7 @@ void main() { retain: true, release: true)); }); - }); + }, skip: !canDoGC); Future objectListenerTest( void Function(Completer) producer) async { @@ -202,7 +202,7 @@ void main() { (Pointer _, EmptyObject obj) => completer.complete(obj)); blk(nullptr, EmptyObject.alloc().init()); }); - }); + }, skip: !canDoGC); test('ObjectListener, defined dart, invoked objC sync', () async { await objectListenerTest((Completer completer) { @@ -211,7 +211,7 @@ void main() { (Pointer _, EmptyObject obj) => completer.complete(obj)); BlockAnnotationTest.invokeObjectListenerSync_(blk); }); - }); + }, skip: !canDoGC); test('ObjectListener, defined dart, invoked objC async', () async { await objectListenerTest((Completer completer) { @@ -221,7 +221,7 @@ void main() { final thread = BlockAnnotationTest.invokeObjectListenerAsync_(blk); thread.start(); }); - }); + }, skip: !canDoGC); // TODO(https://github.com/dart-lang/native/issues/1505): Fix this case. /*test('ConsumedObjectListener, defined dart, invoked dart', () async { @@ -231,7 +231,7 @@ void main() { (Pointer _, EmptyObject obj) => completer.complete(obj)); blk(nullptr, EmptyObject.alloc().init()); }); - });*/ + }, skip: !canDoGC);*/ test('ConsumedObjectListener, defined dart, invoked objC sync', () async { await objectListenerTest((Completer completer) { @@ -244,7 +244,7 @@ void main() { retain: true, release: true)); }); - }); + }, skip: !canDoGC); test('ConsumedObjectListener, defined dart, invoked objC async', () async { await objectListenerTest((Completer completer) { @@ -258,7 +258,7 @@ void main() { release: true)); thread.start(); }); - }); + }, skip: !canDoGC); void blockProducerTest(DartEmptyBlock producer()) { final pool = lib.objc_autoreleasePoolPush(); @@ -279,7 +279,7 @@ void main() { BlockAnnotationTest.newBlockProducer(); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('BlockProducer, defined dart, invoked dart', () { blockProducerTest(() { @@ -288,7 +288,7 @@ void main() { (Pointer _) => ObjCBlock_ffiVoid.fromFunction(() {})); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('BlockProducer, defined dart, invoked objC', () { blockProducerTest(() { @@ -297,7 +297,7 @@ void main() { (Pointer _) => ObjCBlock_ffiVoid.fromFunction(() {})); return BlockAnnotationTest.invokeBlockProducer_(blk); }); - }); + }, skip: !canDoGC); test('RetainedBlockProducer, defined objC, invoked dart', () { blockProducerTest(() { @@ -308,7 +308,7 @@ void main() { release: true); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('RetainedBlockProducer, defined dart, invoked dart', () { blockProducerTest(() { @@ -317,7 +317,7 @@ void main() { (Pointer _) => ObjCBlock_ffiVoid.fromFunction(() {})); return blk(nullptr); }); - }); + }, skip: !canDoGC); test('RetainedBlockProducer, defined dart, invoked objC', () { blockProducerTest(() { @@ -328,6 +328,6 @@ void main() { ObjCBlock)>(blk.ref.pointer, retain: true, release: true)); }); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index eacc8b02d..4d4a78eec 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -339,7 +339,7 @@ void main() { final rawBlock = funcPointerBlockRefCountTest(); doGC(); expect(blockRetainCount(rawBlock), 0); - }); + }, skip: !canDoGC); Pointer funcBlockRefCountTest() { final block = IntBlock.fromFunction(makeAdder(4000)); @@ -356,7 +356,7 @@ void main() { expect(blockRetainCount(rawBlock), 0); expect(internal_for_testing.blockHasRegisteredClosure(rawBlock.cast()), false); - }); + }, skip: !canDoGC); Pointer blockManualRetainRefCountTest() { final block = IntBlock.fromFunction(makeAdder(4000)); @@ -384,7 +384,7 @@ void main() { expect(blockRetainCount(rawBlock), 0); expect(internal_for_testing.blockHasRegisteredClosure(rawBlock.cast()), false); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) blockBlockDartCallRefCountTest() { @@ -445,7 +445,7 @@ void main() { expect(blockRetainCount(outputBlock), 0); expect(internal_for_testing.blockHasRegisteredClosure(outputBlock.cast()), false); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) blockBlockObjCCallRefCountTest() { @@ -496,7 +496,7 @@ void main() { expect(blockRetainCount(outputBlock), 0); expect(internal_for_testing.blockHasRegisteredClosure(outputBlock.cast()), false); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) nativeBlockBlockDartCallRefCountTest() { @@ -530,7 +530,7 @@ void main() { expect(blockRetainCount(inputBlock), 0); expect(blockRetainCount(blockBlock), 0); expect(blockRetainCount(outputBlock), 0); - }); + }, skip: !canDoGC); (Pointer, Pointer) nativeBlockBlockObjCCallRefCountTest() { @@ -549,7 +549,7 @@ void main() { doGC(); expect(blockRetainCount(blockBlock), 0); expect(blockRetainCount(outputBlock), 0); - }); + }, skip: !canDoGC); (Pointer, Pointer) objectBlockRefCountTest(Allocator alloc) { final pool = lib.objc_autoreleasePoolPush(); @@ -578,7 +578,7 @@ void main() { expect(inputCounter.value, 0); expect(outputCounter.value, 0); }); - }); + }, skip: !canDoGC); (Pointer, Pointer) objectNativeBlockRefCountTest( Allocator alloc) { @@ -614,7 +614,7 @@ void main() { expect(inputCounter.value, 0); expect(outputCounter.value, 0); }); - }); + }, skip: !canDoGC); Future<(Pointer, Pointer)> listenerBlockArgumentRetentionTest() async { @@ -650,7 +650,7 @@ void main() { expect(blockRetainCount(inputBlock), 0); expect(blockRetainCount(blockBlock), 0); - }); + }, skip: !canDoGC); test('Block fields have sensible values', () { final block = IntBlock.fromFunction(makeAdder(4000)); @@ -684,6 +684,45 @@ void main() { expect(objCBindings, contains('Vec2')); expect(objCBindings, contains('Vec4')); }); + + (BlockTester, Pointer, Pointer) regress1571Inner( + Completer completer) { + final dummyObject = DummyObject.new1(); + DartObjectListenerBlock? block = + ObjectListenerBlock.listener((DummyObject obj) { + expect(objectRetainCount(obj.ref.pointer), 1); + completer.complete(); + expect(dummyObject, isNotNull); + }); + final tester = BlockTester.newFromListener_(block); + expect(blockRetainCount(block.ref.pointer), 2); + expect(objectRetainCount(dummyObject.ref.pointer), 1); + return (tester, block.ref.pointer, dummyObject.ref.pointer); + } + + test('Regression test for https://github.com/dart-lang/native/issues/1571', + () async { + // Pass a listener block to an ObjC API that retains a reference to the + // block, and release the Dart-side reference. Then, on a different + // thread, invoke the block and immediately release the ObjC-side + // reference. Before the fix, the dtor message could arrive before the + // invoke message. This was a flaky error, so try a few times. + for (int i = 0; i < 10; ++i) { + final completer = Completer(); + final (tester, blockPtr, objectPtr) = regress1571Inner(completer); + + await flutterDoGC(); + expect(blockRetainCount(blockPtr), 1); + expect(objectRetainCount(objectPtr), 1); + + tester.invokeAndReleaseListenerOnNewThread(); + await completer.future; + + await flutterDoGC(); + expect(blockRetainCount(blockPtr), 0); + expect(objectRetainCount(objectPtr), 0); + } + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/block_test.h b/pkgs/ffigen/test/native_objc_test/block_test.h index a6880548f..d13e2ac80 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.h +++ b/pkgs/ffigen/test/native_objc_test/block_test.h @@ -50,9 +50,11 @@ typedef void (^NoTrampolineListenerBlock)(int32_t, Vec4, const char*); // blocks in Objective C code. @interface BlockTester : NSObject { __strong IntBlock myBlock; + __strong ObjectListenerBlock myListener; } + (BlockTester*)newFromBlock:(IntBlock)block; + (BlockTester*)newFromMultiplier:(int32_t)mult; ++ (BlockTester*)newFromListener:(ObjectListenerBlock)block; - (int32_t)call:(int32_t)x; - (IntBlock)getBlock NS_RETURNS_RETAINED; - (void)pokeBlock; @@ -75,4 +77,6 @@ typedef void (^NoTrampolineListenerBlock)(int32_t, Vec4, const char*); + (void)callNoTrampolineListener:(NoTrampolineListenerBlock)block; + (IntBlock)newBlock:(BlockBlock)block withMult:(int)mult NS_RETURNS_RETAINED; + (BlockBlock)newBlockBlock:(int)mult NS_RETURNS_RETAINED; +- (void)invokeAndReleaseListenerOnNewThread; +- (void)invokeAndReleaseListener:(id)_; @end diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index 4995b3b4f..7dbf86de3 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -48,6 +48,12 @@ + (BlockTester*)newFromMultiplier:(int32_t)mult { return bt; } ++ newFromListener:(ObjectListenerBlock)block { + BlockTester* bt = [BlockTester new]; + bt->myListener = block; + return bt; +} + - (int32_t)call:(int32_t)x { return myBlock(x); } @@ -177,4 +183,15 @@ + (BlockBlock)newBlockBlock:(int)mult NS_RETURNS_RETAINED { }; } +- (void)invokeAndReleaseListenerOnNewThread { + [[[NSThread alloc] initWithTarget:self + selector:@selector(invokeAndReleaseListener:) + object:nil] start]; +} + +- (void)invokeAndReleaseListener:(id)_ { + myListener([DummyObject new]); + myListener = nil; +} + @end diff --git a/pkgs/ffigen/test/native_objc_test/global_native_test.dart b/pkgs/ffigen/test/native_objc_test/global_native_test.dart index 54646f490..d2e5c7086 100644 --- a/pkgs/ffigen/test/native_objc_test/global_native_test.dart +++ b/pkgs/ffigen/test/native_objc_test/global_native_test.dart @@ -62,7 +62,7 @@ void main() { globalNativeObject = null; expect(objectRetainCount(obj2raw), 0); expect(objectRetainCount(obj1raw), 0); - }); + }, skip: !canDoGC); test('Global block', () { globalNativeBlock = ObjCBlock_Int32_Int32.fromFunction((int x) => x * 10); @@ -100,6 +100,6 @@ void main() { globalNativeBlock = null; expect(blockRetainCount(blk2raw), 0); expect(blockRetainCount(blk1raw), 0); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/global_test.dart b/pkgs/ffigen/test/native_objc_test/global_test.dart index dfd9c5819..ab6e36630 100644 --- a/pkgs/ffigen/test/native_objc_test/global_test.dart +++ b/pkgs/ffigen/test/native_objc_test/global_test.dart @@ -64,7 +64,7 @@ void main() { lib.globalObject = null; expect(objectRetainCount(obj2raw), 0); expect(objectRetainCount(obj1raw), 0); - }); + }, skip: !canDoGC); test('Global block', () { lib.globalBlock = ObjCBlock_Int32_Int32.fromFunction((int x) => x * 10); @@ -101,6 +101,6 @@ void main() { lib.globalBlock = null; expect(blockRetainCount(blk2raw), 0); expect(blockRetainCount(blk1raw), 0); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/isolate_config.yaml b/pkgs/ffigen/test/native_objc_test/isolate_config.yaml index 9d53d174a..97336c5df 100644 --- a/pkgs/ffigen/test/native_objc_test/isolate_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/isolate_config.yaml @@ -1,13 +1,15 @@ name: IsolateTestObjCLibrary description: 'Tests sending objects between isolates' language: objc -output: 'isolate_bindings.dart' +output: + bindings: 'isolate_bindings.dart' + objc-bindings: 'isolate_bindings.m' exclude-all-by-default: true objc-interfaces: include: - Sendable headers: entry-points: - - 'isolate_test.m' + - 'isolate_test.h' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unnecessary_non_null_assertion, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/isolate_test.dart b/pkgs/ffigen/test/native_objc_test/isolate_test.dart index 8c3c75900..f7bc1ad0f 100644 --- a/pkgs/ffigen/test/native_objc_test/isolate_test.dart +++ b/pkgs/ffigen/test/native_objc_test/isolate_test.dart @@ -92,7 +92,7 @@ void main() { doGC(); // TODO(https://github.com/dart-lang/coverage/issues/472): Re-enable. // expect(objectRetainCount(pointer), 0); - }); + }, skip: !canDoGC); test('Capturing object in closure', () async { Sendable? sendable = Sendable.new1(); @@ -113,7 +113,7 @@ void main() { sendable = null; doGC(); expect(objectRetainCount(pointer), 0); - }); + }, skip: !canDoGC); // Runs on other isolate (can't use expect function). void sendingBlockTest(SendPort sendPort) async { @@ -158,7 +158,7 @@ void main() { doGC(); // TODO(https://github.com/dart-lang/coverage/issues/472): Re-enable. // expect(blockRetainCount(pointer), 0); - }); + }, skip: !canDoGC); ObjCBlock makeBlock(Completer completer) { // Creating this block in a separate function to make sure completer is @@ -184,7 +184,7 @@ void main() { block = null; doGC(); expect(blockRetainCount(pointer), 0); - }); + }, skip: !canDoGC); test('Manual release across isolates', () async { final sendable = Sendable.new1(); diff --git a/pkgs/ffigen/test/native_objc_test/isolate_test.h b/pkgs/ffigen/test/native_objc_test/isolate_test.h new file mode 100644 index 000000000..221f1fe81 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/isolate_test.h @@ -0,0 +1,12 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +typedef void (^Listener)(int32_t); + +@interface Sendable : NSObject {} +@property int32_t value; ++ (Listener)dummyMethodToForceGenerationOfListener; +@end diff --git a/pkgs/ffigen/test/native_objc_test/isolate_test.m b/pkgs/ffigen/test/native_objc_test/isolate_test.m index fe96647a1..2b8750751 100644 --- a/pkgs/ffigen/test/native_objc_test/isolate_test.m +++ b/pkgs/ffigen/test/native_objc_test/isolate_test.m @@ -2,16 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -#import - +#include "isolate_test.h" #include "util.h" -typedef void (^Listener)(int32_t); - -@interface Sendable : NSObject {} -@property int32_t value; -+ (Listener)dummyMethodToForceGenerationOfListener; -@end - @implementation Sendable @end diff --git a/pkgs/ffigen/test/native_objc_test/protocol_config.yaml b/pkgs/ffigen/test/native_objc_test/protocol_config.yaml index 8bc5cd3c8..cf09e13f6 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/protocol_config.yaml @@ -1,7 +1,9 @@ name: ProtocolTestObjCLibrary description: 'Tests implementing protocols' language: objc -output: 'protocol_bindings.dart' +output: + bindings: 'protocol_bindings.dart' + objc-bindings: 'protocol_bindings.m' exclude-all-by-default: true objc-interfaces: include: @@ -15,6 +17,6 @@ objc-protocols: - SecondaryProtocol headers: entry-points: - - 'protocol_test.m' + - 'protocol_test.h' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unnecessary_non_null_assertion, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.dart b/pkgs/ffigen/test/native_objc_test/protocol_test.dart index accb1a175..ac62d65b5 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test.dart +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.dart @@ -9,6 +9,7 @@ import 'dart:async'; import 'dart:ffi'; import 'dart:io'; +import 'package:ffi/ffi.dart'; import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; @@ -50,6 +51,30 @@ void main() { expect(otherIntResult, 10); }); + test('Method implementation, invoke from Dart', () { + final protocolImpl = ObjCProtocolImpl.new1(); + + // Required instance method. + final result = + protocolImpl.instanceMethod_withDouble_("abc".toNSString(), 123); + expect(result.toString(), 'ObjCProtocolImpl: abc: 123.00'); + + // Optional instance method. + final structPtr = calloc(); + structPtr.ref.x = 12; + structPtr.ref.y = 34; + final intResult = protocolImpl.optionalMethod_(structPtr.ref); + expect(intResult, 46); + calloc.free(structPtr); + + // Required instance method from secondary protocol. + final otherIntResult = protocolImpl.otherMethod_b_c_d_(2, 4, 6, 8); + expect(otherIntResult, 20); + + // Method from a protocol that isn't included by the filters. + expect(protocolImpl.fooMethod(), 2468); + }); + test('Unimplemented method', () { final protocolImpl = ObjCProtocolImplMissingMethod.new1(); final consumer = ProtocolConsumer.new1(); @@ -58,6 +83,18 @@ void main() { final intResult = consumer.callOptionalMethod_(protocolImpl); expect(intResult, -999); }); + + test('Unimplemented method, invoke from Dart', () { + final protocolImpl = ObjCProtocolImplMissingMethod.new1(); + + // Optional instance method, not implemented. + final structPtr = calloc(); + structPtr.ref.x = 12; + structPtr.ref.y = 34; + expect(() => protocolImpl.optionalMethod_(structPtr.ref), + throwsA(isA())); + calloc.free(structPtr); + }); }); group('Dart implementation using helpers', () { @@ -337,7 +374,25 @@ void main() { doGC(); expect(objectRetainCount(proxyPtr), 0); expect(blockRetainCount(blockPtr), 0); - }); + }, skip: !canDoGC); + }); + + test('Filters', () { + // SuperProtocol and FilteredProtocol's methods are included in the + // bindings, but there shouldn't actually be bindings for the protocols + // themselves, because they're not included by the config. + final bindings = File('test/native_objc_test/protocol_bindings.dart') + .readAsStringSync(); + + expect(bindings, contains('instanceMethod_withDouble_')); + expect(bindings, contains('fooMethod')); + + expect(bindings, contains('EmptyProtocol')); + expect(bindings, contains('MyProtocol')); + expect(bindings, contains('SecondaryProtocol')); + + expect(bindings, isNot(contains('SuperProtocol'))); + expect(bindings, isNot(contains('FilteredProtocol'))); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.h b/pkgs/ffigen/test/native_objc_test/protocol_test.h new file mode 100644 index 000000000..cc394b06f --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.h @@ -0,0 +1,64 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import +#import + +typedef struct { + int32_t x; + int32_t y; +} SomeStruct; + +@protocol SuperProtocol + +@required +- (NSString*)instanceMethod:(NSString*)s withDouble:(double)x; + +@end + +@protocol MyProtocol + +@optional +- (int32_t)optionalMethod:(SomeStruct)s; + +@optional +- (void)voidMethod:(int32_t)x; + +@end + + +@protocol SecondaryProtocol + +@required +- (int32_t)otherMethod:(int32_t)a b:(int32_t)b c:(int32_t)c d:(int32_t)d; + +@optional +- (nullable instancetype)returnsInstanceType; + +@end + +@protocol EmptyProtocol +@end + +@protocol FilteredProtocol +@required +- (int32_t)fooMethod; +@end + + +@interface ProtocolConsumer : NSObject +- (NSString*)callInstanceMethod:(id)protocol; +- (int32_t)callOptionalMethod:(id)protocol; +- (int32_t)callOtherMethod:(id)protocol; +- (void)callMethodOnRandomThread:(id)protocol; +@end + + +@interface ObjCProtocolImpl : + NSObject +@end + + +@interface ObjCProtocolImplMissingMethod : NSObject +@end diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.m b/pkgs/ffigen/test/native_objc_test/protocol_test.m index 015d991a0..c6cc50a5b 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test.m +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.m @@ -3,55 +3,10 @@ // BSD-style license that can be found in the LICENSE file. #import -#import -#import +#include "protocol_test.h" #include "util.h" -typedef struct { - int32_t x; - int32_t y; -} SomeStruct; - -@protocol SuperProtocol - -@required -- (NSString*)instanceMethod:(NSString*)s withDouble:(double)x; - -@end - -@protocol MyProtocol - -@optional -- (int32_t)optionalMethod:(SomeStruct)s; - -@optional -- (void)voidMethod:(int32_t)x; - -@end - - -@protocol SecondaryProtocol - -@required -- (int32_t)otherMethod:(int32_t)a b:(int32_t)b c:(int32_t)c d:(int32_t)d; - -@optional -- (nullable instancetype)returnsInstanceType; - -@end - -@protocol EmptyProtocol -@end - - -@interface ProtocolConsumer : NSObject -- (NSString*)callInstanceMethod:(id)protocol; -- (int32_t)callOptionalMethod:(id)protocol; -- (int32_t)callOtherMethod:(id)protocol; -- (void)callMethodOnRandomThread:(id)protocol; -@end - @implementation ProtocolConsumer : NSObject - (NSString*)callInstanceMethod:(id)protocol { return [protocol instanceMethod:@"Hello from ObjC" withDouble:3.14]; @@ -78,9 +33,6 @@ - (void)callMethodOnRandomThread:(id)protocol { @end -@interface ObjCProtocolImpl : NSObject -@end - @implementation ObjCProtocolImpl - (NSString *)instanceMethod:(NSString *)s withDouble:(double)x { return [NSString stringWithFormat:@"ObjCProtocolImpl: %@: %.2f", s, x]; @@ -94,12 +46,13 @@ - (int32_t)otherMethod:(int32_t)a b:(int32_t)b c:(int32_t)c d:(int32_t)d { return a + b + c + d; } -@end - +- (int32_t)fooMethod { + return 2468; +} -@interface ObjCProtocolImplMissingMethod : NSObject @end + @implementation ObjCProtocolImplMissingMethod - (NSString *)instanceMethod:(NSString *)s withDouble:(double)x { return @"ObjCProtocolImplMissingMethod"; diff --git a/pkgs/ffigen/test/native_objc_test/ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/ref_count_test.dart index 19ee2f217..e19850ab6 100644 --- a/pkgs/ffigen/test/native_objc_test/ref_count_test.dart +++ b/pkgs/ffigen/test/native_objc_test/ref_count_test.dart @@ -72,7 +72,7 @@ void main() { expect(objectRetainCount(obj2raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) allocMethodsInner(Pointer counter) { @@ -110,7 +110,7 @@ void main() { expect(objectRetainCount(obj3raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); ( Pointer, @@ -213,7 +213,7 @@ void main() { expect(objectRetainCount(obj9raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); Pointer autoreleaseMethodsInner(Pointer counter) { final obj1 = RefCountTestObject.makeAndAutorelease_(counter); @@ -255,7 +255,7 @@ void main() { expect(objectRetainCount(obj2raw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); Pointer assignPropertiesInnerInner( Pointer counter, RefCountTestObject outerObj) { @@ -299,7 +299,7 @@ void main() { expect(objectRetainCount(assignObjRaw), 0); expect(objectRetainCount(outerObjRaw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); Pointer retainPropertiesInnerInner( Pointer counter, RefCountTestObject outerObj) { @@ -346,7 +346,7 @@ void main() { expect(objectRetainCount(outerObjRaw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); (Pointer, Pointer, Pointer) copyPropertiesInner(Pointer counter) { @@ -395,7 +395,7 @@ void main() { expect(objectRetainCount(copyObjRaw), 0); expect(objectRetainCount(anotherCopyRaw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); castFromPointerInnerReleaseAndRetain(int address) { final fromCast = RefCounted.castFromPointer( @@ -412,7 +412,7 @@ void main() { castFromPointerInnerReleaseAndRetain(obj1.meAsInt()); doGC(); expect(obj1.refCount, 1); - }); + }, skip: !canDoGC); castFromPointerInnerNoReleaseAndRetain(int address) { final fromCast = RefCounted.castFromPointer( @@ -429,7 +429,7 @@ void main() { castFromPointerInnerNoReleaseAndRetain(obj1.meAsInt()); doGC(); expect(obj1.refCount, 1); - }); + }, skip: !canDoGC); test('Manual release', () { final counter = calloc(); @@ -491,7 +491,7 @@ void main() { expect(objectRetainCount(objRaw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); RefCountTestObject unownedReferenceInner2(Pointer counter) { final obj1 = RefCountTestObject.new1(); @@ -535,7 +535,7 @@ void main() { expect(counter.value, 0); expect(objectRetainCount(obj1bRaw), 0); calloc.free(counter); - }); + }, skip: !canDoGC); void largeRefCountInner(Pointer counter) { final obj = RefCountTestObject.newWithCounter_(counter); @@ -568,7 +568,7 @@ void main() { expect(objectRetainCount(obj1raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); test('objectRetainCount large ref count', () { // Most ObjC API methods return us a reference without incrementing the @@ -582,6 +582,6 @@ void main() { doGC(); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart b/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart index 074b82988..e3b6c93bf 100644 --- a/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart +++ b/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart @@ -57,7 +57,7 @@ void main() { doGC(); expect(counter.value, 0); }); - }); + }, skip: !canDoGC); Pointer staticFuncOfNullableObjectRefCountTest(Allocator alloc) { final counter = alloc(); @@ -84,7 +84,7 @@ void main() { expect(staticFuncOfNullableObject(null), isNull); }); - }); + }, skip: !canDoGC); Pointer staticFuncOfBlockRefCountTest() { final block = IntBlock.fromFunction((int x) => 2 * x); @@ -103,7 +103,7 @@ void main() { final rawBlock = staticFuncOfBlockRefCountTest(); doGC(); expect(blockRetainCount(rawBlock), 0); - }); + }, skip: !canDoGC); Pointer staticFuncReturnsRetainedRefCountTest(Allocator alloc) { final counter = alloc(); @@ -123,7 +123,7 @@ void main() { doGC(); expect(counter.value, 0); }); - }); + }, skip: !canDoGC); Pointer staticFuncOfObjectReturnsRetainedRefCountTest( Allocator alloc) { @@ -148,7 +148,7 @@ void main() { doGC(); expect(counter.value, 0); }); - }); + }, skip: !canDoGC); test( 'Objects passed to static functions that consume them ' @@ -170,6 +170,6 @@ void main() { expect(objectRetainCount(obj1raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/static_func_test.dart b/pkgs/ffigen/test/native_objc_test/static_func_test.dart index 3f8e58215..5fe5389c1 100644 --- a/pkgs/ffigen/test/native_objc_test/static_func_test.dart +++ b/pkgs/ffigen/test/native_objc_test/static_func_test.dart @@ -59,7 +59,7 @@ void main() { doGC(); expect(counter.value, 0); }); - }); + }, skip: !canDoGC); Pointer staticFuncOfNullableObjectRefCountTest(Allocator alloc) { final counter = alloc(); @@ -86,7 +86,7 @@ void main() { expect(lib.staticFuncOfNullableObject(null), isNull); }); - }); + }, skip: !canDoGC); Pointer staticFuncOfBlockRefCountTest() { final block = IntBlock.fromFunction((int x) => 2 * x); @@ -105,7 +105,7 @@ void main() { final (rawBlock) = staticFuncOfBlockRefCountTest(); doGC(); expect(blockRetainCount(rawBlock), 0); - }); + }, skip: !canDoGC); Pointer staticFuncReturnsRetainedRefCountTest(Allocator alloc) { final counter = alloc(); @@ -125,7 +125,7 @@ void main() { doGC(); expect(counter.value, 0); }); - }); + }, skip: !canDoGC); Pointer staticFuncOfObjectReturnsRetainedRefCountTest( Allocator alloc) { @@ -150,7 +150,7 @@ void main() { doGC(); expect(counter.value, 0); }); - }); + }, skip: !canDoGC); test( 'Objects passed to static functions that consume them ' @@ -172,6 +172,6 @@ void main() { expect(objectRetainCount(obj1raw), 0); expect(counter.value, 0); calloc.free(counter); - }); + }, skip: !canDoGC); }); } diff --git a/pkgs/ffigen/test/native_objc_test/util.dart b/pkgs/ffigen/test/native_objc_test/util.dart index 4fc879bca..a40358dea 100644 --- a/pkgs/ffigen/test/native_objc_test/util.dart +++ b/pkgs/ffigen/test/native_objc_test/util.dart @@ -7,6 +7,7 @@ import 'dart:io'; import 'package:ffi/ffi.dart'; import 'package:ffigen/ffigen.dart'; +import 'package:leak_tracker/leak_tracker.dart' as leak_tracker; import 'package:logging/logging.dart' show Level; import 'package:objective_c/objective_c.dart'; import 'package:objective_c/src/internal.dart' as internal_for_testing @@ -25,16 +26,33 @@ void generateBindingsForCoverage(String testName) { FfiGen(logLevel: Level.SEVERE).run(config); } -@Native, Pointer)>( - symbol: 'Dart_ExecuteInternalCommand') -external void _executeInternalCommand(Pointer cmd, Pointer arg); +final _executeInternalCommand = () { + try { + return DynamicLibrary.process() + .lookup, Pointer)>>( + 'Dart_ExecuteInternalCommand') + .asFunction, Pointer)>(); + } on ArgumentError { + return null; + } +}(); + +bool canDoGC = _executeInternalCommand != null; void doGC() { - final gcNow = "gc-now".toNativeUtf8(); - _executeInternalCommand(gcNow.cast(), nullptr); + final gcNow = 'gc-now'.toNativeUtf8(); + _executeInternalCommand!(gcNow.cast(), nullptr); calloc.free(gcNow); } +// Dart_ExecuteInternalCommand("gc-now") doesn't work on flutter, so we use +// leak_tracker's forceGC function instead. It's less reliable, and to combat +// that we need to wait for quite a long time, which breaks autorelease pools. +Future flutterDoGC() async { + await leak_tracker.forceGC(); + await Future.delayed(Duration(milliseconds: 500)); +} + @Native)>(isLeaf: true, symbol: 'isReadableMemory') external bool _isReadableMemory(Pointer ptr); diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index dca47be98..fadf43dd0 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -171,3 +171,5 @@ T withChDir(String path, T Function() inner) { return result; } + +bool isFlutterTester = Platform.resolvedExecutable.contains('flutter_tester'); diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 99699ccdd..1290ea14c 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.12.0-wip + +- Renamed library `internal_helpers_for_jnigen` to `_internal`. + ## 0.11.0 - **Breaking Change** Removed `Jni.accessors`. diff --git a/pkgs/jni/example/android/app/build.gradle b/pkgs/jni/example/android/app/build.gradle index 1578d193d..e2f649869 100644 --- a/pkgs/jni/example/android/app/build.gradle +++ b/pkgs/jni/example/android/app/build.gradle @@ -23,6 +23,8 @@ if (flutterVersionName == null) { } android { + namespace "com.github.dart_lang.jni_example" + compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/pkgs/jni/example/android/gradle/wrapper/gradle-wrapper.properties b/pkgs/jni/example/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..7aeeb11c6 100644 --- a/pkgs/jni/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/pkgs/jni/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/pkgs/jni/example/android/settings.gradle b/pkgs/jni/example/android/settings.gradle index 536165d35..03e70fe44 100644 --- a/pkgs/jni/example/android/settings.gradle +++ b/pkgs/jni/example/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.6.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/pkgs/jni/example/lib/main.dart b/pkgs/jni/example/lib/main.dart index 6af02b6aa..8149a9770 100644 --- a/pkgs/jni/example/lib/main.dart +++ b/pkgs/jni/example/lib/main.dart @@ -4,13 +4,20 @@ // ignore_for_file: library_private_types_in_public_api -import 'package:flutter/material.dart'; - -import 'dart:io'; import 'dart:ffi'; +import 'dart:io'; +import 'package:ffi/ffi.dart'; +import 'package:flutter/material.dart'; import 'package:jni/jni.dart'; +extension on String { + /// Returns a Utf-8 encoded `Pointer` with contents same as this string. + Pointer toNativeChars(Allocator allocator) { + return toNativeUtf8(allocator: allocator).cast(); + } +} + // An example of calling JNI methods using low level primitives. // GlobalJniEnv is a thin abstraction over JNIEnv in JNI C API. // @@ -19,7 +26,7 @@ import 'package:jni/jni.dart'; String toJavaStringUsingEnv(int n) => using((arena) { final env = Jni.env; final cls = env.FindClass("java/lang/String".toNativeChars(arena)); - final mId = env.GetStaticMethodID(cls, "valueOf".toNativeChars(), + final mId = env.GetStaticMethodID(cls, "valueOf".toNativeChars(arena), "(I)Ljava/lang/String;".toNativeChars(arena)); final i = arena(); i.ref.i = n; @@ -47,7 +54,7 @@ int randomUsingEnv(int n) => using((arena) { double randomDouble() { final math = JClass.forName("java/lang/Math"); final random = - math.staticMethodId("random", "()D").call(math, const jdoubleType(), []); + math.staticMethodId("random", "()D").call(math, jdouble.type, []); math.release(); return random; } @@ -56,7 +63,7 @@ int uptime() { return JClass.forName("android/os/SystemClock").use( (systemClock) => systemClock .staticMethodId("uptimeMillis", "()J") - .call(systemClock, const jlongType(), []), + .call(systemClock, jlong.type, []), ); } @@ -67,9 +74,8 @@ String backAndForth() { } void quit() { - JObject.fromReference(Jni.getCurrentActivity()).use((ac) => ac.jClass - .instanceMethodId("finish", "()V") - .call(ac, const jvoidType(), [])); + JObject.fromReference(Jni.getCurrentActivity()).use((ac) => + ac.jClass.instanceMethodId("finish", "()V").call(ac, jvoid.type, [])); } void showToast(String text) { @@ -87,14 +93,14 @@ void showToast(String text) { '(Landroid/app/Activity;Landroid/content/Context;' 'Ljava/lang/CharSequence;I)' 'Lcom/github/dart_lang/jni_example/Toaster;'); - final toaster = makeText.call(toasterClass, const JObjectType(), [ + final toaster = makeText.call(toasterClass, JObject.type, [ Jni.getCurrentActivity(), Jni.getCachedApplicationContext(), '😀'.toJString(), 0, ]); final show = toasterClass.instanceMethodId('show', '()V'); - show(toaster, const jvoidType(), []); + show(toaster, jvoid.type, []); } void main() { diff --git a/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxy.java b/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java similarity index 63% rename from pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxy.java rename to pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java index 5218ebcef..f4026189e 100644 --- a/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxy.java +++ b/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java @@ -5,22 +5,32 @@ package com.github.dart_lang.jni; import java.lang.reflect.*; +import java.util.ArrayList; +import java.util.HashMap; -public class PortProxy implements InvocationHandler { +public class PortProxyBuilder implements InvocationHandler { private static final PortCleaner cleaner = new PortCleaner(); static { System.loadLibrary("dartjni"); } - private final long port; + private static final class DartImplementation { + final long port; + final long pointer; + + DartImplementation(long port, long pointer) { + this.port = port; + this.pointer = pointer; + } + } + + private boolean built = false; private final long isolateId; - private final long functionPtr; + private final HashMap implementations = new HashMap<>(); - private PortProxy(long port, long isolateId, long functionPtr) { - this.port = port; + public PortProxyBuilder(long isolateId) { this.isolateId = isolateId; - this.functionPtr = functionPtr; } private static String getDescriptor(Method method) { @@ -62,15 +72,28 @@ private static void appendType(StringBuilder descriptor, Class type) { } } - public static Object newInstance(String binaryName, long port, long isolateId, long functionPtr) - throws ClassNotFoundException { - Class clazz = Class.forName(binaryName); + public void addImplementation(String binaryName, long port, long functionPointer) { + implementations.put(binaryName, new DartImplementation(port, functionPointer)); + } + + public Object build() throws ClassNotFoundException { + if (implementations.isEmpty()) { + throw new IllegalStateException("No interface implementation added"); + } + if (built) { + throw new IllegalStateException("This proxy has already been built"); + } + built = true; + ArrayList> classes = new ArrayList<>(); + for (String binaryName : implementations.keySet()) { + classes.add(Class.forName(binaryName)); + } Object obj = Proxy.newProxyInstance( - clazz.getClassLoader(), - new Class[] {clazz}, - new PortProxy(port, isolateId, functionPtr)); - cleaner.register(obj, port); + classes.get(0).getClassLoader(), classes.toArray(new Class[0]), this); + for (DartImplementation implementation : implementations.values()) { + cleaner.register(obj, implementation.port); + } return obj; } @@ -89,7 +112,15 @@ private static native Object[] _invoke( @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Object[] result = _invoke(port, isolateId, functionPtr, proxy, getDescriptor(method), args); + DartImplementation implementation = implementations.get(method.getDeclaringClass().getName()); + Object[] result = + _invoke( + implementation.port, + isolateId, + implementation.pointer, + proxy, + getDescriptor(method), + args); _cleanUp((Long) result[0]); if (result[1] instanceof DartException) { Throwable cause = ((DartException) result[1]).cause; diff --git a/pkgs/jni/lib/_internal.dart b/pkgs/jni/lib/_internal.dart new file mode 100644 index 000000000..768be191f --- /dev/null +++ b/pkgs/jni/lib/_internal.dart @@ -0,0 +1,75 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// ignore_for_file: invalid_export_of_internal_element + +/// This library exports the methods meant for use by generated code only, and +/// not to be used directly. +library; + +import 'dart:ffi' as ffi show Int32; +import 'dart:ffi' hide Int32; + +// Exporting all the necessary bits for the generated bindings. +export 'dart:ffi' + show + Double, + Int64, + NativeFunction, + NativeFunctionPointer, + NativePort, + Pointer, + VarArgs, + Void, + nullptr; +export 'dart:isolate' show RawReceivePort, ReceivePort; + +export 'package:meta/meta.dart' show internal; + +export 'src/accessors.dart'; +export 'src/jni.dart' show ProtectedJniExtensions; +export 'src/jreference.dart'; +export 'src/method_invocation.dart'; +export 'src/types.dart' + show + JAccessible, + JArrayElementType, + JCallable, + JConstructable, + JObjType, + JType, + lowestCommonSuperType, + referenceType; + +/// Temporary fix for the macOS arm64 varargs problem. +/// +/// This integer type is `Int32` on all architectures, other than macOS arm64. +/// Where it is `Int64`. +@AbiSpecificIntegerMapping({ + Abi.androidArm: ffi.Int32(), + Abi.androidArm64: ffi.Int32(), + Abi.androidIA32: ffi.Int32(), + Abi.androidX64: ffi.Int32(), + Abi.androidRiscv64: ffi.Int32(), + Abi.fuchsiaArm64: ffi.Int32(), + Abi.fuchsiaX64: ffi.Int32(), + Abi.fuchsiaRiscv64: ffi.Int32(), + Abi.iosArm: ffi.Int32(), + Abi.iosArm64: ffi.Int32(), + Abi.iosX64: ffi.Int32(), + Abi.linuxArm: ffi.Int32(), + Abi.linuxArm64: ffi.Int32(), + Abi.linuxIA32: ffi.Int32(), + Abi.linuxX64: ffi.Int32(), + Abi.linuxRiscv32: ffi.Int32(), + Abi.linuxRiscv64: ffi.Int32(), + Abi.macosArm64: Int64(), // <-- Only this is different. + Abi.macosX64: ffi.Int32(), + Abi.windowsArm64: ffi.Int32(), + Abi.windowsIA32: ffi.Int32(), + Abi.windowsX64: ffi.Int32(), +}) +final class Int32 extends AbiSpecificInteger { + const Int32(); +} diff --git a/pkgs/jni/lib/internal_helpers_for_jnigen.dart b/pkgs/jni/lib/internal_helpers_for_jnigen.dart deleted file mode 100644 index e3863048f..000000000 --- a/pkgs/jni/lib/internal_helpers_for_jnigen.dart +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -/// This library exports the methods meant for use by generated code only, and -/// not to be used directly. -library internal_helpers_for_jnigen; - -import 'dart:ffi' as ffi; - -export 'src/accessors.dart'; -export 'src/jni.dart' show ProtectedJniExtensions; -export 'src/jreference.dart'; -export 'src/method_invocation.dart'; -export 'src/types.dart' show referenceType; - -/// Temporary fix for the macOS arm64 varargs problem. -/// -/// This integer type is Int32 on all architectures, other than macOS arm64. -/// Where it is Int64. -@ffi.AbiSpecificIntegerMapping({ - ffi.Abi.androidArm: ffi.Int32(), - ffi.Abi.androidArm64: ffi.Int32(), - ffi.Abi.androidIA32: ffi.Int32(), - ffi.Abi.androidX64: ffi.Int32(), - ffi.Abi.androidRiscv64: ffi.Int32(), - ffi.Abi.fuchsiaArm64: ffi.Int32(), - ffi.Abi.fuchsiaX64: ffi.Int32(), - ffi.Abi.fuchsiaRiscv64: ffi.Int32(), - ffi.Abi.iosArm: ffi.Int32(), - ffi.Abi.iosArm64: ffi.Int32(), - ffi.Abi.iosX64: ffi.Int32(), - ffi.Abi.linuxArm: ffi.Int32(), - ffi.Abi.linuxArm64: ffi.Int32(), - ffi.Abi.linuxIA32: ffi.Int32(), - ffi.Abi.linuxX64: ffi.Int32(), - ffi.Abi.linuxRiscv32: ffi.Int32(), - ffi.Abi.linuxRiscv64: ffi.Int32(), - ffi.Abi.macosArm64: ffi.Int64(), // <-- Only this is different. - ffi.Abi.macosX64: ffi.Int32(), - ffi.Abi.windowsArm64: ffi.Int32(), - ffi.Abi.windowsIA32: ffi.Int32(), - ffi.Abi.windowsX64: ffi.Int32(), -}) -final class $Int32 extends ffi.AbiSpecificInteger { - const $Int32(); -} diff --git a/pkgs/jni/lib/jni.dart b/pkgs/jni/lib/jni.dart index 1d2f51a5b..cb069dc21 100644 --- a/pkgs/jni/lib/jni.dart +++ b/pkgs/jni/lib/jni.dart @@ -58,20 +58,27 @@ /// reason for NoClassDefFound error is missing classes in classpath. /// This library provides classes and functions for JNI interop from Dart. -library jni; - -export 'dart:ffi' show nullptr; +library; export 'package:ffi/ffi.dart' show Arena, using; export 'src/errors.dart'; -export 'src/jni.dart' hide ProtectedJniExtensions; +export 'src/jimplementer.dart'; +export 'src/jni.dart' hide ProtectedJniExtensions, StringMethodsForJni; export 'src/jobject.dart'; -export 'src/jreference.dart'; +export 'src/jreference.dart' hide ProtectedJReference; export 'src/jvalues.dart'; export 'src/lang/lang.dart'; export 'src/nio/nio.dart'; export 'src/third_party/generated_bindings.dart' hide JniBindings, JniEnv, JniEnv1, JniExceptionDetails; -export 'src/types.dart' hide referenceType; +export 'src/types.dart' + hide + JAccessible, + JArrayElementType, + JCallable, + JConstructable, + JObjType, + JType, + lowestCommonSuperType; export 'src/util/util.dart'; diff --git a/pkgs/jni/lib/src/accessors.dart b/pkgs/jni/lib/src/accessors.dart index 69729df2b..c90bd9529 100644 --- a/pkgs/jni/lib/src/accessors.dart +++ b/pkgs/jni/lib/src/accessors.dart @@ -4,7 +4,13 @@ import 'dart:ffi'; -import '../jni.dart'; +import 'package:meta/meta.dart' show internal; + +import 'jni.dart'; +import 'jobject.dart'; +import 'jreference.dart'; +import 'third_party/generated_bindings.dart'; +import 'types.dart'; void _check(JThrowablePtr exception) { if (exception != nullptr) { @@ -12,6 +18,7 @@ void _check(JThrowablePtr exception) { } } +@internal extension JniResultMethods on JniResult { void check() => _check(exception); @@ -56,7 +63,8 @@ extension JniResultMethods on JniResult { } JReference get reference { - return JGlobalReference(objectPointer); + final pointer = objectPointer; + return pointer == nullptr ? jNullReference : JGlobalReference(pointer); } T object(JObjType type) { @@ -69,6 +77,7 @@ extension JniResultMethods on JniResult { } } +@internal extension JniIdLookupResultMethods on JniPointerResult { JMethodIDPtr get methodID { _check(exception); @@ -90,6 +99,7 @@ extension JniIdLookupResultMethods on JniPointerResult { } } +@internal extension JniClassLookupResultMethods on JniClassLookupResult { JClassPtr get checkedClassRef { _check(exception); @@ -97,6 +107,7 @@ extension JniClassLookupResultMethods on JniClassLookupResult { } } +@internal extension JThrowableCheckMethod on JThrowablePtr { void check() { _check(this); diff --git a/pkgs/jni/lib/src/jarray.dart b/pkgs/jni/lib/src/jarray.dart index bf42937c7..ff31034b8 100644 --- a/pkgs/jni/lib/src/jarray.dart +++ b/pkgs/jni/lib/src/jarray.dart @@ -7,20 +7,26 @@ part of 'types.dart'; final class JArrayType extends JObjType> { + @internal final JArrayElementType elementType; + @internal const JArrayType(this.elementType); + @internal @override String get signature => '[${elementType.signature}'; + @internal @override JArray fromReference(JReference reference) => JArray.fromReference(elementType, reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final int superCount = 1; @@ -36,18 +42,21 @@ final class JArrayType extends JObjType> { } class JArray extends JObject { + @internal final JArrayElementType elementType; + @internal @override - late final JArrayType $type = type(elementType) as JArrayType; + final JArrayType $type; /// The type which includes information such as the signature of this class. - static JObjType> type(JArrayElementType innerType) => + static JArrayType type(JArrayElementType innerType) => JArrayType(innerType); /// Construct a new [JArray] with [reference] as its underlying reference. JArray.fromReference(this.elementType, JReference reference) - : super.fromReference(reference); + : $type = type(elementType), + super.fromReference(reference); /// Creates a [JArray] of the given length from the given [elementType]. /// @@ -374,8 +383,8 @@ extension ObjectArray on JArray { RangeError.checkValidRange(start, end, length); final rangeLength = end - start; final it = iterable.skip(skipCount).take(rangeLength); - it.forEachIndexed((index, element) { + for (final (index, element) in it.indexed) { this[index] = element; - }); + } } } diff --git a/pkgs/jni/lib/src/jimplementer.dart b/pkgs/jni/lib/src/jimplementer.dart new file mode 100644 index 000000000..ea6784b7b --- /dev/null +++ b/pkgs/jni/lib/src/jimplementer.dart @@ -0,0 +1,120 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'dart:isolate'; + +import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart' show internal; + +import 'accessors.dart'; +import 'jni.dart'; +import 'jobject.dart'; +import 'jreference.dart'; +import 'lang/jstring.dart'; +import 'third_party/generated_bindings.dart'; +import 'types.dart'; + +/// A builder that builds proxy objects that implement one or more interfaces. +/// +/// Example: +/// ```dart +/// final implementer = JImplemeneter(); +/// Foo.implementIn(implementer, fooImpl); +/// Bar.implementIn(implementer, barImpl); +/// final foobar = implementer.build(Foo.type); // Or `Bar.type`. +/// ``` +class JImplementer extends JObject { + JImplementer.fromReference(super.reference) : super.fromReference(); + + static final _class = + JClass.forName(r'com/github/dart_lang/jni/PortProxyBuilder'); + + static final _newId = _class.constructorId(r'(J)V'); + + static final _new = ProtectedJniExtensions.lookup< + NativeFunction< + JniResult Function(Pointer, JMethodIDPtr, + VarArgs<(Int64,)>)>>('globalEnv_NewObject') + .asFunction, JMethodIDPtr, int)>(); + + factory JImplementer() { + ProtectedJniExtensions.ensureInitialized(); + return JImplementer.fromReference(_new( + _class.reference.pointer, + _newId as JMethodIDPtr, + ProtectedJniExtensions.getCurrentIsolateId()) + .reference); + } + + static final _addImplementationId = _class.instanceMethodId( + r'addImplementation', + r'(Ljava/lang/String;JJ)V', + ); + + static final _addImplementation = ProtectedJniExtensions.lookup< + NativeFunction< + JThrowablePtr Function(Pointer, JMethodIDPtr, + VarArgs<(Pointer, Int64, Int64)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + JThrowablePtr Function( + Pointer, JMethodIDPtr, Pointer, int, int)>(); + + /// Should not be used directly. + /// + /// Use `implementIn` from the generated interface instead. + @internal + void add( + String binaryName, + RawReceivePort port, + Pointer> + pointer, + ) { + using((arena) { + _addImplementation( + reference.pointer, + _addImplementationId as JMethodIDPtr, + (binaryName.toJString()..releasedBy(arena)).reference.pointer, + port.sendPort.nativePort, + pointer.address) + .check(); + }); + } + + static final _buildId = _class.instanceMethodId( + r'build', + r'()Ljava/lang/Object;', + ); + + static final _build = ProtectedJniExtensions.lookup< + NativeFunction< + JniResult Function( + Pointer, + JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + JniResult Function( + Pointer, + JMethodIDPtr, + )>(); + + /// Builds an proxy object with the specified [type] that implements all the + /// added interfaces with the given implementations. + /// + /// Releases this implementer. + T implement(JObjType type) { + return type.fromReference(implementReference()); + } + + /// Used in the JNIgen generated code. + /// + /// It is unnecessary to construct the type object when the code is generated. + @internal + JReference implementReference() { + final ref = _build(reference.pointer, _buildId as JMethodIDPtr).reference; + release(); + return ref; + } +} diff --git a/pkgs/jni/lib/src/jni.dart b/pkgs/jni/lib/src/jni.dart index 4fa609cbd..71967cd00 100644 --- a/pkgs/jni/lib/src/jni.dart +++ b/pkgs/jni/lib/src/jni.dart @@ -7,11 +7,15 @@ import 'dart:io'; import 'dart:isolate'; import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart' show internal; import 'package:path/path.dart'; -import '../jni.dart'; import 'accessors.dart'; +import 'errors.dart'; +import 'jobject.dart'; +import 'jreference.dart'; import 'third_party/generated_bindings.dart'; +import 'types.dart'; String _getLibraryFileName(String base) { if (Platform.isLinux || Platform.isAndroid) { @@ -44,8 +48,6 @@ DynamicLibrary _loadDartJniLibrary({String? dir, String baseName = 'dartjni'}) { abstract final class Jni { static final DynamicLibrary _dylib = _loadDartJniLibrary(dir: _dylibDir); static final JniBindings _bindings = JniBindings(_dylib); - static final _getJniEnvFn = _dylib.lookup('GetJniEnv'); - static final _getJniContextFn = _dylib.lookup('GetJniContextPtr'); /// Store dylibDir if any was used. static String? _dylibDir; @@ -63,19 +65,6 @@ abstract final class Jni { } } - static bool _initialized = false; - - /// Initializes DartApiDL used for Continuations and interface implementation. - static void _ensureInitialized() { - if (!_initialized) { - assert(NativeApi.majorVersion == 2); - assert(NativeApi.minorVersion >= 3); - final result = _bindings.InitDartApiDL(NativeApi.initializeApiDLData); - _initialized = result == 0; - assert(_initialized); - } - } - /// Spawn an instance of JVM using JNI. This method should be called at the /// beginning of the program with appropriate options, before other isolates /// are spawned. @@ -235,28 +224,28 @@ abstract final class Jni { JGlobalReference(_bindings.GetClassLoader()); } -typedef _SetJniGettersNativeType = Void Function(Pointer, Pointer); -typedef _SetJniGettersDartType = void Function(Pointer, Pointer); - /// Extensions for use by `jnigen` generated code. +@internal extension ProtectedJniExtensions on Jni { - static final _jThrowableClass = JClass.forName('java/lang/Throwable'); + static bool _initialized = false; - static Pointer Function(String) initGeneratedLibrary( - String name) { - var path = _getLibraryFileName(name); - if (Jni._dylibDir != null) { - path = join(Jni._dylibDir!, path); + /// Initializes DartApiDL used for Continuations and interface implementation. + static void ensureInitialized() { + if (!_initialized) { + assert(NativeApi.majorVersion == 2); + assert(NativeApi.minorVersion >= 3); + final result = Jni._bindings.InitDartApiDL(NativeApi.initializeApiDLData); + _initialized = result == 0; + assert(_initialized); } - final dl = DynamicLibrary.open(path); - final setJniGetters = - dl.lookupFunction<_SetJniGettersNativeType, _SetJniGettersDartType>( - 'setJniGetters'); - setJniGetters(Jni._getJniContextFn, Jni._getJniEnvFn); - final lookup = dl.lookup; - return lookup; } + static int getCurrentIsolateId() { + return Jni._bindings.GetCurrentIsolateId(); + } + + static final _jThrowableClass = JClass.forName('java/lang/Throwable'); + /// Returns a new DartException. static Pointer newDartException(Object exception) { JObjectPtr? cause; @@ -273,7 +262,7 @@ extension ProtectedJniExtensions on Jni { /// Returns a new PortContinuation. static JReference newPortContinuation(ReceivePort port) { - Jni._ensureInitialized(); + ensureInitialized(); return JGlobalReference( Jni._bindings .PortContinuation__ctor(port.sendPort.nativePort) @@ -281,24 +270,6 @@ extension ProtectedJniExtensions on Jni { ); } - /// Returns a new PortProxy for a class with the given [binaryName]. - static JReference newPortProxy( - String binaryName, - ReceivePort port, - Pointer< - NativeFunction< - Pointer Function(Uint64, Pointer, Pointer)>> - functionPtr) { - Jni._ensureInitialized(); - return JGlobalReference(Jni._bindings - .PortProxy__newInstance( - Jni.env.toJStringPtr(binaryName), - port.sendPort.nativePort, - functionPtr.address, - ) - .objectPointer); - } - /// Returns the result of a callback. static void returnResult( Pointer result, JObjectPtr object) async { @@ -310,7 +281,7 @@ extension ProtectedJniExtensions on Jni { Pointer reference, int refType, ) { - Jni._ensureInitialized(); + ensureInitialized(); return Jni._bindings .newJObjectFinalizableHandle(object, reference, refType); } @@ -319,13 +290,13 @@ extension ProtectedJniExtensions on Jni { Object object, Pointer reference, ) { - Jni._ensureInitialized(); + ensureInitialized(); return Jni._bindings.newBooleanFinalizableHandle(object, reference); } static void deleteFinalizableHandle( Dart_FinalizableHandle finalizableHandle, Object object) { - Jni._ensureInitialized(); + ensureInitialized(); Jni._bindings.deleteFinalizableHandle(finalizableHandle, object); } @@ -366,16 +337,10 @@ extension AdditionalEnvMethods on GlobalJniEnv { }); } +@internal extension StringMethodsForJni on String { - /// Returns a Utf-8 encoded Pointer with contents same as this string. - Pointer toNativeChars([Allocator allocator = malloc]) { + /// Returns a Utf-8 encoded `Pointer` with contents same as this string. + Pointer toNativeChars(Allocator allocator) { return toNativeUtf8(allocator: allocator).cast(); } } - -extension CharPtrMethodsForJni on Pointer { - /// Same as calling `cast` followed by `toDartString`. - String toDartString({int? length}) { - return cast().toDartString(length: length); - } -} diff --git a/pkgs/jni/lib/src/jobject.dart b/pkgs/jni/lib/src/jobject.dart index df3fa94e9..9390b7aee 100644 --- a/pkgs/jni/lib/src/jobject.dart +++ b/pkgs/jni/lib/src/jobject.dart @@ -1,10 +1,10 @@ // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - import 'dart:ffi'; import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart' show internal; import 'jni.dart'; import 'jreference.dart'; @@ -12,21 +12,26 @@ import 'lang/jstring.dart'; import 'types.dart'; final class JObjectType extends JObjType { + @internal const JObjectType(); + @internal @override String get signature => 'Ljava/lang/Object;'; + @internal @override JObject fromReference(JReference reference) => JObject.fromReference(reference); + @internal @override JObjType get superType => const JObjectType(); // TODO(#70): Once interface implementation lands, other than [superType], // we should have a list of implemented interfaces. + @internal @override final int superCount = 0; @@ -43,9 +48,11 @@ final class JObjectType extends JObjType { /// /// This is the base class for classes generated by `jnigen`. class JObject { + @internal final JReference reference; - late final JObjType $type = type; + @internal + final JObjType $type = type; /// The type which includes information such as the signature of this class. static const JObjType type = JObjectType(); @@ -77,7 +84,7 @@ class JObject { /// Casts this object to another [type]. /// /// If [releaseOriginal] is `true`, the casted object will be released. - T castTo( + T as( JObjType type, { bool releaseOriginal = false, }) { diff --git a/pkgs/jni/lib/src/jprimitives.dart b/pkgs/jni/lib/src/jprimitives.dart index 6516a6b2e..7e0997120 100644 --- a/pkgs/jni/lib/src/jprimitives.dart +++ b/pkgs/jni/lib/src/jprimitives.dart @@ -19,8 +19,10 @@ final class jbyteType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jbyteType(); + @internal @override final signature = 'B'; @@ -74,8 +76,10 @@ final class jbooleanType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jbooleanType(); + @internal @override final signature = 'Z'; @@ -129,8 +133,10 @@ final class jcharType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jcharType(); + @internal @override final signature = 'C'; @@ -184,8 +190,10 @@ final class jshortType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jshortType(); + @internal @override final signature = 'S'; @@ -236,6 +244,7 @@ abstract final class jint extends JPrimitive { final class jintType extends JType with JCallable, JAccessible, JArrayElementType { + @internal const jintType(); @override @@ -291,6 +300,7 @@ final class jlongType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jlongType(); @override @@ -346,8 +356,10 @@ final class jfloatType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jfloatType(); + @internal @override final signature = 'F'; @@ -401,8 +413,10 @@ final class jdoubleType extends JType JCallable, JAccessible, JArrayElementType { + @internal const jdoubleType(); + @internal @override final signature = 'D'; @@ -452,8 +466,10 @@ abstract final class jvoid extends JPrimitive { } final class jvoidType extends JType with JCallable { + @internal const jvoidType(); + @internal @override final signature = 'V'; diff --git a/pkgs/jni/lib/src/jreference.dart b/pkgs/jni/lib/src/jreference.dart index 9038a5ba3..411bf5bfe 100644 --- a/pkgs/jni/lib/src/jreference.dart +++ b/pkgs/jni/lib/src/jreference.dart @@ -5,11 +5,13 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart' show internal; import 'errors.dart'; import 'jni.dart'; import 'third_party/generated_bindings.dart'; +@internal extension ProtectedJReference on JReference { void setAsReleased() { _setAsReleased(); diff --git a/pkgs/jni/lib/src/jvalues.dart b/pkgs/jni/lib/src/jvalues.dart index d49385b47..0b95e5b22 100644 --- a/pkgs/jni/lib/src/jvalues.dart +++ b/pkgs/jni/lib/src/jvalues.dart @@ -4,7 +4,7 @@ import 'dart:ffi'; -import '../internal_helpers_for_jnigen.dart'; +import '../_internal.dart'; import 'jobject.dart'; import 'third_party/generated_bindings.dart'; diff --git a/pkgs/jni/lib/src/lang/jboolean.dart b/pkgs/jni/lib/src/lang/jboolean.dart index 1fdcf7ccf..0513ab745 100644 --- a/pkgs/jni/lib/src/lang/jboolean.dart +++ b/pkgs/jni/lib/src/lang/jboolean.dart @@ -2,23 +2,30 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; final class JBooleanType extends JObjType { + @internal const JBooleanType(); + @internal @override String get signature => r'Ljava/lang/Boolean;'; + @internal @override JBoolean fromReference(JReference reference) => JBoolean.fromReference(reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 2; @@ -32,9 +39,10 @@ final class JBooleanType extends JObjType { } class JBoolean extends JObject { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JBoolean.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jbyte.dart b/pkgs/jni/lib/src/lang/jbyte.dart index 78aa3be4e..db4a39ca3 100644 --- a/pkgs/jni/lib/src/lang/jbyte.dart +++ b/pkgs/jni/lib/src/lang/jbyte.dart @@ -2,23 +2,30 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jreference.dart'; import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; final class JByteType extends JObjType { + @internal const JByteType(); + @internal @override String get signature => r'Ljava/lang/Byte;'; + @internal @override JByte fromReference(JReference reference) => JByte.fromReference(reference); + @internal @override JObjType get superType => const JNumberType(); + @internal @override final superCount = 2; @@ -32,9 +39,10 @@ final class JByteType extends JObjType { } class JByte extends JNumber { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JByte.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jcharacter.dart b/pkgs/jni/lib/src/lang/jcharacter.dart index 1e7ecda78..4730d73fa 100644 --- a/pkgs/jni/lib/src/lang/jcharacter.dart +++ b/pkgs/jni/lib/src/lang/jcharacter.dart @@ -1,21 +1,32 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart' show internal; + import '../jobject.dart'; import '../jreference.dart'; import '../jvalues.dart'; import '../types.dart'; final class JCharacterType extends JObjType { + @internal const JCharacterType(); + @internal @override String get signature => r'Ljava/lang/Character;'; + @internal @override JCharacter fromReference(JReference reference) => JCharacter.fromReference(reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -29,9 +40,10 @@ final class JCharacterType extends JObjType { } class JCharacter extends JObject { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JCharacter.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jdouble.dart b/pkgs/jni/lib/src/lang/jdouble.dart index ac8b69d9d..6bad5c65b 100644 --- a/pkgs/jni/lib/src/lang/jdouble.dart +++ b/pkgs/jni/lib/src/lang/jdouble.dart @@ -2,23 +2,30 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jreference.dart'; import '../types.dart'; import 'jnumber.dart'; final class JDoubleType extends JObjType { + @internal const JDoubleType(); + @internal @override String get signature => r'Ljava/lang/Double;'; + @internal @override JDouble fromReference(JReference reference) => JDouble.fromReference(reference); + @internal @override JObjType get superType => const JNumberType(); + @internal @override final superCount = 2; @@ -32,9 +39,10 @@ final class JDoubleType extends JObjType { } class JDouble extends JNumber { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JDouble.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jfloat.dart b/pkgs/jni/lib/src/lang/jfloat.dart index 31dd7bd7b..744a91528 100644 --- a/pkgs/jni/lib/src/lang/jfloat.dart +++ b/pkgs/jni/lib/src/lang/jfloat.dart @@ -2,23 +2,30 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jreference.dart'; import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; final class JFloatType extends JObjType { + @internal const JFloatType(); + @internal @override String get signature => r'Ljava/lang/Float;'; + @internal @override JFloat fromReference(JReference reference) => JFloat.fromReference(reference); + @internal @override JObjType get superType => const JNumberType(); + @internal @override final superCount = 2; @@ -32,9 +39,10 @@ final class JFloatType extends JObjType { } class JFloat extends JNumber { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JFloat.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jinteger.dart b/pkgs/jni/lib/src/lang/jinteger.dart index d99ec91ad..a527cde11 100644 --- a/pkgs/jni/lib/src/lang/jinteger.dart +++ b/pkgs/jni/lib/src/lang/jinteger.dart @@ -2,24 +2,31 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jreference.dart'; import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; final class JIntegerType extends JObjType { + @internal const JIntegerType(); + @internal @override String get signature => r'Ljava/lang/Integer;'; + @internal @override JInteger fromReference(JReference reference) => JInteger.fromReference(reference); + @internal @override JObjType get superType => const JNumberType(); + @internal @override final superCount = 2; @@ -33,9 +40,10 @@ final class JIntegerType extends JObjType { } class JInteger extends JNumber { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JInteger.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jlong.dart b/pkgs/jni/lib/src/lang/jlong.dart index 7cbaedb0f..5dc9c8530 100644 --- a/pkgs/jni/lib/src/lang/jlong.dart +++ b/pkgs/jni/lib/src/lang/jlong.dart @@ -2,22 +2,29 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jreference.dart'; import '../types.dart'; import 'jnumber.dart'; final class JLongType extends JObjType { + @internal const JLongType(); + @internal @override String get signature => r'Ljava/lang/Long;'; + @internal @override JLong fromReference(JReference reference) => JLong.fromReference(reference); + @internal @override JObjType get superType => const JNumberType(); + @internal @override final superCount = 2; @@ -31,9 +38,10 @@ final class JLongType extends JObjType { } class JLong extends JNumber { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JLong.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jnumber.dart b/pkgs/jni/lib/src/lang/jnumber.dart index 2a3bb4d27..e0295296a 100644 --- a/pkgs/jni/lib/src/lang/jnumber.dart +++ b/pkgs/jni/lib/src/lang/jnumber.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; @@ -15,18 +17,23 @@ import 'jlong.dart'; import 'jshort.dart'; final class JNumberType extends JObjType { + @internal const JNumberType(); + @internal @override String get signature => r'Ljava/lang/Number;'; + @internal @override JNumber fromReference(JReference reference) => JNumber.fromReference(reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -40,9 +47,10 @@ final class JNumberType extends JObjType { } class JNumber extends JObject { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JNumber.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jshort.dart b/pkgs/jni/lib/src/lang/jshort.dart index a2e054401..52715169c 100644 --- a/pkgs/jni/lib/src/lang/jshort.dart +++ b/pkgs/jni/lib/src/lang/jshort.dart @@ -2,23 +2,30 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jreference.dart'; import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; final class JShortType extends JObjType { + @internal const JShortType(); + @internal @override String get signature => r'Ljava/lang/Short;'; + @internal @override JShort fromReference(JReference reference) => JShort.fromReference(reference); + @internal @override JObjType get superType => const JNumberType(); + @internal @override final superCount = 2; @@ -32,9 +39,10 @@ final class JShortType extends JObjType { } class JShort extends JNumber { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JShort.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/lang/jstring.dart b/pkgs/jni/lib/src/lang/jstring.dart index bf0b16c3d..9df267d4d 100644 --- a/pkgs/jni/lib/src/lang/jstring.dart +++ b/pkgs/jni/lib/src/lang/jstring.dart @@ -2,24 +2,31 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jni.dart'; import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; final class JStringType extends JObjType { + @internal const JStringType(); + @internal @override String get signature => 'Ljava/lang/String;'; + @internal @override JString fromReference(JReference reference) => JString.fromReference(reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final int superCount = 1; @@ -33,9 +40,10 @@ final class JStringType extends JObjType { } class JString extends JObject { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; /// The type which includes information such as the signature of this class. static const JObjType type = JStringType(); diff --git a/pkgs/jni/lib/src/method_invocation.dart b/pkgs/jni/lib/src/method_invocation.dart index 6ed82d67f..ee779b55f 100644 --- a/pkgs/jni/lib/src/method_invocation.dart +++ b/pkgs/jni/lib/src/method_invocation.dart @@ -4,25 +4,28 @@ import 'dart:ffi'; +import 'package:meta/meta.dart' show internal; + import 'jobject.dart'; import 'jreference.dart'; import 'lang/jstring.dart'; import 'third_party/generated_bindings.dart'; import 'types.dart'; -class $MethodInvocation { +@internal +class MethodInvocation { final Pointer result; final JString methodDescriptor; final JArray args; - $MethodInvocation._(this.result, this.methodDescriptor, this.args); + MethodInvocation._(this.result, this.methodDescriptor, this.args); - factory $MethodInvocation.fromAddresses( + factory MethodInvocation.fromAddresses( int resultAddress, int descriptorAddress, int argsAddress, ) { - return $MethodInvocation._( + return MethodInvocation._( Pointer.fromAddress(resultAddress), JString.fromReference( JGlobalReference(Pointer.fromAddress(descriptorAddress))), @@ -33,8 +36,8 @@ class $MethodInvocation { ); } - factory $MethodInvocation.fromMessage(List message) { - return $MethodInvocation.fromAddresses( + factory MethodInvocation.fromMessage(List message) { + return MethodInvocation.fromAddresses( message[0] as int, message[1] as int, message[2] as int, diff --git a/pkgs/jni/lib/src/nio/jbuffer.dart b/pkgs/jni/lib/src/nio/jbuffer.dart index 13d012f62..f26f57955 100644 --- a/pkgs/jni/lib/src/nio/jbuffer.dart +++ b/pkgs/jni/lib/src/nio/jbuffer.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jobject.dart'; import '../jreference.dart'; import '../jvalues.dart'; @@ -9,18 +11,23 @@ import '../types.dart'; import 'jbyte_buffer.dart'; final class JBufferType extends JObjType { + @internal const JBufferType(); + @internal @override String get signature => r'Ljava/nio/Buffer;'; + @internal @override JBuffer fromReference(JReference reference) => JBuffer.fromReference(reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -45,9 +52,10 @@ final class JBufferType extends JObjType { /// We currently only have the bindings for `java.nio.ByteBuffer` in this /// package as [JByteBuffer]. class JBuffer extends JObject { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JBuffer.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/nio/jbyte_buffer.dart b/pkgs/jni/lib/src/nio/jbyte_buffer.dart index 35b4f1774..54e5bcaae 100644 --- a/pkgs/jni/lib/src/nio/jbyte_buffer.dart +++ b/pkgs/jni/lib/src/nio/jbyte_buffer.dart @@ -5,6 +5,8 @@ import 'dart:ffi'; import 'dart:typed_data'; +import 'package:meta/meta.dart' show internal; + import '../jni.dart'; import '../jobject.dart'; import '../jreference.dart'; @@ -13,18 +15,23 @@ import '../types.dart'; import 'jbuffer.dart'; final class JByteBufferType extends JObjType { + @internal const JByteBufferType(); + @internal @override String get signature => r'Ljava/nio/ByteBuffer;'; + @internal @override JByteBuffer fromReference(JReference reference) => JByteBuffer.fromReference(reference); + @internal @override JObjType get superType => const JBufferType(); + @internal @override final superCount = 2; @@ -87,9 +94,10 @@ final class JByteBufferType extends JObjType { /// // directBuffer.nextByte = 42; // throws [UseAfterReleaseException]! /// ``` class JByteBuffer extends JBuffer { + @internal @override // ignore: overridden_fields - late final JObjType $type = type; + final JObjType $type = type; JByteBuffer.fromReference( super.reference, diff --git a/pkgs/jni/lib/src/third_party/global_env_extensions.dart b/pkgs/jni/lib/src/third_party/global_env_extensions.dart index ee8fbeeae..4563d629c 100644 --- a/pkgs/jni/lib/src/third_party/global_env_extensions.dart +++ b/pkgs/jni/lib/src/third_party/global_env_extensions.dart @@ -37,7 +37,7 @@ import 'dart:ffi' as ffi; import '../accessors.dart'; import 'jni_bindings_generated.dart'; -/// Wraps over Pointer and exposes function pointer fields +/// Wraps over `Pointer` and exposes function pointer fields /// as methods. class GlobalJniEnv { final ffi.Pointer ptr; diff --git a/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart b/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart index 8f03912ba..e970cbe4b 100644 --- a/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart +++ b/pkgs/jni/lib/src/third_party/jni_bindings_generated.dart @@ -185,6 +185,15 @@ class JniBindings { late final _InitDartApiDL = _InitDartApiDLPtr.asFunction)>(); + int GetCurrentIsolateId() { + return _GetCurrentIsolateId(); + } + + late final _GetCurrentIsolateIdPtr = + _lookup>('GetCurrentIsolateId'); + late final _GetCurrentIsolateId = + _GetCurrentIsolateIdPtr.asFunction(); + JniResult DartException__ctor( JStringPtr message, JThrowablePtr cause, @@ -215,25 +224,6 @@ class JniBindings { late final _PortContinuation__ctor = _PortContinuation__ctorPtr.asFunction(); - JniResult PortProxy__newInstance( - JObjectPtr binaryName, - int port, - int functionPtr, - ) { - return _PortProxy__newInstance( - binaryName, - port, - functionPtr, - ); - } - - late final _PortProxy__newInstancePtr = _lookup< - ffi.NativeFunction< - JniResult Function( - JObjectPtr, ffi.Int64, ffi.Int64)>>('PortProxy__newInstance'); - late final _PortProxy__newInstance = _PortProxy__newInstancePtr.asFunction< - JniResult Function(JObjectPtr, int, int)>(); - void resultFor( ffi.Pointer result, JObjectPtr object, diff --git a/pkgs/jni/lib/src/types.dart b/pkgs/jni/lib/src/types.dart index d684d0cbe..5e37a4675 100644 --- a/pkgs/jni/lib/src/types.dart +++ b/pkgs/jni/lib/src/types.dart @@ -5,10 +5,9 @@ import 'dart:ffi'; import 'dart:typed_data'; -import 'package:collection/collection.dart'; import 'package:ffi/ffi.dart'; -import '../internal_helpers_for_jnigen.dart'; +import '../_internal.dart'; import 'jni.dart'; import 'jobject.dart'; import 'jvalues.dart'; @@ -18,6 +17,7 @@ part 'jarray.dart'; part 'jclass.dart'; part 'jprimitives.dart'; +@internal sealed class JType { const JType(); @@ -25,6 +25,7 @@ sealed class JType { } /// Able to be a return type of a method that can be called. +@internal mixin JCallable on JType { DartT _staticCall( JClassPtr clazz, JMethodIDPtr methodID, Pointer args); @@ -33,12 +34,14 @@ mixin JCallable on JType { } /// Able to be constructed. +@internal mixin JConstructable on JType { DartT _newObject( JClassPtr clazz, JMethodIDPtr methodID, Pointer args); } /// Able to be the type of a field that can be get and set. +@internal mixin JAccessible on JType { DartT _staticGet(JClassPtr clazz, JFieldIDPtr fieldID); DartT _instanceGet(JObjectPtr obj, JFieldIDPtr fieldID); @@ -47,6 +50,7 @@ mixin JAccessible on JType { } /// Able to be the type of array elements. +@internal mixin JArrayElementType on JType { JArray _newArray(int length); } @@ -56,6 +60,7 @@ mixin JArrayElementType on JType { /// Makes constructing objects easier inside the generated bindings by allowing /// a [JReference] to be created. This allows [JObject]s to use constructors /// that call `super.fromReference` instead of factories. +@internal const referenceType = _ReferenceType(); final class _ReferenceType extends JType @@ -68,10 +73,12 @@ final class _ReferenceType extends JType return JGlobalReference(Jni.env.NewObjectA(clazz, methodID, args)); } + @internal @override String get signature => 'Ljava/lang/Object;'; } +@internal abstract class JObjType extends JType with JCallable, @@ -166,6 +173,7 @@ JObjType _lowestCommonAncestor(JObjType a, JObjType b) { return a; } +@internal JObjType lowestCommonSuperType(List types) { return types.reduce(_lowestCommonAncestor); } diff --git a/pkgs/jni/lib/src/util/jiterator.dart b/pkgs/jni/lib/src/util/jiterator.dart index 79e0e3d21..d3bb4421e 100644 --- a/pkgs/jni/lib/src/util/jiterator.dart +++ b/pkgs/jni/lib/src/util/jiterator.dart @@ -2,27 +2,35 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart' show internal; + import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; final class JIteratorType<$E extends JObject> extends JObjType> { + @internal final JObjType<$E> E; + @internal const JIteratorType( this.E, ); + @internal @override String get signature => r'Ljava/util/Iterator;'; + @internal @override JIterator<$E> fromReference(JReference reference) => JIterator.fromReference(E, reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -38,16 +46,19 @@ final class JIteratorType<$E extends JObject> extends JObjType> { } class JIterator<$E extends JObject> extends JObject implements Iterator<$E> { + @internal @override // ignore: overridden_fields - late final JObjType $type = type(E); + final JObjType> $type; + @internal final JObjType<$E> E; JIterator.fromReference( this.E, JReference reference, - ) : super.fromReference(reference); + ) : $type = type(E), + super.fromReference(reference); static final _class = JClass.forName(r'java/util/Iterator'); diff --git a/pkgs/jni/lib/src/util/jlist.dart b/pkgs/jni/lib/src/util/jlist.dart index c754102a4..368bc55e8 100644 --- a/pkgs/jni/lib/src/util/jlist.dart +++ b/pkgs/jni/lib/src/util/jlist.dart @@ -4,6 +4,8 @@ import 'dart:collection'; +import 'package:meta/meta.dart' show internal; + import '../jni.dart'; import '../jobject.dart'; import '../jreference.dart'; @@ -13,22 +15,28 @@ import 'jiterator.dart'; import 'jset.dart'; final class JListType<$E extends JObject> extends JObjType> { + @internal final JObjType<$E> E; + @internal const JListType( this.E, ); + @internal @override String get signature => r'Ljava/util/List;'; + @internal @override JList<$E> fromReference(JReference reference) => JList.fromReference(E, reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -37,21 +45,26 @@ final class JListType<$E extends JObject> extends JObjType> { @override bool operator ==(Object other) { - return other.runtimeType == JListType && other is JListType && E == other.E; + return other.runtimeType == (JListType<$E>) && + other is JListType<$E> && + E == other.E; } } class JList<$E extends JObject> extends JObject with ListMixin<$E> { + @internal @override // ignore: overridden_fields - late final JObjType $type = type(E); + final JObjType> $type; + @internal final JObjType<$E> E; JList.fromReference( this.E, JReference reference, - ) : super.fromReference(reference); + ) : $type = type(E), + super.fromReference(reference); static final _class = JClass.forName(r'java/util/List'); @@ -67,7 +80,8 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { static final _arrayListClassRef = JClass.forName(r'java/util/ArrayList'); static final _ctorId = _arrayListClassRef.constructorId(r'()V'); JList.array(this.E) - : super.fromReference(_ctorId(_arrayListClassRef, referenceType, [])); + : $type = type(E), + super.fromReference(_ctorId(_arrayListClassRef, referenceType, [])); static final _sizeId = _class.instanceMethodId(r'size', r'()I'); @override diff --git a/pkgs/jni/lib/src/util/jmap.dart b/pkgs/jni/lib/src/util/jmap.dart index 2d8612fb8..59eed41d0 100644 --- a/pkgs/jni/lib/src/util/jmap.dart +++ b/pkgs/jni/lib/src/util/jmap.dart @@ -4,6 +4,8 @@ import 'dart:collection'; +import 'package:meta/meta.dart' show internal; + import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; @@ -11,24 +13,32 @@ import 'jset.dart'; final class JMapType<$K extends JObject, $V extends JObject> extends JObjType> { + @internal final JObjType<$K> K; + + @internal final JObjType<$V> V; + @internal const JMapType( this.K, this.V, ); + @internal @override String get signature => r'Ljava/util/Map;'; + @internal @override JMap<$K, $V> fromReference(JReference reference) => JMap.fromReference(K, V, reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -46,18 +56,23 @@ final class JMapType<$K extends JObject, $V extends JObject> class JMap<$K extends JObject, $V extends JObject> extends JObject with MapMixin<$K, $V> { + @internal @override // ignore: overridden_fields - late final JObjType $type = type(K, V); + final JObjType> $type; + @internal final JObjType<$K> K; + + @internal final JObjType<$V> V; JMap.fromReference( this.K, this.V, JReference reference, - ) : super.fromReference(reference); + ) : $type = type(K, V), + super.fromReference(reference); static final _class = JClass.forName(r'java/util/Map'); @@ -75,7 +90,8 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject static final _hashMapClass = JClass.forName(r'java/util/HashMap'); static final _ctorId = _hashMapClass.constructorId(r'()V'); JMap.hash(this.K, this.V) - : super.fromReference(_ctorId(_hashMapClass, referenceType, [])); + : $type = type(K, V), + super.fromReference(_ctorId(_hashMapClass, referenceType, [])); static final _getId = _class.instanceMethodId( r'get', r'(Ljava/lang/Object;)Ljava/lang/Object;'); diff --git a/pkgs/jni/lib/src/util/jset.dart b/pkgs/jni/lib/src/util/jset.dart index 2886a8874..44e6998cb 100644 --- a/pkgs/jni/lib/src/util/jset.dart +++ b/pkgs/jni/lib/src/util/jset.dart @@ -4,6 +4,8 @@ import 'dart:collection'; +import 'package:meta/meta.dart' show internal; + import '../jni.dart'; import '../jobject.dart'; import '../jreference.dart'; @@ -11,22 +13,28 @@ import '../types.dart'; import 'jiterator.dart'; final class JSetType<$E extends JObject> extends JObjType> { + @internal final JObjType<$E> E; + @internal const JSetType( this.E, ); + @internal @override String get signature => r'Ljava/util/Set;'; + @internal @override JSet<$E> fromReference(JReference reference) => JSet.fromReference(E, reference); + @internal @override JObjType get superType => const JObjectType(); + @internal @override final superCount = 1; @@ -42,16 +50,19 @@ final class JSetType<$E extends JObject> extends JObjType> { } class JSet<$E extends JObject> extends JObject with SetMixin<$E> { + @internal @override // ignore: overridden_fields - late final JObjType $type = type(E); + final JObjType> $type; + @internal final JObjType<$E> E; JSet.fromReference( this.E, JReference reference, - ) : super.fromReference(reference); + ) : $type = type(E), + super.fromReference(reference); static final _class = JClass.forName(r'java/util/Set'); @@ -67,7 +78,8 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { static final _hashSetClass = JClass.forName(r'java/util/HashSet'); static final _ctorId = _hashSetClass.constructorId(r'()V'); JSet.hash(this.E) - : super.fromReference(_ctorId(_hashSetClass, referenceType, [])); + : $type = type(E), + super.fromReference(_ctorId(_hashSetClass, referenceType, [])); static final _addId = _class.instanceMethodId(r'add', r'(Ljava/lang/Object;)Z'); diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index 48dc04701..954db901e 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml @@ -4,7 +4,7 @@ name: jni description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. -version: 0.11.0 +version: 0.12.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/jni topics: @@ -19,20 +19,19 @@ environment: flutter: '>=2.11.0' dependencies: - args: ^2.3.1 - collection: ^1.0.0 - ffi: ^2.0.1 + args: ^2.5.0 + ffi: ^2.1.3 + meta: ^1.15.0 package_config: ^2.1.0 - path: ^1.8.0 - plugin_platform_interface: ^2.0.2 + path: ^1.9.0 + plugin_platform_interface: ^2.1.8 dev_dependencies: - dart_flutter_team_lints: ^2.0.0 + dart_flutter_team_lints: ^3.2.0 ## Pin ffigen version because we are depending on internal APIs. ffigen: 8.0.2 - flutter_lints: ^2.0.0 - logging: ^1.1.1 - test: ^1.21.1 + logging: ^1.2.0 + test: ^1.25.8 # The following section is specific to Flutter packages. flutter: diff --git a/pkgs/jni/src/dartjni.c b/pkgs/jni/src/dartjni.c index 18a981a31..0ae465ef6 100644 --- a/pkgs/jni/src/dartjni.c +++ b/pkgs/jni/src/dartjni.c @@ -278,6 +278,10 @@ FFI_PLUGIN_EXPORT intptr_t InitDartApiDL(void* data) { return Dart_InitializeApiDL(data); } +FFI_PLUGIN_EXPORT int64_t GetCurrentIsolateId() { + return (int64_t)Dart_CurrentIsolate_DL(); +} + // com.github.dart_lang.jni.DartException jclass _c_DartException = NULL; @@ -285,8 +289,9 @@ jmethodID _m_DartException__ctor = NULL; FFI_PLUGIN_EXPORT JniResult DartException__ctor(jstring message, jthrowable cause) { attach_thread(); - load_class_global_ref(&_c_DartException, - "com/github/dart_lang/jni/PortProxy$DartException"); + load_class_global_ref( + &_c_DartException, + "com/github/dart_lang/jni/PortProxyBuilder$DartException"); if (_c_DartException == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method(_c_DartException, &_m_DartException__ctor, "", @@ -338,28 +343,6 @@ JniResult PortContinuation__ctor(int64_t j) { return (JniResult){.value = {.l = _result}, .exception = check_exception()}; } -// com.github.dart_lang.jni.PortProxy -jclass _c_PortProxy = NULL; - -jmethodID _m_PortProxy__newInstance = NULL; -FFI_PLUGIN_EXPORT -JniResult PortProxy__newInstance(jobject binaryName, - int64_t port, - int64_t functionPtr) { - attach_thread(); - load_class_global_ref(&_c_PortProxy, "com/github/dart_lang/jni/PortProxy"); - if (_c_PortProxy == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_static_method(_c_PortProxy, &_m_PortProxy__newInstance, "newInstance", - "(Ljava/lang/String;JJJ)Ljava/lang/Object;"); - if (_m_PortProxy__newInstance == NULL) - return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->CallStaticObjectMethod( - jniEnv, _c_PortProxy, _m_PortProxy__newInstance, binaryName, port, - (jlong)Dart_CurrentIsolate_DL(), functionPtr); - return to_global_ref_result(_result); -} - FFI_PLUGIN_EXPORT void resultFor(CallbackResult* result, jobject object) { acquire_lock(&result->lock); @@ -427,14 +410,15 @@ jclass _c_Long = NULL; jmethodID _m_Long_init = NULL; JNIEXPORT jobjectArray JNICALL -Java_com_github_dart_1lang_jni_PortProxy__1invoke(JNIEnv* env, - jclass clazz, - jlong port, - jlong isolateId, - jlong functionPtr, - jobject proxy, - jstring methodDescriptor, - jobjectArray args) { +Java_com_github_dart_1lang_jni_PortProxyBuilder__1invoke( + JNIEnv* env, + jclass clazz, + jlong port, + jlong isolateId, + jlong functionPtr, + jobject proxy, + jstring methodDescriptor, + jobjectArray args) { CallbackResult* result = (CallbackResult*)malloc(sizeof(CallbackResult)); if (isolateId != (jlong)Dart_CurrentIsolate_DL()) { init_lock(&result->lock); @@ -493,9 +477,9 @@ Java_com_github_dart_1lang_jni_PortProxy__1invoke(JNIEnv* env, } JNIEXPORT void JNICALL -Java_com_github_dart_1lang_jni_PortProxy__1cleanUp(JNIEnv* env, - jclass clazz, - jlong resultPtr) { +Java_com_github_dart_1lang_jni_PortProxyBuilder__1cleanUp(JNIEnv* env, + jclass clazz, + jlong resultPtr) { CallbackResult* result = (CallbackResult*)resultPtr; (*env)->DeleteGlobalRef(env, result->object); free(result); diff --git a/pkgs/jni/src/dartjni.h b/pkgs/jni/src/dartjni.h index 53a4ad15d..5d182c13a 100644 --- a/pkgs/jni/src/dartjni.h +++ b/pkgs/jni/src/dartjni.h @@ -340,17 +340,14 @@ static inline JniResult to_global_ref_result(jobject ref) { FFI_PLUGIN_EXPORT intptr_t InitDartApiDL(void* data); +FFI_PLUGIN_EXPORT int64_t GetCurrentIsolateId(); + FFI_PLUGIN_EXPORT JniResult DartException__ctor(jstring message, jthrowable cause); FFI_PLUGIN_EXPORT JniResult PortContinuation__ctor(int64_t j); -FFI_PLUGIN_EXPORT -JniResult PortProxy__newInstance(jobject binaryName, - int64_t port, - int64_t functionPtr); - FFI_PLUGIN_EXPORT void resultFor(CallbackResult* result, jobject object); FFI_PLUGIN_EXPORT diff --git a/pkgs/jni/test/exception_test.dart b/pkgs/jni/test/exception_test.dart index 803a417ed..54e36b80d 100644 --- a/pkgs/jni/test/exception_test.dart +++ b/pkgs/jni/test/exception_test.dart @@ -38,9 +38,7 @@ void main() { void run({required TestRunnerCallback testRunner}) { JObject newRandom(JClass randomClass) { - return randomClass - .constructorId('()V') - .call(randomClass, const JObjectType(), []); + return randomClass.constructorId('()V').call(randomClass, JObject.type, []); } testRunner('double free throws exception', () { diff --git a/pkgs/jni/test/global_env_test.dart b/pkgs/jni/test/global_env_test.dart index 377d3705b..0ac6191ab 100644 --- a/pkgs/jni/test/global_env_test.dart +++ b/pkgs/jni/test/global_env_test.dart @@ -2,10 +2,12 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:ffi'; import 'dart:io'; import 'package:ffi/ffi.dart'; import 'package:jni/jni.dart'; +import 'package:jni/src/jni.dart'; import 'package:test/test.dart'; import 'test_util/test_util.dart'; @@ -122,7 +124,7 @@ void run({required TestRunnerCallback testRunner}) { final jstr = env.NewStringUTF(str.toNativeChars(arena)); final jchars = env.GetStringUTFChars(jstr, nullptr); final jlen = env.GetStringUTFLength(jstr); - final dstr = jchars.toDartString(length: jlen); + final dstr = jchars.cast().toDartString(length: jlen); env.ReleaseStringUTFChars(jstr, jchars); expect(str, equals(dstr)); env.DeleteGlobalRef(jstr); diff --git a/pkgs/jni/test/jobject_test.dart b/pkgs/jni/test/jobject_test.dart index b8417807a..a3ffd2d85 100644 --- a/pkgs/jni/test/jobject_test.dart +++ b/pkgs/jni/test/jobject_test.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:ffi'; import 'dart:io'; import 'dart:isolate'; @@ -211,10 +212,10 @@ void run({required TestRunnerCallback testRunner}) { testRunner('casting', () { using((arena) { final str = 'hello'.toJString()..releasedBy(arena); - final obj = str.castTo(JObject.type)..releasedBy(arena); - final backToStr = obj.castTo(JString.type); + final obj = str.as(JObject.type)..releasedBy(arena); + final backToStr = obj.as(JString.type); expect(backToStr.toDartString(), str.toDartString()); - final _ = backToStr.castTo(JObject.type, releaseOriginal: true) + final _ = backToStr.as(JObject.type, releaseOriginal: true) ..releasedBy(arena); expect(backToStr.toDartString, throwsA(isA())); expect(backToStr.release, throwsA(isA())); @@ -284,14 +285,14 @@ void run({required TestRunnerCallback testRunner}) { testRunner('Casting correctly succeeds', () { final long = JLong(1); - final long2 = long.castTo(JLong.type, releaseOriginal: true); + final long2 = long.as(JLong.type, releaseOriginal: true); expect(long2.longValue(releaseOriginal: true), 1); }); testRunner('Casting incorrectly fails', () { final long = JLong(1); expect( - () => long.castTo(JInteger.type, releaseOriginal: true), + () => long.as(JInteger.type, releaseOriginal: true), throwsA(isA()), ); }); diff --git a/pkgs/jni/test/load_test.dart b/pkgs/jni/test/load_test.dart index 1f331dc95..748ddc6de 100644 --- a/pkgs/jni/test/load_test.dart +++ b/pkgs/jni/test/load_test.dart @@ -43,8 +43,9 @@ const secureRandomSeedBound = 4294967296; final random = Random.secure(); final randomClass = JClass.forName('java/util/Random'); -JObject newRandom() => randomClass.constructorId('(J)V').call( - randomClass, const JObjectType(), [random.nextInt(secureRandomSeedBound)]); +JObject newRandom() => randomClass + .constructorId('(J)V') + .call(randomClass, JObject.type, [random.nextInt(secureRandomSeedBound)]); void run({required TestRunnerCallback testRunner}) { testRunner('Test 4K refs can be created in a row', () { diff --git a/pkgs/jni/test/type_test.dart b/pkgs/jni/test/type_test.dart index b15b26c86..c42e3ddd2 100644 --- a/pkgs/jni/test/type_test.dart +++ b/pkgs/jni/test/type_test.dart @@ -4,7 +4,9 @@ import 'dart:io'; +import 'package:jni/_internal.dart'; import 'package:jni/jni.dart'; +import 'package:jni/src/types.dart'; import 'package:test/test.dart'; import 'test_util/test_util.dart'; @@ -25,17 +27,21 @@ class A extends JObject { } final class $AType extends JObjType { + @internal @override A fromReference(JReference reference) { return A.fromReference(reference); } + @internal @override String get signature => 'A'; + @internal @override int get superCount => superType.superCount + 1; + @internal @override JObjType get superType => JObject.type; @@ -55,17 +61,21 @@ class B extends JObject { } final class $BType extends JObjType { + @internal @override B fromReference(JReference reference) { return B.fromReference(reference); } + @internal @override String get signature => 'B'; + @internal @override int get superCount => superType.superCount + 1; + @internal @override JObjType get superType => JObject.type; @@ -86,17 +96,21 @@ class C extends A { } final class $CType extends JObjType { + @internal @override C fromReference(JReference reference) { return C.fromReference(reference); } + @internal @override String get signature => 'C'; + @internal @override int get superCount => superType.superCount + 1; + @internal @override JObjType get superType => $AType(); @@ -117,17 +131,21 @@ class D extends A { } final class $DType extends JObjType { + @internal @override D fromReference(JReference reference) { return D.fromReference(reference); } + @internal @override String get signature => 'D'; + @internal @override int get superCount => superType.superCount + 1; + @internal @override JObjType get superType => $AType(); @@ -148,17 +166,21 @@ class E extends B { } final class $EType extends JObjType { + @internal @override E fromReference(JReference reference) { return E.fromReference(reference); } + @internal @override String get signature => 'E'; + @internal @override int get superCount => superType.superCount + 1; + @internal @override JObjType get superType => $BType(); @@ -179,17 +201,21 @@ class F extends C { } final class $FType extends JObjType { + @internal @override F fromReference(JReference reference) { return F.fromReference(reference); } + @internal @override String get signature => 'F'; + @internal @override int get superCount => superType.superCount + 1; + @internal @override JObjType get superType => $CType(); @@ -310,11 +336,10 @@ void run({required TestRunnerCallback testRunner}) { // C D E // / // F - expect(lowestCommonSuperType([$AType(), $BType()]), const JObjectType()); - expect(lowestCommonSuperType([$CType(), $BType()]), const JObjectType()); - expect(lowestCommonSuperType([$FType(), $BType()]), const JObjectType()); - expect(lowestCommonSuperType([$EType(), $CType(), $FType()]), - const JObjectType()); + expect(lowestCommonSuperType([$AType(), $BType()]), JObject.type); + expect(lowestCommonSuperType([$CType(), $BType()]), JObject.type); + expect(lowestCommonSuperType([$FType(), $BType()]), JObject.type); + expect(lowestCommonSuperType([$EType(), $CType(), $FType()]), JObject.type); expect(lowestCommonSuperType([$CType(), $DType()]), $AType()); expect(lowestCommonSuperType([$FType(), $DType()]), $AType()); diff --git a/pkgs/jni/tool/wrapper_generators/generate_c_extensions.dart b/pkgs/jni/tool/wrapper_generators/generate_c_extensions.dart index 51be17f42..a5ccef5d4 100644 --- a/pkgs/jni/tool/wrapper_generators/generate_c_extensions.dart +++ b/pkgs/jni/tool/wrapper_generators/generate_c_extensions.dart @@ -249,7 +249,7 @@ String? getWrapperFunc(Member field) { } final callParams = [ 'jniEnv', - ...outerFunctionType.parameters.map((param) => param.name).toList(), + ...outerFunctionType.parameters.map((param) => param.name), if (withVarArgs) 'args', ].join(', '); final resultWrapper = getResultWrapper(returnType); diff --git a/pkgs/jni/tool/wrapper_generators/generate_dart_extensions.dart b/pkgs/jni/tool/wrapper_generators/generate_dart_extensions.dart index f8cf124f6..740434148 100644 --- a/pkgs/jni/tool/wrapper_generators/generate_dart_extensions.dart +++ b/pkgs/jni/tool/wrapper_generators/generate_dart_extensions.dart @@ -264,7 +264,7 @@ String getGlobalEnvExtension( final generatedFunctions = primitiveArrayHelperFunctions.map((f) => f.dartCode).join('\n'); return ''' -/// Wraps over Pointer and exposes function pointer fields +/// Wraps over `Pointer` and exposes function pointer fields /// as methods. class GlobalJniEnv { final ffi.Pointer ptr; diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index b2f1b0ceb..12b2f6120 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -9,12 +9,23 @@ [documentation](https://github.com/dart-lang/native/tree/main/pkgs/jnigen/docs/java_differences.md#method-overloading). - **Breaking Change**: Each single dollar sign is replaced with two dollar signs in the identifier names. +- **Breaking Change**: Removed the `Impl` suffix from the generated + implemenation classes. So the implementation class for an interface named + `Foo` is now simply called `$Foo` instead of `$FooImpl`. +- **Breaking Change**: Renamed `castTo` to `as`. +- **Breaking Change**: Renamed and made the typeclasses internal. +- **Breaking Change**: Relaxed the renaming rules to allow for more identifiers + to remain unchanged. +- Added `JImplementer` which enables building an object that implements multiple + Java interfaces. Each interface now has a static `implementIn` method that + takes a `JImplementer` and the implementation object. - Generating identifiers that start with an underscore (`_`) and making them public by prepending a dollar sign. - Fixed an issue where inheriting a generic class could generate incorrect code. - No longer generating constructors for abstract classes. - No longer generating `protected` elements. - Fixed an issue where synthetic methods caused code generation to fail. +- Renamed library `internal_helpers_for_jnigen` to `_internal`. ## 0.11.0 diff --git a/pkgs/jnigen/android_test_runner/android/app/build.gradle b/pkgs/jnigen/android_test_runner/android/app/build.gradle index 18596cf0a..033226005 100644 --- a/pkgs/jnigen/android_test_runner/android/app/build.gradle +++ b/pkgs/jnigen/android_test_runner/android/app/build.gradle @@ -23,7 +23,9 @@ if (flutterVersionName == null) { } android { - compileSdkVersion flutter.compileSdkVersion + namespace "com.github.dart_lang.jnigen.android_integration_test" + + compileSdkVersion 35 ndkVersion flutter.ndkVersion compileOptions { @@ -42,7 +44,6 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.github.dart_lang.jnigen.android_integration_test" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. diff --git a/pkgs/jnigen/android_test_runner/android/gradle/wrapper/gradle-wrapper.properties b/pkgs/jnigen/android_test_runner/android/gradle/wrapper/gradle-wrapper.properties index 3c472b99c..3c85cfe05 100644 --- a/pkgs/jnigen/android_test_runner/android/gradle/wrapper/gradle-wrapper.properties +++ b/pkgs/jnigen/android_test_runner/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/pkgs/jnigen/android_test_runner/android/settings.gradle b/pkgs/jnigen/android_test_runner/android/settings.gradle index 536165d35..03e70fe44 100644 --- a/pkgs/jnigen/android_test_runner/android/settings.gradle +++ b/pkgs/jnigen/android_test_runner/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.6.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/pkgs/jnigen/docs/interface_implementation.md b/pkgs/jnigen/docs/interface_implementation.md new file mode 100644 index 000000000..01a25efce --- /dev/null +++ b/pkgs/jnigen/docs/interface_implementation.md @@ -0,0 +1,145 @@ +## Implementing Java interfaces from Dart + +> [!NOTE] +> This feature is experimental, and in +> [active development](https://github.com/dart-lang/native/issues/1569). +> +> To opt in to use this feature, add the following to your JNIgen configuration +> yaml: +> +> ```yaml +> enable_experiment: +> - interface_implementation +> ``` + +Let's take a simple Java interface like `Runnable` that has a single `void` +method called `run`: + +```java +// Java +public interface Runnable { + void run(); +} +``` + +These are the bindings that JNIgen generates for this interface: + +```dart +// Dart Bindings - Boilerplate omitted for clarity. +class Runnable extends JObject { + void run() { /* ... */ } + + factory Runnable.implement($Runnable impl) { /* ... */ } + static void implementIn( + JImplementer implementer, + $Runnable impl, + ) { /* ... */ } +} + +abstract interface class $Runnable { + factory $Runnable({ + required void Function() run, + }) = _$Runnable; + + void run(); +} + +class _$Runnable implements $Runnable { + _$Runnable({ + required void Function() run, + }) : _run = run; + + final void Function() _run; + + void run() { + return _run(); + } +} +``` + +### Implementing interfaces inline + +`Runnable` is used a lot to pass a void callback to a function. To simply this +workflow, Java 8 introduced lambdas. + +```java +// Java +Runnable runnable = () -> System.out.println("hello"); +``` + +To allow the same flexibility in Dart, `$Runnable` has a default factory that +simply gets each method of the interface as a closure argument. So you would do: + +```dart +// Dart +final runnable = Runnable.implement($Runnable(run: () => print('hello'))); +``` + +### Reuse the same implementation + +The reason JNIgen generates the `$Runnable` class is to make it easier to reuse +the same implementation for multiple instances. This is analogous to actually +implementing the interface in Java instead of using the lambdas: + +```java +// Java +public class Printer implements Runnable { + private final String text; + + public Printer(String text) { + this.text = text; + } + + @Override + public void run() { + System.out.println(text); + } +} +``` + +This way you can create multiple such Runnables like `new Printer("hello")` and +`new Printer("world")`. + +You can do the same in Dart by creating a subclass that implements `$Runnable`: + +```dart +// Dart +class Printer implements $Runnable { + final String text; + + Printer(this.text); + + @override + void run() { + print(text); + } +} +``` + +And similarly write `Runnable.implement(Printer('hello'))` and +`Runnable.implement(Printer('world'))`, to create multiple Runnables and share +common logic. + +### Implement multiple interfaces + +To implement more than one interface, use a `JImplementer` from `package:jni`. +`Closable` is another simple Java interface that has a single void `close` +method. Here is how we create an object that implements both `Runnable` and +`Closable`: + +```dart +// Dart +final implementer = JImplementer(); +Runnable.implementIn(implementer, $Runnable(run: () => print('run'))); +Closable.implementIn(implementer, $Closable(close: () => print('close'))); +final object = implementer.implement(Runnable.type); // or Closable.type. +``` + +As the created `object` implements both `Runnable` and `Closable`, it's also +possible to make it a `Closable` by passing in `Closable.type` to +`implementer.implement`. Or simply cast it after creation: + +```dart +// Dart +final closable = object.castTo(Closable.type); +``` diff --git a/pkgs/jnigen/example/in_app_java/android/app/build.gradle b/pkgs/jnigen/example/in_app_java/android/app/build.gradle index 96798166c..8c8168980 100644 --- a/pkgs/jnigen/example/in_app_java/android/app/build.gradle +++ b/pkgs/jnigen/example/in_app_java/android/app/build.gradle @@ -23,7 +23,9 @@ if (flutterVersionName == null) { } android { - compileSdkVersion flutter.compileSdkVersion + namespace "com.example.in_app_java" + + compileSdkVersion 35 ndkVersion flutter.ndkVersion compileOptions { @@ -40,7 +42,6 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.in_app_java" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. diff --git a/pkgs/jnigen/example/in_app_java/android/gradle/wrapper/gradle-wrapper.properties b/pkgs/jnigen/example/in_app_java/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..7aeeb11c6 100644 --- a/pkgs/jnigen/example/in_app_java/android/gradle/wrapper/gradle-wrapper.properties +++ b/pkgs/jnigen/example/in_app_java/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/pkgs/jnigen/example/in_app_java/android/settings.gradle b/pkgs/jnigen/example/in_app_java/android/settings.gradle index 536165d35..03e70fe44 100644 --- a/pkgs/jnigen/example/in_app_java/android/settings.gradle +++ b/pkgs/jnigen/example/in_app_java/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.6.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } 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 0a73adc93..ffe6d2aea 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -7,12 +7,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -22,88 +27,98 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; /// from: `androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult` -class EmojiCompat_CodepointSequenceMatchResult extends jni.JObject { - @override - late final jni.JObjType $type = - type; +class EmojiCompat_CodepointSequenceMatchResult extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_CodepointSequenceMatchResult.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_CodepointSequenceMatchResultType(); + static const type = $EmojiCompat_CodepointSequenceMatchResult$Type(); } -final class $EmojiCompat_CodepointSequenceMatchResultType - extends jni.JObjType { - const $EmojiCompat_CodepointSequenceMatchResultType(); +final class $EmojiCompat_CodepointSequenceMatchResult$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_CodepointSequenceMatchResult$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult;'; - @override + @_$jni.internal + @_$core.override EmojiCompat_CodepointSequenceMatchResult fromReference( - jni.JReference reference) => + _$jni.JReference reference) => EmojiCompat_CodepointSequenceMatchResult.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_CodepointSequenceMatchResultType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_CodepointSequenceMatchResult$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_CodepointSequenceMatchResultType) && - other is $EmojiCompat_CodepointSequenceMatchResultType; + ($EmojiCompat_CodepointSequenceMatchResult$Type) && + other is $EmojiCompat_CodepointSequenceMatchResult$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$Config` -class EmojiCompat_Config extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_Config extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_Config.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$Config'); + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$Config'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_ConfigType(); + static const type = $EmojiCompat_Config$Type(); static final _id_registerInitCallback = _class.instanceMethodId( r'registerInitCallback', r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _registerInitCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _registerInitCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. @@ -112,9 +127,9 @@ class EmojiCompat_Config extends jni.JObject { ) { return _registerInitCallback( reference.pointer, - _id_registerInitCallback as jni.JMethodIDPtr, + _id_registerInitCallback as _$jni.JMethodIDPtr, initCallback.reference.pointer) - .object(const $EmojiCompat_ConfigType()); + .object(const $EmojiCompat_Config$Type()); } static final _id_unregisterInitCallback = _class.instanceMethodId( @@ -122,16 +137,16 @@ class EmojiCompat_Config extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _unregisterInitCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _unregisterInitCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. @@ -140,9 +155,9 @@ class EmojiCompat_Config extends jni.JObject { ) { return _unregisterInitCallback( reference.pointer, - _id_unregisterInitCallback as jni.JMethodIDPtr, + _id_unregisterInitCallback as _$jni.JMethodIDPtr, initCallback.reference.pointer) - .object(const $EmojiCompat_ConfigType()); + .object(const $EmojiCompat_Config$Type()); } static final _id_setReplaceAll = _class.instanceMethodId( @@ -150,22 +165,24 @@ class EmojiCompat_Config extends jni.JObject { r'(Z)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setReplaceAll = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setReplaceAll = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setReplaceAll(boolean z)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config setReplaceAll( bool z, ) { - return _setReplaceAll( - reference.pointer, _id_setReplaceAll as jni.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_ConfigType()); + return _setReplaceAll(reference.pointer, + _id_setReplaceAll as _$jni.JMethodIDPtr, z ? 1 : 0) + .object(const $EmojiCompat_Config$Type()); } static final _id_setUseEmojiAsDefaultStyle = _class.instanceMethodId( @@ -173,13 +190,15 @@ class EmojiCompat_Config extends jni.JObject { r'(Z)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setUseEmojiAsDefaultStyle = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setUseEmojiAsDefaultStyle = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -187,8 +206,8 @@ class EmojiCompat_Config extends jni.JObject { bool z, ) { return _setUseEmojiAsDefaultStyle(reference.pointer, - _id_setUseEmojiAsDefaultStyle as jni.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_ConfigType()); + _id_setUseEmojiAsDefaultStyle as _$jni.JMethodIDPtr, z ? 1 : 0) + .object(const $EmojiCompat_Config$Type()); } static final _id_setUseEmojiAsDefaultStyle$1 = _class.instanceMethodId( @@ -196,29 +215,33 @@ class EmojiCompat_Config extends jni.JObject { r'(ZLjava/util/List;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setUseEmojiAsDefaultStyle$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32, ffi.Pointer)>)>>( - 'globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - ffi.Pointer)>(); + static final _setUseEmojiAsDefaultStyle$1 = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Int32, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, _$jni.Pointer<_$jni.Void>)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z, java.util.List list)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config setUseEmojiAsDefaultStyle$1( bool z, - jni.JList list, + _$jni.JList<_$jni.JInteger> list, ) { return _setUseEmojiAsDefaultStyle$1( reference.pointer, - _id_setUseEmojiAsDefaultStyle$1 as jni.JMethodIDPtr, + _id_setUseEmojiAsDefaultStyle$1 as _$jni.JMethodIDPtr, z ? 1 : 0, list.reference.pointer) - .object(const $EmojiCompat_ConfigType()); + .object(const $EmojiCompat_Config$Type()); } static final _id_setEmojiSpanIndicatorEnabled = _class.instanceMethodId( @@ -226,13 +249,15 @@ class EmojiCompat_Config extends jni.JObject { r'(Z)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setEmojiSpanIndicatorEnabled = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + static final _setEmojiSpanIndicatorEnabled = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorEnabled(boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -240,8 +265,8 @@ class EmojiCompat_Config extends jni.JObject { bool z, ) { return _setEmojiSpanIndicatorEnabled(reference.pointer, - _id_setEmojiSpanIndicatorEnabled as jni.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_ConfigType()); + _id_setEmojiSpanIndicatorEnabled as _$jni.JMethodIDPtr, z ? 1 : 0) + .object(const $EmojiCompat_Config$Type()); } static final _id_setEmojiSpanIndicatorColor = _class.instanceMethodId( @@ -249,13 +274,15 @@ class EmojiCompat_Config extends jni.JObject { r'(I)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setEmojiSpanIndicatorColor = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + static final _setEmojiSpanIndicatorColor = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorColor(int i)` /// The returned object must be released after use, by calling the [release] method. @@ -263,8 +290,8 @@ class EmojiCompat_Config extends jni.JObject { int i, ) { return _setEmojiSpanIndicatorColor(reference.pointer, - _id_setEmojiSpanIndicatorColor as jni.JMethodIDPtr, i) - .object(const $EmojiCompat_ConfigType()); + _id_setEmojiSpanIndicatorColor as _$jni.JMethodIDPtr, i) + .object(const $EmojiCompat_Config$Type()); } static final _id_setMetadataLoadStrategy = _class.instanceMethodId( @@ -272,13 +299,15 @@ class EmojiCompat_Config extends jni.JObject { r'(I)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setMetadataLoadStrategy = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setMetadataLoadStrategy = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setMetadataLoadStrategy(int i)` /// The returned object must be released after use, by calling the [release] method. @@ -286,8 +315,8 @@ class EmojiCompat_Config extends jni.JObject { int i, ) { return _setMetadataLoadStrategy(reference.pointer, - _id_setMetadataLoadStrategy as jni.JMethodIDPtr, i) - .object(const $EmojiCompat_ConfigType()); + _id_setMetadataLoadStrategy as _$jni.JMethodIDPtr, i) + .object(const $EmojiCompat_Config$Type()); } static final _id_setSpanFactory = _class.instanceMethodId( @@ -295,16 +324,16 @@ class EmojiCompat_Config extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$SpanFactory;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setSpanFactory = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setSpanFactory = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setSpanFactory(androidx.emoji2.text.EmojiCompat$SpanFactory spanFactory)` /// The returned object must be released after use, by calling the [release] method. @@ -313,9 +342,9 @@ class EmojiCompat_Config extends jni.JObject { ) { return _setSpanFactory( reference.pointer, - _id_setSpanFactory as jni.JMethodIDPtr, + _id_setSpanFactory as _$jni.JMethodIDPtr, spanFactory.reference.pointer) - .object(const $EmojiCompat_ConfigType()); + .object(const $EmojiCompat_Config$Type()); } static final _id_setGlyphChecker = _class.instanceMethodId( @@ -323,16 +352,16 @@ class EmojiCompat_Config extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$GlyphChecker;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setGlyphChecker = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setGlyphChecker = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. @@ -341,73 +370,82 @@ class EmojiCompat_Config extends jni.JObject { ) { return _setGlyphChecker( reference.pointer, - _id_setGlyphChecker as jni.JMethodIDPtr, + _id_setGlyphChecker as _$jni.JMethodIDPtr, glyphChecker.reference.pointer) - .object(const $EmojiCompat_ConfigType()); + .object(const $EmojiCompat_Config$Type()); } } -final class $EmojiCompat_ConfigType extends jni.JObjType { - const $EmojiCompat_ConfigType(); +final class $EmojiCompat_Config$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_Config$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$Config;'; - @override - EmojiCompat_Config fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_Config fromReference(_$jni.JReference reference) => EmojiCompat_Config.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_ConfigType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_Config$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_ConfigType) && - other is $EmojiCompat_ConfigType; + return other.runtimeType == ($EmojiCompat_Config$Type) && + other is $EmojiCompat_Config$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$DefaultSpanFactory` -class EmojiCompat_DefaultSpanFactory extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_DefaultSpanFactory extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_DefaultSpanFactory.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/EmojiCompat$DefaultSpanFactory'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_DefaultSpanFactoryType(); + static const type = $EmojiCompat_DefaultSpanFactory$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_DefaultSpanFactory() { return EmojiCompat_DefaultSpanFactory.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -416,165 +454,181 @@ class EmojiCompat_DefaultSpanFactory extends jni.JObject { r'(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;', ); - static final _createSpan = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createSpan = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer typefaceEmojiRasterizer)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject createSpan( - jni.JObject typefaceEmojiRasterizer, + _$jni.JObject createSpan( + _$jni.JObject typefaceEmojiRasterizer, ) { - return _createSpan(reference.pointer, _id_createSpan as jni.JMethodIDPtr, + return _createSpan(reference.pointer, _id_createSpan as _$jni.JMethodIDPtr, typefaceEmojiRasterizer.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } } -final class $EmojiCompat_DefaultSpanFactoryType - extends jni.JObjType { - const $EmojiCompat_DefaultSpanFactoryType(); +final class $EmojiCompat_DefaultSpanFactory$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_DefaultSpanFactory$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$DefaultSpanFactory;'; - @override - EmojiCompat_DefaultSpanFactory fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_DefaultSpanFactory fromReference(_$jni.JReference reference) => EmojiCompat_DefaultSpanFactory.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_DefaultSpanFactoryType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_DefaultSpanFactory$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_DefaultSpanFactoryType) && - other is $EmojiCompat_DefaultSpanFactoryType; + return other.runtimeType == ($EmojiCompat_DefaultSpanFactory$Type) && + other is $EmojiCompat_DefaultSpanFactory$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$GlyphChecker` -class EmojiCompat_GlyphChecker extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_GlyphChecker extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_GlyphChecker.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$GlyphChecker'); + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$GlyphChecker'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_GlyphCheckerType(); + static const type = $EmojiCompat_GlyphChecker$Type(); static final _id_hasGlyph = _class.instanceMethodId( r'hasGlyph', r'(Ljava/lang/CharSequence;III)Z', ); - static final _hasGlyph = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _hasGlyph = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - $Int32, - $Int32, - $Int32 + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 )>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int, int)>(); /// from: `public abstract boolean hasGlyph(java.lang.CharSequence charSequence, int i, int i1, int i2)` bool hasGlyph( - jni.JObject charSequence, + _$jni.JObject charSequence, int i, int i1, int i2, ) { - return _hasGlyph(reference.pointer, _id_hasGlyph as jni.JMethodIDPtr, + return _hasGlyph(reference.pointer, _id_hasGlyph as _$jni.JMethodIDPtr, charSequence.reference.pointer, i, i1, i2) .boolean; } } -final class $EmojiCompat_GlyphCheckerType - extends jni.JObjType { - const $EmojiCompat_GlyphCheckerType(); +final class $EmojiCompat_GlyphChecker$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_GlyphChecker$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$GlyphChecker;'; - @override - EmojiCompat_GlyphChecker fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_GlyphChecker fromReference(_$jni.JReference reference) => EmojiCompat_GlyphChecker.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_GlyphCheckerType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_GlyphChecker$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_GlyphCheckerType) && - other is $EmojiCompat_GlyphCheckerType; + return other.runtimeType == ($EmojiCompat_GlyphChecker$Type) && + other is $EmojiCompat_GlyphChecker$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$InitCallback` -class EmojiCompat_InitCallback extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_InitCallback extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_InitCallback.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$InitCallback'); + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$InitCallback'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_InitCallbackType(); + static const type = $EmojiCompat_InitCallback$Type(); static final _id_onInitialized = _class.instanceMethodId( r'onInitialized', r'()V', ); - static final _onInitialized = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _onInitialized = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void onInitialized()` void onInitialized() { - _onInitialized(reference.pointer, _id_onInitialized as jni.JMethodIDPtr) + _onInitialized(reference.pointer, _id_onInitialized as _$jni.JMethodIDPtr) .check(); } @@ -583,200 +637,224 @@ class EmojiCompat_InitCallback extends jni.JObject { r'(Ljava/lang/Throwable;)V', ); - static final _onFailed = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _onFailed = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void onFailed(java.lang.Throwable throwable)` void onFailed( - jni.JObject throwable, + _$jni.JObject throwable, ) { - _onFailed(reference.pointer, _id_onFailed as jni.JMethodIDPtr, + _onFailed(reference.pointer, _id_onFailed as _$jni.JMethodIDPtr, throwable.reference.pointer) .check(); } } -final class $EmojiCompat_InitCallbackType - extends jni.JObjType { - const $EmojiCompat_InitCallbackType(); +final class $EmojiCompat_InitCallback$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_InitCallback$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$InitCallback;'; - @override - EmojiCompat_InitCallback fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_InitCallback fromReference(_$jni.JReference reference) => EmojiCompat_InitCallback.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_InitCallbackType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_InitCallback$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_InitCallbackType) && - other is $EmojiCompat_InitCallbackType; + return other.runtimeType == ($EmojiCompat_InitCallback$Type) && + other is $EmojiCompat_InitCallback$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$LoadStrategy` -class EmojiCompat_LoadStrategy extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_LoadStrategy extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_LoadStrategy.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$LoadStrategy'); + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$LoadStrategy'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_LoadStrategyType(); + static const type = $EmojiCompat_LoadStrategy$Type(); } -final class $EmojiCompat_LoadStrategyType - extends jni.JObjType { - const $EmojiCompat_LoadStrategyType(); +final class $EmojiCompat_LoadStrategy$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_LoadStrategy$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$LoadStrategy;'; - @override - EmojiCompat_LoadStrategy fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_LoadStrategy fromReference(_$jni.JReference reference) => EmojiCompat_LoadStrategy.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_LoadStrategyType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_LoadStrategy$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_LoadStrategyType) && - other is $EmojiCompat_LoadStrategyType; + return other.runtimeType == ($EmojiCompat_LoadStrategy$Type) && + other is $EmojiCompat_LoadStrategy$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$MetadataRepoLoader` -class EmojiCompat_MetadataRepoLoader extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_MetadataRepoLoader.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoader'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_MetadataRepoLoaderType(); + static const type = $EmojiCompat_MetadataRepoLoader$Type(); static final _id_load = _class.instanceMethodId( r'load', r'(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V', ); - static final _load = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _load = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract void load(androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback metadataRepoLoaderCallback)` void load( EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback, ) { - _load(reference.pointer, _id_load as jni.JMethodIDPtr, + _load(reference.pointer, _id_load as _$jni.JMethodIDPtr, metadataRepoLoaderCallback.reference.pointer) .check(); } } -final class $EmojiCompat_MetadataRepoLoaderType - extends jni.JObjType { - const $EmojiCompat_MetadataRepoLoaderType(); +final class $EmojiCompat_MetadataRepoLoader$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_MetadataRepoLoader$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;'; - @override - EmojiCompat_MetadataRepoLoader fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_MetadataRepoLoader fromReference(_$jni.JReference reference) => EmojiCompat_MetadataRepoLoader.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_MetadataRepoLoaderType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_MetadataRepoLoader$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderType) && - other is $EmojiCompat_MetadataRepoLoaderType; + return other.runtimeType == ($EmojiCompat_MetadataRepoLoader$Type) && + other is $EmojiCompat_MetadataRepoLoader$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback` -class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_MetadataRepoLoaderCallback.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_MetadataRepoLoaderCallbackType(); + static const type = $EmojiCompat_MetadataRepoLoaderCallback$Type(); static final _id_onLoaded = _class.instanceMethodId( r'onLoaded', r'(Landroidx/emoji2/text/MetadataRepo;)V', ); - static final _onLoaded = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _onLoaded = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract void onLoaded(androidx.emoji2.text.MetadataRepo metadataRepo)` void onLoaded( - jni.JObject metadataRepo, + _$jni.JObject metadataRepo, ) { - _onLoaded(reference.pointer, _id_onLoaded as jni.JMethodIDPtr, + _onLoaded(reference.pointer, _id_onLoaded as _$jni.JMethodIDPtr, metadataRepo.reference.pointer) .check(); } @@ -786,180 +864,206 @@ class EmojiCompat_MetadataRepoLoaderCallback extends jni.JObject { r'(Ljava/lang/Throwable;)V', ); - static final _onFailed = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _onFailed = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract void onFailed(java.lang.Throwable throwable)` void onFailed( - jni.JObject throwable, + _$jni.JObject throwable, ) { - _onFailed(reference.pointer, _id_onFailed as jni.JMethodIDPtr, + _onFailed(reference.pointer, _id_onFailed as _$jni.JMethodIDPtr, throwable.reference.pointer) .check(); } } -final class $EmojiCompat_MetadataRepoLoaderCallbackType - extends jni.JObjType { - const $EmojiCompat_MetadataRepoLoaderCallbackType(); +final class $EmojiCompat_MetadataRepoLoaderCallback$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_MetadataRepoLoaderCallback$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;'; - @override + @_$jni.internal + @_$core.override EmojiCompat_MetadataRepoLoaderCallback fromReference( - jni.JReference reference) => + _$jni.JReference reference) => EmojiCompat_MetadataRepoLoaderCallback.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallbackType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallback$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderCallbackType) && - other is $EmojiCompat_MetadataRepoLoaderCallbackType; + return other.runtimeType == + ($EmojiCompat_MetadataRepoLoaderCallback$Type) && + other is $EmojiCompat_MetadataRepoLoaderCallback$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$ReplaceStrategy` -class EmojiCompat_ReplaceStrategy extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_ReplaceStrategy extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_ReplaceStrategy.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$ReplaceStrategy'); + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$ReplaceStrategy'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_ReplaceStrategyType(); + static const type = $EmojiCompat_ReplaceStrategy$Type(); } -final class $EmojiCompat_ReplaceStrategyType - extends jni.JObjType { - const $EmojiCompat_ReplaceStrategyType(); +final class $EmojiCompat_ReplaceStrategy$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_ReplaceStrategy$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$ReplaceStrategy;'; - @override - EmojiCompat_ReplaceStrategy fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_ReplaceStrategy fromReference(_$jni.JReference reference) => EmojiCompat_ReplaceStrategy.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_ReplaceStrategyType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_ReplaceStrategy$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_ReplaceStrategyType) && - other is $EmojiCompat_ReplaceStrategyType; + return other.runtimeType == ($EmojiCompat_ReplaceStrategy$Type) && + other is $EmojiCompat_ReplaceStrategy$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$SpanFactory` -class EmojiCompat_SpanFactory extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat_SpanFactory extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat_SpanFactory.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$SpanFactory'); + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$SpanFactory'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompat_SpanFactoryType(); + static const type = $EmojiCompat_SpanFactory$Type(); static final _id_createSpan = _class.instanceMethodId( r'createSpan', r'(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;', ); - static final _createSpan = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createSpan = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer typefaceEmojiRasterizer)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject createSpan( - jni.JObject typefaceEmojiRasterizer, + _$jni.JObject createSpan( + _$jni.JObject typefaceEmojiRasterizer, ) { - return _createSpan(reference.pointer, _id_createSpan as jni.JMethodIDPtr, + return _createSpan(reference.pointer, _id_createSpan as _$jni.JMethodIDPtr, typefaceEmojiRasterizer.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } } -final class $EmojiCompat_SpanFactoryType - extends jni.JObjType { - const $EmojiCompat_SpanFactoryType(); +final class $EmojiCompat_SpanFactory$Type + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_SpanFactory$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$SpanFactory;'; - @override - EmojiCompat_SpanFactory fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat_SpanFactory fromReference(_$jni.JReference reference) => EmojiCompat_SpanFactory.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompat_SpanFactoryType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat_SpanFactory$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_SpanFactoryType) && - other is $EmojiCompat_SpanFactoryType; + return other.runtimeType == ($EmojiCompat_SpanFactory$Type) && + other is $EmojiCompat_SpanFactory$Type; } } /// from: `androidx.emoji2.text.EmojiCompat` -class EmojiCompat extends jni.JObject { - @override - late final jni.JObjType $type = type; +class EmojiCompat extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal EmojiCompat.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat'); + static final _class = + _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat'); /// The type which includes information such as the signature of this class. - static const type = $EmojiCompatType(); + static const type = $EmojiCompat$Type(); static final _id_EDITOR_INFO_METAVERSION_KEY = _class.staticFieldId( r'EDITOR_INFO_METAVERSION_KEY', r'Ljava/lang/String;', @@ -967,8 +1071,8 @@ class EmojiCompat extends jni.JObject { /// from: `static public final java.lang.String EDITOR_INFO_METAVERSION_KEY` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get EDITOR_INFO_METAVERSION_KEY => - _id_EDITOR_INFO_METAVERSION_KEY.get(_class, const jni.JStringType()); + static _$jni.JString get EDITOR_INFO_METAVERSION_KEY => + _id_EDITOR_INFO_METAVERSION_KEY.get(_class, const _$jni.JStringType()); static final _id_EDITOR_INFO_REPLACE_ALL_KEY = _class.staticFieldId( r'EDITOR_INFO_REPLACE_ALL_KEY', @@ -977,8 +1081,8 @@ class EmojiCompat extends jni.JObject { /// 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. - static jni.JString get EDITOR_INFO_REPLACE_ALL_KEY => - _id_EDITOR_INFO_REPLACE_ALL_KEY.get(_class, const jni.JStringType()); + static _$jni.JString get EDITOR_INFO_REPLACE_ALL_KEY => + _id_EDITOR_INFO_REPLACE_ALL_KEY.get(_class, const _$jni.JStringType()); /// from: `static public final int LOAD_STATE_DEFAULT` static const LOAD_STATE_DEFAULT = 3; @@ -1020,25 +1124,25 @@ class EmojiCompat extends jni.JObject { r'(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _init = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _init = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. static EmojiCompat init( - jni.JObject context, + _$jni.JObject context, ) { - return _init(_class.reference.pointer, _id_init as jni.JMethodIDPtr, + return _init(_class.reference.pointer, _id_init as _$jni.JMethodIDPtr, context.reference.pointer) - .object(const $EmojiCompatType()); + .object(const $EmojiCompat$Type()); } static final _id_init$1 = _class.staticMethodId( @@ -1046,33 +1150,36 @@ class EmojiCompat extends jni.JObject { r'(Landroid/content/Context;Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _init$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _init$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory defaultEmojiCompatConfigFactory)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat init$1( - jni.JObject context, + _$jni.JObject context, DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory defaultEmojiCompatConfigFactory, ) { return _init$1( _class.reference.pointer, - _id_init$1 as jni.JMethodIDPtr, + _id_init$1 as _$jni.JMethodIDPtr, context.reference.pointer, defaultEmojiCompatConfigFactory.reference.pointer) - .object(const $EmojiCompatType()); + .object(const $EmojiCompat$Type()); } static final _id_init$2 = _class.staticMethodId( @@ -1080,25 +1187,25 @@ class EmojiCompat extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _init$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _init$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.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. static EmojiCompat init$2( EmojiCompat_Config config, ) { - return _init$2(_class.reference.pointer, _id_init$2 as jni.JMethodIDPtr, + return _init$2(_class.reference.pointer, _id_init$2 as _$jni.JMethodIDPtr, config.reference.pointer) - .object(const $EmojiCompatType()); + .object(const $EmojiCompat$Type()); } static final _id_isConfigured = _class.staticMethodId( @@ -1106,22 +1213,22 @@ class EmojiCompat extends jni.JObject { r'()Z', ); - static final _isConfigured = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isConfigured = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public boolean isConfigured()` static bool isConfigured() { return _isConfigured( - _class.reference.pointer, _id_isConfigured as jni.JMethodIDPtr) + _class.reference.pointer, _id_isConfigured as _$jni.JMethodIDPtr) .boolean; } @@ -1130,25 +1237,25 @@ class EmojiCompat extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _reset = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _reset = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. static EmojiCompat reset( EmojiCompat_Config config, ) { - return _reset(_class.reference.pointer, _id_reset as jni.JMethodIDPtr, + return _reset(_class.reference.pointer, _id_reset as _$jni.JMethodIDPtr, config.reference.pointer) - .object(const $EmojiCompatType()); + .object(const $EmojiCompat$Type()); } static final _id_reset$1 = _class.staticMethodId( @@ -1156,25 +1263,25 @@ class EmojiCompat extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _reset$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _reset$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. static EmojiCompat reset$1( EmojiCompat emojiCompat, ) { - return _reset$1(_class.reference.pointer, _id_reset$1 as jni.JMethodIDPtr, + return _reset$1(_class.reference.pointer, _id_reset$1 as _$jni.JMethodIDPtr, emojiCompat.reference.pointer) - .object(const $EmojiCompatType()); + .object(const $EmojiCompat$Type()); } static final _id_skipDefaultConfigurationLookup = _class.staticMethodId( @@ -1182,47 +1289,47 @@ class EmojiCompat extends jni.JObject { r'(Z)V', ); - static final _skipDefaultConfigurationLookup = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallStaticVoidMethod') - .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + static final _skipDefaultConfigurationLookup = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallStaticVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `static public void skipDefaultConfigurationLookup(boolean z)` static void skipDefaultConfigurationLookup( bool z, ) { _skipDefaultConfigurationLookup(_class.reference.pointer, - _id_skipDefaultConfigurationLookup as jni.JMethodIDPtr, z ? 1 : 0) + _id_skipDefaultConfigurationLookup as _$jni.JMethodIDPtr, z ? 1 : 0) .check(); } - static final _id_get$ = _class.staticMethodId( + static final _id_get = _class.staticMethodId( r'get', r'()Landroidx/emoji2/text/EmojiCompat;', ); - static final _get$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _get = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public androidx.emoji2.text.EmojiCompat get()` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat get$() { - return _get$(_class.reference.pointer, _id_get$ as jni.JMethodIDPtr) - .object(const $EmojiCompatType()); + static EmojiCompat get() { + return _get(_class.reference.pointer, _id_get as _$jni.JMethodIDPtr) + .object(const $EmojiCompat$Type()); } static final _id_load = _class.instanceMethodId( @@ -1230,21 +1337,21 @@ class EmojiCompat extends jni.JObject { r'()V', ); - static final _load = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _load = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void load()` void load() { - _load(reference.pointer, _id_load as jni.JMethodIDPtr).check(); + _load(reference.pointer, _id_load as _$jni.JMethodIDPtr).check(); } static final _id_registerInitCallback = _class.instanceMethodId( @@ -1252,16 +1359,16 @@ class EmojiCompat extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V', ); - static final _registerInitCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _registerInitCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void registerInitCallback( @@ -1269,7 +1376,7 @@ class EmojiCompat extends jni.JObject { ) { _registerInitCallback( reference.pointer, - _id_registerInitCallback as jni.JMethodIDPtr, + _id_registerInitCallback as _$jni.JMethodIDPtr, initCallback.reference.pointer) .check(); } @@ -1279,16 +1386,16 @@ class EmojiCompat extends jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V', ); - static final _unregisterInitCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _unregisterInitCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void unregisterInitCallback( @@ -1296,7 +1403,7 @@ class EmojiCompat extends jni.JObject { ) { _unregisterInitCallback( reference.pointer, - _id_unregisterInitCallback as jni.JMethodIDPtr, + _id_unregisterInitCallback as _$jni.JMethodIDPtr, initCallback.reference.pointer) .check(); } @@ -1306,22 +1413,22 @@ class EmojiCompat extends jni.JObject { r'()I', ); - static final _getLoadState = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getLoadState = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getLoadState()` int getLoadState() { return _getLoadState( - reference.pointer, _id_getLoadState as jni.JMethodIDPtr) + reference.pointer, _id_getLoadState as _$jni.JMethodIDPtr) .integer; } @@ -1330,22 +1437,23 @@ class EmojiCompat extends jni.JObject { r'()Z', ); - static final _isEmojiSpanIndicatorEnabled = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallBooleanMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _isEmojiSpanIndicatorEnabled = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `public boolean isEmojiSpanIndicatorEnabled()` bool isEmojiSpanIndicatorEnabled() { return _isEmojiSpanIndicatorEnabled(reference.pointer, - _id_isEmojiSpanIndicatorEnabled as jni.JMethodIDPtr) + _id_isEmojiSpanIndicatorEnabled as _$jni.JMethodIDPtr) .boolean; } @@ -1354,22 +1462,23 @@ class EmojiCompat extends jni.JObject { r'()I', ); - static final _getEmojiSpanIndicatorColor = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _getEmojiSpanIndicatorColor = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `public int getEmojiSpanIndicatorColor()` int getEmojiSpanIndicatorColor() { return _getEmojiSpanIndicatorColor(reference.pointer, - _id_getEmojiSpanIndicatorColor as jni.JMethodIDPtr) + _id_getEmojiSpanIndicatorColor as _$jni.JMethodIDPtr) .integer; } @@ -1378,25 +1487,26 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;I)I', ); - static final _getEmojiStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _getEmojiStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public int getEmojiStart(java.lang.CharSequence charSequence, int i)` int getEmojiStart( - jni.JObject charSequence, + _$jni.JObject charSequence, int i, ) { return _getEmojiStart( reference.pointer, - _id_getEmojiStart as jni.JMethodIDPtr, + _id_getEmojiStart as _$jni.JMethodIDPtr, charSequence.reference.pointer, i) .integer; @@ -1407,24 +1517,28 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;I)I', ); - static final _getEmojiEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _getEmojiEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public int getEmojiEnd(java.lang.CharSequence charSequence, int i)` int getEmojiEnd( - jni.JObject charSequence, + _$jni.JObject charSequence, int i, ) { - return _getEmojiEnd(reference.pointer, _id_getEmojiEnd as jni.JMethodIDPtr, - charSequence.reference.pointer, i) + return _getEmojiEnd( + reference.pointer, + _id_getEmojiEnd as _$jni.JMethodIDPtr, + charSequence.reference.pointer, + i) .integer; } @@ -1433,30 +1547,34 @@ class EmojiCompat extends jni.JObject { r'(Landroid/text/Editable;ILandroid/view/KeyEvent;)Z', ); - static final _handleOnKeyDown = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _handleOnKeyDown = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - $Int32, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + int, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public boolean handleOnKeyDown(android.text.Editable editable, int i, android.view.KeyEvent keyEvent)` static bool handleOnKeyDown( - jni.JObject editable, + _$jni.JObject editable, int i, - jni.JObject keyEvent, + _$jni.JObject keyEvent, ) { return _handleOnKeyDown( _class.reference.pointer, - _id_handleOnKeyDown as jni.JMethodIDPtr, + _id_handleOnKeyDown as _$jni.JMethodIDPtr, editable.reference.pointer, i, keyEvent.reference.pointer) @@ -1468,34 +1586,41 @@ class EmojiCompat extends jni.JObject { r'(Landroid/view/inputmethod/InputConnection;Landroid/text/Editable;IIZ)Z', ); - static final _handleDeleteSurroundingText = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer, - $Int32, - $Int32, - $Int32 - )>)>>('globalEnv_CallStaticBooleanMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer, int, int, int)>(); + static final _handleDeleteSurroundingText = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_CallStaticBooleanMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + int, + int, + int)>(); /// from: `static public boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection inputConnection, android.text.Editable editable, int i, int i1, boolean z)` static bool handleDeleteSurroundingText( - jni.JObject inputConnection, - jni.JObject editable, + _$jni.JObject inputConnection, + _$jni.JObject editable, int i, int i1, bool z, ) { return _handleDeleteSurroundingText( _class.reference.pointer, - _id_handleDeleteSurroundingText as jni.JMethodIDPtr, + _id_handleDeleteSurroundingText as _$jni.JMethodIDPtr, inputConnection.reference.pointer, editable.reference.pointer, i, @@ -1509,24 +1634,24 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;)Z', ); - static final _hasEmojiGlyph = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _hasEmojiGlyph = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean hasEmojiGlyph(java.lang.CharSequence charSequence)` bool hasEmojiGlyph( - jni.JObject charSequence, + _$jni.JObject charSequence, ) { return _hasEmojiGlyph( reference.pointer, - _id_hasEmojiGlyph as jni.JMethodIDPtr, + _id_hasEmojiGlyph as _$jni.JMethodIDPtr, charSequence.reference.pointer) .boolean; } @@ -1536,25 +1661,26 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;I)Z', ); - static final _hasEmojiGlyph$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _hasEmojiGlyph$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public boolean hasEmojiGlyph(java.lang.CharSequence charSequence, int i)` bool hasEmojiGlyph$1( - jni.JObject charSequence, + _$jni.JObject charSequence, int i, ) { return _hasEmojiGlyph$1( reference.pointer, - _id_hasEmojiGlyph$1 as jni.JMethodIDPtr, + _id_hasEmojiGlyph$1 as _$jni.JMethodIDPtr, charSequence.reference.pointer, i) .boolean; @@ -1565,25 +1691,26 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;I)I', ); - static final _getEmojiMatch = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _getEmojiMatch = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public int getEmojiMatch(java.lang.CharSequence charSequence, int i)` int getEmojiMatch( - jni.JObject charSequence, + _$jni.JObject charSequence, int i, ) { return _getEmojiMatch( reference.pointer, - _id_getEmojiMatch as jni.JMethodIDPtr, + _id_getEmojiMatch as _$jni.JMethodIDPtr, charSequence.reference.pointer, i) .integer; @@ -1594,25 +1721,25 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;', ); - static final _process = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _process = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject process( - jni.JObject charSequence, + _$jni.JObject process( + _$jni.JObject charSequence, ) { - return _process(reference.pointer, _id_process as jni.JMethodIDPtr, + return _process(reference.pointer, _id_process as _$jni.JMethodIDPtr, charSequence.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_process$1 = _class.instanceMethodId( @@ -1620,27 +1747,31 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;', ); - static final _process$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - 'globalEnv_CallObjectMethod') + static final _process$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject process$1( - jni.JObject charSequence, + _$jni.JObject process$1( + _$jni.JObject charSequence, int i, int i1, ) { - return _process$1(reference.pointer, _id_process$1 as jni.JMethodIDPtr, + return _process$1(reference.pointer, _id_process$1 as _$jni.JMethodIDPtr, charSequence.reference.pointer, i, i1) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_process$2 = _class.instanceMethodId( @@ -1648,33 +1779,33 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;III)Ljava/lang/CharSequence;', ); - static final _process$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _process$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - $Int32, - $Int32, - $Int32 + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int, int)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1, int i2)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject process$2( - jni.JObject charSequence, + _$jni.JObject process$2( + _$jni.JObject charSequence, int i, int i1, int i2, ) { - return _process$2(reference.pointer, _id_process$2 as jni.JMethodIDPtr, + return _process$2(reference.pointer, _id_process$2 as _$jni.JMethodIDPtr, charSequence.reference.pointer, i, i1, i2) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_process$3 = _class.instanceMethodId( @@ -1682,35 +1813,41 @@ class EmojiCompat extends jni.JObject { r'(Ljava/lang/CharSequence;IIII)Ljava/lang/CharSequence;', ); - static final _process$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _process$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - $Int32, - $Int32, - $Int32, - $Int32 + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int, int, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + int, + int, + int, + int)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1, int i2, int i3)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject process$3( - jni.JObject charSequence, + _$jni.JObject process$3( + _$jni.JObject charSequence, int i, int i1, int i2, int i3, ) { - return _process$3(reference.pointer, _id_process$3 as jni.JMethodIDPtr, + return _process$3(reference.pointer, _id_process$3 as _$jni.JMethodIDPtr, charSequence.reference.pointer, i, i1, i2, i3) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_getAssetSignature = _class.instanceMethodId( @@ -1718,24 +1855,24 @@ class EmojiCompat extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getAssetSignature = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getAssetSignature = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getAssetSignature()` /// The returned object must be released after use, by calling the [release] method. - jni.JString getAssetSignature() { + _$jni.JString getAssetSignature() { return _getAssetSignature( - reference.pointer, _id_getAssetSignature as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getAssetSignature as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_updateEditorInfo = _class.instanceMethodId( @@ -1743,86 +1880,94 @@ class EmojiCompat extends jni.JObject { r'(Landroid/view/inputmethod/EditorInfo;)V', ); - static final _updateEditorInfo = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _updateEditorInfo = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void updateEditorInfo(android.view.inputmethod.EditorInfo editorInfo)` void updateEditorInfo( - jni.JObject editorInfo, + _$jni.JObject editorInfo, ) { _updateEditorInfo( reference.pointer, - _id_updateEditorInfo as jni.JMethodIDPtr, + _id_updateEditorInfo as _$jni.JMethodIDPtr, editorInfo.reference.pointer) .check(); } } -final class $EmojiCompatType extends jni.JObjType { - const $EmojiCompatType(); +final class $EmojiCompat$Type extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/EmojiCompat;'; - @override - EmojiCompat fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + EmojiCompat fromReference(_$jni.JReference reference) => EmojiCompat.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($EmojiCompatType).hashCode; + @_$core.override + int get hashCode => ($EmojiCompat$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompatType) && other is $EmojiCompatType; + return other.runtimeType == ($EmojiCompat$Type) && + other is $EmojiCompat$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory - extends jni.JObject { - @override - late final jni - .JObjType - $type = type; + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType + $type; + @_$jni.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory'); /// The type which includes information such as the signature of this class. static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type(); static final _id_new$ = _class.constructorId( r'(Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper defaultEmojiCompatConfigHelper)` /// The returned object must be released after use, by calling the [release] method. @@ -1833,7 +1978,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory .fromReference(_new$( _class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, + _id_new$ as _$jni.JMethodIDPtr, defaultEmojiCompatConfigHelper.reference.pointer) .reference); } @@ -1843,93 +1988,100 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory r'(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _create = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _create = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. EmojiCompat_Config create( - jni.JObject context, + _$jni.JObject context, ) { - return _create(reference.pointer, _id_create as jni.JMethodIDPtr, + return _create(reference.pointer, _id_create as _$jni.JMethodIDPtr, context.reference.pointer) - .object(const $EmojiCompat_ConfigType()); + .object(const $EmojiCompat_Config$Type()); } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType - extends jni +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type + extends _$jni .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;'; - @override + @_$jni.internal + @_$core.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory fromReference( - jni.JReference reference) => + _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override + @_$core.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType).hashCode; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType) && - other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type) && + other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper - extends jni.JObject { - @override - late final jni - .JObjType $type = - type; + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType + $type; + @_$jni.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper'); /// The type which includes information such as the signature of this class. static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -1937,7 +2089,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper .fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -1946,32 +2098,35 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/content/pm/Signature;', ); - static final _getSigningSignatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _getSigningSignatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - jni.JArray getSigningSignatures( - jni.JObject packageManager, - jni.JString string, + _$jni.JArray<_$jni.JObject> getSigningSignatures( + _$jni.JObject packageManager, + _$jni.JString string, ) { return _getSigningSignatures( reference.pointer, - _id_getSigningSignatures as jni.JMethodIDPtr, + _id_getSigningSignatures as _$jni.JMethodIDPtr, packageManager.reference.pointer, string.reference.pointer) - .object(const jni.JArrayType(jni.JObjectType())); + .object(const _$jni.JArrayType(_$jni.JObjectType())); } static final _id_queryIntentContentProviders = _class.instanceMethodId( @@ -1979,35 +2134,40 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/util/List;', ); - static final _queryIntentContentProviders = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer, - $Int32 - )>)>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer, int)>(); + static final _queryIntentContentProviders = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + int)>(); /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. - jni.JList queryIntentContentProviders( - jni.JObject packageManager, - jni.JObject intent, + _$jni.JList<_$jni.JObject> queryIntentContentProviders( + _$jni.JObject packageManager, + _$jni.JObject intent, int i, ) { return _queryIntentContentProviders( reference.pointer, - _id_queryIntentContentProviders as jni.JMethodIDPtr, + _id_queryIntentContentProviders as _$jni.JMethodIDPtr, packageManager.reference.pointer, intent.reference.pointer, i) - .object(const jni.JListType(jni.JObjectType())); + .object(const _$jni.JListType(_$jni.JObjectType())); } static final _id_getProviderInfo = _class.instanceMethodId( @@ -2015,95 +2175,103 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;', ); - static final _getProviderInfo = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getProviderInfo = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject getProviderInfo( - jni.JObject resolveInfo, + _$jni.JObject getProviderInfo( + _$jni.JObject resolveInfo, ) { return _getProviderInfo( reference.pointer, - _id_getProviderInfo as jni.JMethodIDPtr, + _id_getProviderInfo as _$jni.JMethodIDPtr, resolveInfo.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType - extends jni +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type + extends _$jni .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;'; - @override + @_$jni.internal + @_$core.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper fromReference( - jni.JReference reference) => + _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override + @_$core.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType).hashCode; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType) && - other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType; + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type) && + other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper { - @override - late final jni + @_$jni.internal + @_$core.override + final _$jni .JObjType - $type = type; + $type; + @_$jni.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19'); /// The type which includes information such as the signature of this class. static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -2111,7 +2279,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 .fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -2120,35 +2288,40 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 r'(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/util/List;', ); - static final _queryIntentContentProviders = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer, - $Int32 - )>)>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer, int)>(); + static final _queryIntentContentProviders = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + int)>(); /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. - jni.JList queryIntentContentProviders( - jni.JObject packageManager, - jni.JObject intent, + _$jni.JList<_$jni.JObject> queryIntentContentProviders( + _$jni.JObject packageManager, + _$jni.JObject intent, int i, ) { return _queryIntentContentProviders( reference.pointer, - _id_queryIntentContentProviders as jni.JMethodIDPtr, + _id_queryIntentContentProviders as _$jni.JMethodIDPtr, packageManager.reference.pointer, intent.reference.pointer, i) - .object(const jni.JListType(jni.JObjectType())); + .object(const _$jni.JListType(_$jni.JObjectType())); } static final _id_getProviderInfo = _class.instanceMethodId( @@ -2156,98 +2329,106 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 r'(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;', ); - static final _getProviderInfo = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getProviderInfo = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject getProviderInfo( - jni.JObject resolveInfo, + _$jni.JObject getProviderInfo( + _$jni.JObject resolveInfo, ) { return _getProviderInfo( reference.pointer, - _id_getProviderInfo as jni.JMethodIDPtr, + _id_getProviderInfo as _$jni.JMethodIDPtr, resolveInfo.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type - extends jni +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type + extends _$jni .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19;'; - @override + @_$jni.internal + @_$core.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 fromReference( - jni.JReference reference) => + _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 .fromReference(reference); - @override - jni.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); - @override + @_$jni.internal + @_$core.override final superCount = 2; - @override + @_$core.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type) + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type) .hashCode; - @override + @_$core.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type) && + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type; + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 { - @override - late final jni + @_$jni.internal + @_$core.override + final _$jni .JObjType - $type = type; + $type; + @_$jni.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28'); /// The type which includes information such as the signature of this class. static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -2255,7 +2436,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 .fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -2264,152 +2445,171 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 r'(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/content/pm/Signature;', ); - static final _getSigningSignatures$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _getSigningSignatures$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - jni.JArray getSigningSignatures$1( - jni.JObject packageManager, - jni.JString string, + _$jni.JArray<_$jni.JObject> getSigningSignatures$1( + _$jni.JObject packageManager, + _$jni.JString string, ) { return _getSigningSignatures$1( reference.pointer, - _id_getSigningSignatures$1 as jni.JMethodIDPtr, + _id_getSigningSignatures$1 as _$jni.JMethodIDPtr, packageManager.reference.pointer, string.reference.pointer) - .object(const jni.JArrayType(jni.JObjectType())); + .object(const _$jni.JArrayType(_$jni.JObjectType())); } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type - extends jni +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type + extends _$jni .JObjType { - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28;'; - @override + @_$jni.internal + @_$core.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 fromReference( - jni.JReference reference) => + _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 .fromReference(reference); - @override - jni.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); - @override + @_$jni.internal + @_$core.override final superCount = 3; - @override + @_$core.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type) + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type) .hashCode; - @override + @_$core.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type) && + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type; + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig` -class DefaultEmojiCompatConfig extends jni.JObject { - @override - late final jni.JObjType $type = type; +class DefaultEmojiCompatConfig extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal DefaultEmojiCompatConfig.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'androidx/emoji2/text/DefaultEmojiCompatConfig'); + _$jni.JClass.forName(r'androidx/emoji2/text/DefaultEmojiCompatConfig'); /// The type which includes information such as the signature of this class. - static const type = $DefaultEmojiCompatConfigType(); + static const type = $DefaultEmojiCompatConfig$Type(); static final _id_create = _class.staticMethodId( r'create', r'(Landroid/content/Context;)Landroidx/emoji2/text/FontRequestEmojiCompatConfig;', ); - static final _create = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _create = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. - static jni.JObject create( - jni.JObject context, + static _$jni.JObject create( + _$jni.JObject context, ) { - return _create(_class.reference.pointer, _id_create as jni.JMethodIDPtr, + return _create(_class.reference.pointer, _id_create as _$jni.JMethodIDPtr, context.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } } -final class $DefaultEmojiCompatConfigType - extends jni.JObjType { - const $DefaultEmojiCompatConfigType(); +final class $DefaultEmojiCompatConfig$Type + extends _$jni.JObjType { + @_$jni.internal + const $DefaultEmojiCompatConfig$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig;'; - @override - DefaultEmojiCompatConfig fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + DefaultEmojiCompatConfig fromReference(_$jni.JReference reference) => DefaultEmojiCompatConfig.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($DefaultEmojiCompatConfigType).hashCode; + @_$core.override + int get hashCode => ($DefaultEmojiCompatConfig$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($DefaultEmojiCompatConfigType) && - other is $DefaultEmojiCompatConfigType; + return other.runtimeType == ($DefaultEmojiCompatConfig$Type) && + other is $DefaultEmojiCompatConfig$Type; } } /// from: `android.os.Build$Partition` -class Build_Partition extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Build_Partition extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Build_Partition.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName(r'android/os/Build$Partition'); + static final _class = _$jni.JClass.forName(r'android/os/Build$Partition'); /// The type which includes information such as the signature of this class. - static const type = $Build_PartitionType(); + static const type = $Build_Partition$Type(); static final _id_PARTITION_NAME_SYSTEM = _class.staticFieldId( r'PARTITION_NAME_SYSTEM', r'Ljava/lang/String;', @@ -2417,31 +2617,31 @@ class Build_Partition extends jni.JObject { /// from: `static public final java.lang.String PARTITION_NAME_SYSTEM` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get PARTITION_NAME_SYSTEM => - _id_PARTITION_NAME_SYSTEM.get(_class, const jni.JStringType()); + static _$jni.JString get PARTITION_NAME_SYSTEM => + _id_PARTITION_NAME_SYSTEM.get(_class, const _$jni.JStringType()); static final _id_getName = _class.instanceMethodId( r'getName', r'()Ljava/lang/String;', ); - static final _getName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getName()` /// The returned object must be released after use, by calling the [release] method. - jni.JString getName() { - return _getName(reference.pointer, _id_getName as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getName() { + return _getName(reference.pointer, _id_getName as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getFingerprint = _class.instanceMethodId( @@ -2449,24 +2649,24 @@ class Build_Partition extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getFingerprint = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFingerprint = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getFingerprint()` /// The returned object must be released after use, by calling the [release] method. - jni.JString getFingerprint() { + _$jni.JString getFingerprint() { return _getFingerprint( - reference.pointer, _id_getFingerprint as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getFingerprint as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getBuildTimeMillis = _class.instanceMethodId( @@ -2474,22 +2674,22 @@ class Build_Partition extends jni.JObject { r'()J', ); - static final _getBuildTimeMillis = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getBuildTimeMillis = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public long getBuildTimeMillis()` int getBuildTimeMillis() { return _getBuildTimeMillis( - reference.pointer, _id_getBuildTimeMillis as jni.JMethodIDPtr) + reference.pointer, _id_getBuildTimeMillis as _$jni.JMethodIDPtr) .long; } @@ -2498,22 +2698,22 @@ class Build_Partition extends jni.JObject { r'(Ljava/lang/Object;)Z', ); - static final _equals = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _equals = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean equals(java.lang.Object object)` bool equals( - jni.JObject object, + _$jni.JObject object, ) { - return _equals(reference.pointer, _id_equals as jni.JMethodIDPtr, + return _equals(reference.pointer, _id_equals as _$jni.JMethodIDPtr, object.reference.pointer) .boolean; } @@ -2523,64 +2723,72 @@ class Build_Partition extends jni.JObject { r'()I', ); - static final _hashCode$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _hashCode$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int hashCode()` int hashCode$1() { - return _hashCode$1(reference.pointer, _id_hashCode$1 as jni.JMethodIDPtr) + return _hashCode$1(reference.pointer, _id_hashCode$1 as _$jni.JMethodIDPtr) .integer; } } -final class $Build_PartitionType extends jni.JObjType { - const $Build_PartitionType(); +final class $Build_Partition$Type extends _$jni.JObjType { + @_$jni.internal + const $Build_Partition$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroid/os/Build$Partition;'; - @override - Build_Partition fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Build_Partition fromReference(_$jni.JReference reference) => Build_Partition.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Build_PartitionType).hashCode; + @_$core.override + int get hashCode => ($Build_Partition$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Build_PartitionType) && - other is $Build_PartitionType; + return other.runtimeType == ($Build_Partition$Type) && + other is $Build_Partition$Type; } } /// from: `android.os.Build$VERSION` -class Build_VERSION extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Build_VERSION extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Build_VERSION.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName(r'android/os/Build$VERSION'); + static final _class = _$jni.JClass.forName(r'android/os/Build$VERSION'); /// The type which includes information such as the signature of this class. - static const type = $Build_VERSIONType(); + static const type = $Build_VERSION$Type(); static final _id_BASE_OS = _class.staticFieldId( r'BASE_OS', r'Ljava/lang/String;', @@ -2588,8 +2796,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String BASE_OS` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BASE_OS => - _id_BASE_OS.get(_class, const jni.JStringType()); + static _$jni.JString get BASE_OS => + _id_BASE_OS.get(_class, const _$jni.JStringType()); static final _id_CODENAME = _class.staticFieldId( r'CODENAME', @@ -2598,8 +2806,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String CODENAME` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get CODENAME => - _id_CODENAME.get(_class, const jni.JStringType()); + static _$jni.JString get CODENAME => + _id_CODENAME.get(_class, const _$jni.JStringType()); static final _id_INCREMENTAL = _class.staticFieldId( r'INCREMENTAL', @@ -2608,8 +2816,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String INCREMENTAL` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get INCREMENTAL => - _id_INCREMENTAL.get(_class, const jni.JStringType()); + static _$jni.JString get INCREMENTAL => + _id_INCREMENTAL.get(_class, const _$jni.JStringType()); static final _id_MEDIA_PERFORMANCE_CLASS = _class.staticFieldId( r'MEDIA_PERFORMANCE_CLASS', @@ -2618,7 +2826,7 @@ class Build_VERSION extends jni.JObject { /// from: `static public final int MEDIA_PERFORMANCE_CLASS` static int get MEDIA_PERFORMANCE_CLASS => - _id_MEDIA_PERFORMANCE_CLASS.get(_class, const jni.jintType()); + _id_MEDIA_PERFORMANCE_CLASS.get(_class, const _$jni.jintType()); static final _id_PREVIEW_SDK_INT = _class.staticFieldId( r'PREVIEW_SDK_INT', @@ -2627,7 +2835,7 @@ class Build_VERSION extends jni.JObject { /// from: `static public final int PREVIEW_SDK_INT` static int get PREVIEW_SDK_INT => - _id_PREVIEW_SDK_INT.get(_class, const jni.jintType()); + _id_PREVIEW_SDK_INT.get(_class, const _$jni.jintType()); static final _id_RELEASE = _class.staticFieldId( r'RELEASE', @@ -2636,8 +2844,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String RELEASE` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get RELEASE => - _id_RELEASE.get(_class, const jni.JStringType()); + static _$jni.JString get RELEASE => + _id_RELEASE.get(_class, const _$jni.JStringType()); static final _id_RELEASE_OR_CODENAME = _class.staticFieldId( r'RELEASE_OR_CODENAME', @@ -2646,8 +2854,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String RELEASE_OR_CODENAME` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get RELEASE_OR_CODENAME => - _id_RELEASE_OR_CODENAME.get(_class, const jni.JStringType()); + static _$jni.JString get RELEASE_OR_CODENAME => + _id_RELEASE_OR_CODENAME.get(_class, const _$jni.JStringType()); static final _id_RELEASE_OR_PREVIEW_DISPLAY = _class.staticFieldId( r'RELEASE_OR_PREVIEW_DISPLAY', @@ -2656,8 +2864,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String RELEASE_OR_PREVIEW_DISPLAY` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get RELEASE_OR_PREVIEW_DISPLAY => - _id_RELEASE_OR_PREVIEW_DISPLAY.get(_class, const jni.JStringType()); + static _$jni.JString get RELEASE_OR_PREVIEW_DISPLAY => + _id_RELEASE_OR_PREVIEW_DISPLAY.get(_class, const _$jni.JStringType()); static final _id_SDK = _class.staticFieldId( r'SDK', @@ -2666,7 +2874,8 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String SDK` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SDK => _id_SDK.get(_class, const jni.JStringType()); + static _$jni.JString get SDK => + _id_SDK.get(_class, const _$jni.JStringType()); static final _id_SDK_INT = _class.staticFieldId( r'SDK_INT', @@ -2674,7 +2883,7 @@ class Build_VERSION extends jni.JObject { ); /// from: `static public final int SDK_INT` - static int get SDK_INT => _id_SDK_INT.get(_class, const jni.jintType()); + static int get SDK_INT => _id_SDK_INT.get(_class, const _$jni.jintType()); static final _id_SECURITY_PATCH = _class.staticFieldId( r'SECURITY_PATCH', @@ -2683,73 +2892,81 @@ class Build_VERSION extends jni.JObject { /// from: `static public final java.lang.String SECURITY_PATCH` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SECURITY_PATCH => - _id_SECURITY_PATCH.get(_class, const jni.JStringType()); + static _$jni.JString get SECURITY_PATCH => + _id_SECURITY_PATCH.get(_class, const _$jni.JStringType()); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION() { return Build_VERSION.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $Build_VERSIONType extends jni.JObjType { - const $Build_VERSIONType(); +final class $Build_VERSION$Type extends _$jni.JObjType { + @_$jni.internal + const $Build_VERSION$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroid/os/Build$VERSION;'; - @override - Build_VERSION fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Build_VERSION fromReference(_$jni.JReference reference) => Build_VERSION.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Build_VERSIONType).hashCode; + @_$core.override + int get hashCode => ($Build_VERSION$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Build_VERSIONType) && - other is $Build_VERSIONType; + return other.runtimeType == ($Build_VERSION$Type) && + other is $Build_VERSION$Type; } } /// from: `android.os.Build$VERSION_CODES` -class Build_VERSION_CODES extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Build_VERSION_CODES extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Build_VERSION_CODES.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName(r'android/os/Build$VERSION_CODES'); + static final _class = _$jni.JClass.forName(r'android/os/Build$VERSION_CODES'); /// The type which includes information such as the signature of this class. - static const type = $Build_VERSION_CODESType(); + static const type = $Build_VERSION_CODES$Type(); /// from: `static public final int BASE` static const BASE = 1; @@ -2855,70 +3072,82 @@ class Build_VERSION_CODES extends jni.JObject { /// from: `static public final int UPSIDE_DOWN_CAKE` static const UPSIDE_DOWN_CAKE = 34; + + /// from: `static public final int VANILLA_ICE_CREAM` + static const VANILLA_ICE_CREAM = 35; static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION_CODES() { return Build_VERSION_CODES.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $Build_VERSION_CODESType extends jni.JObjType { - const $Build_VERSION_CODESType(); +final class $Build_VERSION_CODES$Type + extends _$jni.JObjType { + @_$jni.internal + const $Build_VERSION_CODES$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroid/os/Build$VERSION_CODES;'; - @override - Build_VERSION_CODES fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Build_VERSION_CODES fromReference(_$jni.JReference reference) => Build_VERSION_CODES.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Build_VERSION_CODESType).hashCode; + @_$core.override + int get hashCode => ($Build_VERSION_CODES$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Build_VERSION_CODESType) && - other is $Build_VERSION_CODESType; + return other.runtimeType == ($Build_VERSION_CODES$Type) && + other is $Build_VERSION_CODES$Type; } } /// from: `android.os.Build` -class Build extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Build extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Build.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName(r'android/os/Build'); + static final _class = _$jni.JClass.forName(r'android/os/Build'); /// The type which includes information such as the signature of this class. - static const type = $BuildType(); + static const type = $Build$Type(); static final _id_BOARD = _class.staticFieldId( r'BOARD', r'Ljava/lang/String;', @@ -2926,8 +3155,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String BOARD` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BOARD => - _id_BOARD.get(_class, const jni.JStringType()); + static _$jni.JString get BOARD => + _id_BOARD.get(_class, const _$jni.JStringType()); static final _id_BOOTLOADER = _class.staticFieldId( r'BOOTLOADER', @@ -2936,8 +3165,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String BOOTLOADER` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BOOTLOADER => - _id_BOOTLOADER.get(_class, const jni.JStringType()); + static _$jni.JString get BOOTLOADER => + _id_BOOTLOADER.get(_class, const _$jni.JStringType()); static final _id_BRAND = _class.staticFieldId( r'BRAND', @@ -2946,8 +3175,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String BRAND` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get BRAND => - _id_BRAND.get(_class, const jni.JStringType()); + static _$jni.JString get BRAND => + _id_BRAND.get(_class, const _$jni.JStringType()); static final _id_CPU_ABI = _class.staticFieldId( r'CPU_ABI', @@ -2956,8 +3185,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String CPU_ABI` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get CPU_ABI => - _id_CPU_ABI.get(_class, const jni.JStringType()); + static _$jni.JString get CPU_ABI => + _id_CPU_ABI.get(_class, const _$jni.JStringType()); static final _id_CPU_ABI2 = _class.staticFieldId( r'CPU_ABI2', @@ -2966,8 +3195,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String CPU_ABI2` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get CPU_ABI2 => - _id_CPU_ABI2.get(_class, const jni.JStringType()); + static _$jni.JString get CPU_ABI2 => + _id_CPU_ABI2.get(_class, const _$jni.JStringType()); static final _id_DEVICE = _class.staticFieldId( r'DEVICE', @@ -2976,8 +3205,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String DEVICE` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get DEVICE => - _id_DEVICE.get(_class, const jni.JStringType()); + static _$jni.JString get DEVICE => + _id_DEVICE.get(_class, const _$jni.JStringType()); static final _id_DISPLAY = _class.staticFieldId( r'DISPLAY', @@ -2986,8 +3215,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String DISPLAY` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get DISPLAY => - _id_DISPLAY.get(_class, const jni.JStringType()); + static _$jni.JString get DISPLAY => + _id_DISPLAY.get(_class, const _$jni.JStringType()); static final _id_FINGERPRINT = _class.staticFieldId( r'FINGERPRINT', @@ -2996,8 +3225,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String FINGERPRINT` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get FINGERPRINT => - _id_FINGERPRINT.get(_class, const jni.JStringType()); + static _$jni.JString get FINGERPRINT => + _id_FINGERPRINT.get(_class, const _$jni.JStringType()); static final _id_HARDWARE = _class.staticFieldId( r'HARDWARE', @@ -3006,8 +3235,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String HARDWARE` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get HARDWARE => - _id_HARDWARE.get(_class, const jni.JStringType()); + static _$jni.JString get HARDWARE => + _id_HARDWARE.get(_class, const _$jni.JStringType()); static final _id_HOST = _class.staticFieldId( r'HOST', @@ -3016,7 +3245,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String HOST` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get HOST => _id_HOST.get(_class, const jni.JStringType()); + static _$jni.JString get HOST => + _id_HOST.get(_class, const _$jni.JStringType()); static final _id_ID = _class.staticFieldId( r'ID', @@ -3025,7 +3255,7 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String ID` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get ID => _id_ID.get(_class, const jni.JStringType()); + static _$jni.JString get ID => _id_ID.get(_class, const _$jni.JStringType()); static final _id_MANUFACTURER = _class.staticFieldId( r'MANUFACTURER', @@ -3034,8 +3264,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String MANUFACTURER` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get MANUFACTURER => - _id_MANUFACTURER.get(_class, const jni.JStringType()); + static _$jni.JString get MANUFACTURER => + _id_MANUFACTURER.get(_class, const _$jni.JStringType()); static final _id_MODEL = _class.staticFieldId( r'MODEL', @@ -3044,8 +3274,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String MODEL` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get MODEL => - _id_MODEL.get(_class, const jni.JStringType()); + static _$jni.JString get MODEL => + _id_MODEL.get(_class, const _$jni.JStringType()); static final _id_ODM_SKU = _class.staticFieldId( r'ODM_SKU', @@ -3054,8 +3284,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String ODM_SKU` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get ODM_SKU => - _id_ODM_SKU.get(_class, const jni.JStringType()); + static _$jni.JString get ODM_SKU => + _id_ODM_SKU.get(_class, const _$jni.JStringType()); static final _id_PRODUCT = _class.staticFieldId( r'PRODUCT', @@ -3064,8 +3294,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String PRODUCT` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get PRODUCT => - _id_PRODUCT.get(_class, const jni.JStringType()); + static _$jni.JString get PRODUCT => + _id_PRODUCT.get(_class, const _$jni.JStringType()); static final _id_RADIO = _class.staticFieldId( r'RADIO', @@ -3074,8 +3304,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String RADIO` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get RADIO => - _id_RADIO.get(_class, const jni.JStringType()); + static _$jni.JString get RADIO => + _id_RADIO.get(_class, const _$jni.JStringType()); static final _id_SERIAL = _class.staticFieldId( r'SERIAL', @@ -3084,8 +3314,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String SERIAL` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SERIAL => - _id_SERIAL.get(_class, const jni.JStringType()); + static _$jni.JString get SERIAL => + _id_SERIAL.get(_class, const _$jni.JStringType()); static final _id_SKU = _class.staticFieldId( r'SKU', @@ -3094,7 +3324,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String SKU` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SKU => _id_SKU.get(_class, const jni.JStringType()); + static _$jni.JString get SKU => + _id_SKU.get(_class, const _$jni.JStringType()); static final _id_SOC_MANUFACTURER = _class.staticFieldId( r'SOC_MANUFACTURER', @@ -3103,8 +3334,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String SOC_MANUFACTURER` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SOC_MANUFACTURER => - _id_SOC_MANUFACTURER.get(_class, const jni.JStringType()); + static _$jni.JString get SOC_MANUFACTURER => + _id_SOC_MANUFACTURER.get(_class, const _$jni.JStringType()); static final _id_SOC_MODEL = _class.staticFieldId( r'SOC_MODEL', @@ -3113,8 +3344,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String SOC_MODEL` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SOC_MODEL => - _id_SOC_MODEL.get(_class, const jni.JStringType()); + static _$jni.JString get SOC_MODEL => + _id_SOC_MODEL.get(_class, const _$jni.JStringType()); static final _id_SUPPORTED_32_BIT_ABIS = _class.staticFieldId( r'SUPPORTED_32_BIT_ABIS', @@ -3123,9 +3354,9 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_32_BIT_ABIS` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray get SUPPORTED_32_BIT_ABIS => + static _$jni.JArray<_$jni.JString> get SUPPORTED_32_BIT_ABIS => _id_SUPPORTED_32_BIT_ABIS.get( - _class, const jni.JArrayType(jni.JStringType())); + _class, const _$jni.JArrayType(_$jni.JStringType())); static final _id_SUPPORTED_64_BIT_ABIS = _class.staticFieldId( r'SUPPORTED_64_BIT_ABIS', @@ -3134,9 +3365,9 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_64_BIT_ABIS` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray get SUPPORTED_64_BIT_ABIS => + static _$jni.JArray<_$jni.JString> get SUPPORTED_64_BIT_ABIS => _id_SUPPORTED_64_BIT_ABIS.get( - _class, const jni.JArrayType(jni.JStringType())); + _class, const _$jni.JArrayType(_$jni.JStringType())); static final _id_SUPPORTED_ABIS = _class.staticFieldId( r'SUPPORTED_ABIS', @@ -3145,8 +3376,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_ABIS` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray get SUPPORTED_ABIS => - _id_SUPPORTED_ABIS.get(_class, const jni.JArrayType(jni.JStringType())); + static _$jni.JArray<_$jni.JString> get SUPPORTED_ABIS => _id_SUPPORTED_ABIS + .get(_class, const _$jni.JArrayType(_$jni.JStringType())); static final _id_TAGS = _class.staticFieldId( r'TAGS', @@ -3155,7 +3386,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String TAGS` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get TAGS => _id_TAGS.get(_class, const jni.JStringType()); + static _$jni.JString get TAGS => + _id_TAGS.get(_class, const _$jni.JStringType()); static final _id_TIME = _class.staticFieldId( r'TIME', @@ -3163,7 +3395,7 @@ class Build extends jni.JObject { ); /// from: `static public final long TIME` - static int get TIME => _id_TIME.get(_class, const jni.jlongType()); + static int get TIME => _id_TIME.get(_class, const _$jni.jlongType()); static final _id_TYPE = _class.staticFieldId( r'TYPE', @@ -3172,7 +3404,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String TYPE` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get TYPE => _id_TYPE.get(_class, const jni.JStringType()); + static _$jni.JString get TYPE => + _id_TYPE.get(_class, const _$jni.JStringType()); static final _id_UNKNOWN = _class.staticFieldId( r'UNKNOWN', @@ -3181,8 +3414,8 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String UNKNOWN` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get UNKNOWN => - _id_UNKNOWN.get(_class, const jni.JStringType()); + static _$jni.JString get UNKNOWN => + _id_UNKNOWN.get(_class, const _$jni.JStringType()); static final _id_USER = _class.staticFieldId( r'USER', @@ -3191,29 +3424,30 @@ class Build extends jni.JObject { /// from: `static public final java.lang.String USER` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get USER => _id_USER.get(_class, const jni.JStringType()); + static _$jni.JString get USER => + _id_USER.get(_class, const _$jni.JStringType()); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Build() { return Build.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -3222,24 +3456,24 @@ class Build extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getSerial = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSerial = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public java.lang.String getSerial()` /// The returned object must be released after use, by calling the [release] method. - static jni.JString getSerial() { + static _$jni.JString getSerial() { return _getSerial( - _class.reference.pointer, _id_getSerial as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _class.reference.pointer, _id_getSerial as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getFingerprintedPartitions = _class.staticMethodId( @@ -3247,24 +3481,25 @@ class Build extends jni.JObject { r'()Ljava/util/List;', ); - static final _getFingerprintedPartitions = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _getFingerprintedPartitions = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `static public java.util.List getFingerprintedPartitions()` /// The returned object must be released after use, by calling the [release] method. - static jni.JList getFingerprintedPartitions() { + static _$jni.JList getFingerprintedPartitions() { return _getFingerprintedPartitions(_class.reference.pointer, - _id_getFingerprintedPartitions as jni.JMethodIDPtr) - .object(const jni.JListType($Build_PartitionType())); + _id_getFingerprintedPartitions as _$jni.JMethodIDPtr) + .object(const _$jni.JListType($Build_Partition$Type())); } static final _id_getRadioVersion = _class.staticMethodId( @@ -3272,76 +3507,87 @@ class Build extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getRadioVersion = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getRadioVersion = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public java.lang.String getRadioVersion()` /// The returned object must be released after use, by calling the [release] method. - static jni.JString getRadioVersion() { + static _$jni.JString getRadioVersion() { return _getRadioVersion( - _class.reference.pointer, _id_getRadioVersion as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _class.reference.pointer, _id_getRadioVersion as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } } -final class $BuildType extends jni.JObjType { - const $BuildType(); +final class $Build$Type extends _$jni.JObjType { + @_$jni.internal + const $Build$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Landroid/os/Build;'; - @override - Build fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Build fromReference(_$jni.JReference reference) => Build.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($BuildType).hashCode; + @_$core.override + int get hashCode => ($Build$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($BuildType) && other is $BuildType; + return other.runtimeType == ($Build$Type) && other is $Build$Type; } } /// from: `java.util.HashMap` -class HashMap<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObject { - @override - late final jni.JObjType> $type = type(K, V); +class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$K> K; - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; + @_$jni.internal + final _$jni.JObjType<$V> V; + @_$jni.internal HashMap.fromReference( this.K, this.V, - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type(K, V), + super.fromReference(reference); - static final _class = jni.JClass.forName(r'java/util/HashMap'); + static final _class = _$jni.JClass.forName(r'java/util/HashMap'); /// The type which includes information such as the signature of this class. - static $HashMapType<$K, $V> - type<$K extends jni.JObject, $V extends jni.JObject>( - jni.JObjType<$K> K, - jni.JObjType<$V> V, + static $HashMap$Type<$K, $V> + type<$K extends _$jni.JObject, $V extends _$jni.JObject>( + _$jni.JObjType<$K> K, + _$jni.JObjType<$V> V, ) { - return $HashMapType( + return $HashMap$Type( K, V, ); @@ -3351,26 +3597,29 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(IF)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32, ffi.Double)>)>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32, _$jni.Double)>)>>( + 'globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, double)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, double)>(); /// from: `public void (int i, float f)` /// The returned object must be released after use, by calling the [release] method. factory HashMap( int i, double f, { - required jni.JObjType<$K> K, - required jni.JObjType<$V> V, + required _$jni.JObjType<$K> K, + required _$jni.JObjType<$V> V, }) { return HashMap.fromReference( K, V, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr, i, f) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, i, f) .reference); } @@ -3378,25 +3627,27 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(I)V', ); - static final _new$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_NewObject') + static final _new$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void (int i)` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$1( int i, { - required jni.JObjType<$K> K, - required jni.JObjType<$V> V, + required _$jni.JObjType<$K> K, + required _$jni.JObjType<$V> V, }) { return HashMap.fromReference( K, V, - _new$1(_class.reference.pointer, _id_new$1 as jni.JMethodIDPtr, i) + _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, i) .reference); } @@ -3404,28 +3655,28 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()V', ); - static final _new$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$2({ - required jni.JObjType<$K> K, - required jni.JObjType<$V> V, + required _$jni.JObjType<$K> K, + required _$jni.JObjType<$V> V, }) { return HashMap.fromReference( K, V, - _new$2(_class.reference.pointer, _id_new$2 as jni.JMethodIDPtr) + _new$2(_class.reference.pointer, _id_new$2 as _$jni.JMethodIDPtr) .reference); } @@ -3433,34 +3684,34 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/util/Map;)V', ); - static final _new$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$3( - jni.JMap<$K, $V> map, { - jni.JObjType<$K>? K, - jni.JObjType<$V>? V, + _$jni.JMap<$K, $V> map, { + _$jni.JObjType<$K>? K, + _$jni.JObjType<$V>? V, }) { - K ??= jni.lowestCommonSuperType([ - (map.$type as jni.JMapType).K, - ]) as jni.JObjType<$K>; - V ??= jni.lowestCommonSuperType([ - (map.$type as jni.JMapType).V, - ]) as jni.JObjType<$V>; + K ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType).K, + ]) as _$jni.JObjType<$K>; + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType).V, + ]) as _$jni.JObjType<$V>; return HashMap.fromReference( K, V, - _new$3(_class.reference.pointer, _id_new$3 as jni.JMethodIDPtr, + _new$3(_class.reference.pointer, _id_new$3 as _$jni.JMethodIDPtr, map.reference.pointer) .reference); } @@ -3470,21 +3721,21 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()I', ); - static final _size = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _size = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int size()` int size() { - return _size(reference.pointer, _id_size as jni.JMethodIDPtr).integer; + return _size(reference.pointer, _id_size as _$jni.JMethodIDPtr).integer; } static final _id_isEmpty = _class.instanceMethodId( @@ -3492,45 +3743,46 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()Z', ); - static final _isEmpty = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isEmpty = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean isEmpty()` bool isEmpty() { - return _isEmpty(reference.pointer, _id_isEmpty as jni.JMethodIDPtr).boolean; + return _isEmpty(reference.pointer, _id_isEmpty as _$jni.JMethodIDPtr) + .boolean; } - static final _id_get$ = _class.instanceMethodId( + static final _id_get = _class.instanceMethodId( r'get', r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _get$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _get = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public V get(java.lang.Object object)` /// The returned object must be released after use, by calling the [release] method. - $V get$( - jni.JObject object, + $V get( + _$jni.JObject object, ) { - return _get$(reference.pointer, _id_get$ as jni.JMethodIDPtr, + return _get(reference.pointer, _id_get as _$jni.JMethodIDPtr, object.reference.pointer) .object(V); } @@ -3540,23 +3792,23 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;)Z', ); - static final _containsKey = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _containsKey = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean containsKey(java.lang.Object object)` bool containsKey( - jni.JObject object, + _$jni.JObject object, ) { - return _containsKey(reference.pointer, _id_containsKey as jni.JMethodIDPtr, - object.reference.pointer) + return _containsKey(reference.pointer, + _id_containsKey as _$jni.JMethodIDPtr, object.reference.pointer) .boolean; } @@ -3565,19 +3817,22 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _put = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _put = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V put(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -3585,7 +3840,7 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, $V object1, ) { - return _put(reference.pointer, _id_put as jni.JMethodIDPtr, + return _put(reference.pointer, _id_put as _$jni.JMethodIDPtr, object.reference.pointer, object1.reference.pointer) .object(V); } @@ -3595,22 +3850,22 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/util/Map;)V', ); - static final _putAll = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _putAll = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void putAll(java.util.Map map)` void putAll( - jni.JMap<$K, $V> map, + _$jni.JMap<$K, $V> map, ) { - _putAll(reference.pointer, _id_putAll as jni.JMethodIDPtr, + _putAll(reference.pointer, _id_putAll as _$jni.JMethodIDPtr, map.reference.pointer) .check(); } @@ -3620,23 +3875,23 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _remove = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _remove = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public V remove(java.lang.Object object)` /// The returned object must be released after use, by calling the [release] method. $V remove( - jni.JObject object, + _$jni.JObject object, ) { - return _remove(reference.pointer, _id_remove as jni.JMethodIDPtr, + return _remove(reference.pointer, _id_remove as _$jni.JMethodIDPtr, object.reference.pointer) .object(V); } @@ -3646,21 +3901,21 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()V', ); - static final _clear = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _clear = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void clear()` void clear() { - _clear(reference.pointer, _id_clear as jni.JMethodIDPtr).check(); + _clear(reference.pointer, _id_clear as _$jni.JMethodIDPtr).check(); } static final _id_containsValue = _class.instanceMethodId( @@ -3668,23 +3923,23 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;)Z', ); - static final _containsValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _containsValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean containsValue(java.lang.Object object)` bool containsValue( - jni.JObject object, + _$jni.JObject object, ) { return _containsValue(reference.pointer, - _id_containsValue as jni.JMethodIDPtr, object.reference.pointer) + _id_containsValue as _$jni.JMethodIDPtr, object.reference.pointer) .boolean; } @@ -3693,23 +3948,23 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()Ljava/util/Set;', ); - static final _keySet = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _keySet = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Set keySet()` /// The returned object must be released after use, by calling the [release] method. - jni.JSet<$K> keySet() { - return _keySet(reference.pointer, _id_keySet as jni.JMethodIDPtr) - .object(jni.JSetType(K)); + _$jni.JSet<$K> keySet() { + return _keySet(reference.pointer, _id_keySet as _$jni.JMethodIDPtr) + .object(_$jni.JSetType(K)); } static final _id_values = _class.instanceMethodId( @@ -3717,23 +3972,23 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()Ljava/util/Collection;', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Collection values()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject values() { - return _values(reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject values() { + return _values(reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_entrySet = _class.instanceMethodId( @@ -3741,23 +3996,23 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()Ljava/util/Set;', ); - static final _entrySet = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _entrySet = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Set entrySet()` /// The returned object must be released after use, by calling the [release] method. - jni.JSet entrySet() { - return _entrySet(reference.pointer, _id_entrySet as jni.JMethodIDPtr) - .object(const jni.JSetType(jni.JObjectType())); + _$jni.JSet<_$jni.JObject> entrySet() { + return _entrySet(reference.pointer, _id_entrySet as _$jni.JMethodIDPtr) + .object(const _$jni.JSetType(_$jni.JObjectType())); } static final _id_getOrDefault = _class.instanceMethodId( @@ -3765,29 +4020,32 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _getOrDefault = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _getOrDefault = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V getOrDefault(java.lang.Object object, V object1)` /// The returned object must be released after use, by calling the [release] method. $V getOrDefault( - jni.JObject object, + _$jni.JObject object, $V object1, ) { return _getOrDefault( reference.pointer, - _id_getOrDefault as jni.JMethodIDPtr, + _id_getOrDefault as _$jni.JMethodIDPtr, object.reference.pointer, object1.reference.pointer) .object(V); @@ -3798,19 +4056,22 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _putIfAbsent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _putIfAbsent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V putIfAbsent(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -3818,8 +4079,11 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, $V object1, ) { - return _putIfAbsent(reference.pointer, _id_putIfAbsent as jni.JMethodIDPtr, - object.reference.pointer, object1.reference.pointer) + return _putIfAbsent( + reference.pointer, + _id_putIfAbsent as _$jni.JMethodIDPtr, + object.reference.pointer, + object1.reference.pointer) .object(V); } @@ -3828,26 +4092,29 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;)Z', ); - static final _remove$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _remove$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean remove(java.lang.Object object, java.lang.Object object1)` bool remove$1( - jni.JObject object, - jni.JObject object1, + _$jni.JObject object, + _$jni.JObject object1, ) { - return _remove$1(reference.pointer, _id_remove$1 as jni.JMethodIDPtr, + return _remove$1(reference.pointer, _id_remove$1 as _$jni.JMethodIDPtr, object.reference.pointer, object1.reference.pointer) .boolean; } @@ -3857,24 +4124,24 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z', ); - static final _replace = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _replace = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean replace(K object, V object1, V object2)` bool replace( @@ -3884,7 +4151,7 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> ) { return _replace( reference.pointer, - _id_replace as jni.JMethodIDPtr, + _id_replace as _$jni.JMethodIDPtr, object.reference.pointer, object1.reference.pointer, object2.reference.pointer) @@ -3896,19 +4163,22 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _replace$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _replace$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V replace(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -3916,7 +4186,7 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> $K object, $V object1, ) { - return _replace$1(reference.pointer, _id_replace$1 as jni.JMethodIDPtr, + return _replace$1(reference.pointer, _id_replace$1 as _$jni.JMethodIDPtr, object.reference.pointer, object1.reference.pointer) .object(V); } @@ -3926,29 +4196,32 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;', ); - static final _computeIfAbsent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _computeIfAbsent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V computeIfAbsent(K object, java.util.function.Function function)` /// The returned object must be released after use, by calling the [release] method. $V computeIfAbsent( $K object, - jni.JObject function, + _$jni.JObject function, ) { return _computeIfAbsent( reference.pointer, - _id_computeIfAbsent as jni.JMethodIDPtr, + _id_computeIfAbsent as _$jni.JMethodIDPtr, object.reference.pointer, function.reference.pointer) .object(V); @@ -3959,29 +4232,32 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;', ); - static final _computeIfPresent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _computeIfPresent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V computeIfPresent(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V computeIfPresent( $K object, - jni.JObject biFunction, + _$jni.JObject biFunction, ) { return _computeIfPresent( reference.pointer, - _id_computeIfPresent as jni.JMethodIDPtr, + _id_computeIfPresent as _$jni.JMethodIDPtr, object.reference.pointer, biFunction.reference.pointer) .object(V); @@ -3992,27 +4268,30 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;', ); - static final _compute = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _compute = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V compute(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V compute( $K object, - jni.JObject biFunction, + _$jni.JObject biFunction, ) { - return _compute(reference.pointer, _id_compute as jni.JMethodIDPtr, + return _compute(reference.pointer, _id_compute as _$jni.JMethodIDPtr, object.reference.pointer, biFunction.reference.pointer) .object(V); } @@ -4022,35 +4301,35 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;', ); - static final _merge = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _merge = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public V merge(K object, V object1, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V merge( $K object, $V object1, - jni.JObject biFunction, + _$jni.JObject biFunction, ) { return _merge( reference.pointer, - _id_merge as jni.JMethodIDPtr, + _id_merge as _$jni.JMethodIDPtr, object.reference.pointer, object1.reference.pointer, biFunction.reference.pointer) @@ -4062,22 +4341,22 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/util/function/BiConsumer;)V', ); - static final _forEach = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _forEach = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void forEach(java.util.function.BiConsumer biConsumer)` void forEach( - jni.JObject biConsumer, + _$jni.JObject biConsumer, ) { - _forEach(reference.pointer, _id_forEach as jni.JMethodIDPtr, + _forEach(reference.pointer, _id_forEach as _$jni.JMethodIDPtr, biConsumer.reference.pointer) .check(); } @@ -4087,22 +4366,22 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'(Ljava/util/function/BiFunction;)V', ); - static final _replaceAll = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _replaceAll = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void replaceAll(java.util.function.BiFunction biFunction)` void replaceAll( - jni.JObject biFunction, + _$jni.JObject biFunction, ) { - _replaceAll(reference.pointer, _id_replaceAll as jni.JMethodIDPtr, + _replaceAll(reference.pointer, _id_replaceAll as _$jni.JMethodIDPtr, biFunction.reference.pointer) .check(); } @@ -4112,129 +4391,176 @@ class HashMap<$K extends jni.JObject, $V extends jni.JObject> r'()Ljava/lang/Object;', ); - static final _clone = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _clone = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object clone()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject clone() { - return _clone(reference.pointer, _id_clone as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject clone() { + return _clone(reference.pointer, _id_clone as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); + } + + static final _id_newHashMap = _class.staticMethodId( + r'newHashMap', + r'(I)Ljava/util/HashMap;', + ); + + static final _newHashMap = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `static public java.util.HashMap newHashMap(int i)` + /// The returned object must be released after use, by calling the [release] method. + static HashMap<$K, $V> + newHashMap<$K extends _$jni.JObject, $V extends _$jni.JObject>( + int i, { + required _$jni.JObjType<$K> K, + required _$jni.JObjType<$V> V, + }) { + return _newHashMap( + _class.reference.pointer, _id_newHashMap as _$jni.JMethodIDPtr, i) + .object($HashMap$Type(K, V)); } } -final class $HashMapType<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; +final class $HashMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; - const $HashMapType( + @_$jni.internal + const $HashMap$Type( this.K, this.V, ); - @override + @_$jni.internal + @_$core.override String get signature => r'Ljava/util/HashMap;'; - @override - HashMap<$K, $V> fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + HashMap<$K, $V> fromReference(_$jni.JReference reference) => HashMap.fromReference(K, V, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($HashMapType, K, V); + @_$core.override + int get hashCode => Object.hash($HashMap$Type, K, V); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($HashMapType<$K, $V>) && - other is $HashMapType<$K, $V> && + return other.runtimeType == ($HashMap$Type<$K, $V>) && + other is $HashMap$Type<$K, $V> && K == other.K && V == other.V; } } /// from: `com.example.in_app_java.AndroidUtils` -class AndroidUtils extends jni.JObject { - @override - late final jni.JObjType $type = type; +class AndroidUtils extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal AndroidUtils.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/example/in_app_java/AndroidUtils'); + _$jni.JClass.forName(r'com/example/in_app_java/AndroidUtils'); /// The type which includes information such as the signature of this class. - static const type = $AndroidUtilsType(); + static const type = $AndroidUtils$Type(); static final _id_showToast = _class.staticMethodId( r'showToast', r'(Landroid/app/Activity;Ljava/lang/CharSequence;I)V', ); - static final _showToast = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _showToast = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - $Int32 + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Int32 )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + 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, + _$jni.JObject mainActivity, + _$jni.JObject text, int duration, ) { - _showToast(_class.reference.pointer, _id_showToast as jni.JMethodIDPtr, + _showToast(_class.reference.pointer, _id_showToast as _$jni.JMethodIDPtr, mainActivity.reference.pointer, text.reference.pointer, duration) .check(); } } -final class $AndroidUtilsType extends jni.JObjType { - const $AndroidUtilsType(); +final class $AndroidUtils$Type extends _$jni.JObjType { + @_$jni.internal + const $AndroidUtils$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/example/in_app_java/AndroidUtils;'; - @override - AndroidUtils fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + AndroidUtils fromReference(_$jni.JReference reference) => AndroidUtils.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($AndroidUtilsType).hashCode; + @_$core.override + int get hashCode => ($AndroidUtils$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($AndroidUtilsType) && - other is $AndroidUtilsType; + return other.runtimeType == ($AndroidUtils$Type) && + other is $AndroidUtils$Type; } } diff --git a/pkgs/jnigen/example/in_app_java/lib/main.dart b/pkgs/jnigen/example/in_app_java/lib/main.dart index c913918a1..3f3cdcab6 100644 --- a/pkgs/jnigen/example/in_app_java/lib/main.dart +++ b/pkgs/jnigen/example/in_app_java/lib/main.dart @@ -14,7 +14,7 @@ JObject context = JObject.fromReference(Jni.getCachedApplicationContext()); final hashmap = HashMap.new$2(K: JString.type, V: JString.type); -final emojiCompat = EmojiCompat.get$(); +final emojiCompat = EmojiCompat.get(); extension IntX on int { JString toJString() { diff --git a/pkgs/jnigen/example/kotlin_plugin/android/build.gradle b/pkgs/jnigen/example/kotlin_plugin/android/build.gradle index 04bce9b0c..3393b9fbe 100644 --- a/pkgs/jnigen/example/kotlin_plugin/android/build.gradle +++ b/pkgs/jnigen/example/kotlin_plugin/android/build.gradle @@ -14,6 +14,8 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.example.kotlin_plugin' + // Bumping the plugin compileSdkVersion requires all clients of this plugin // to bump the version in their app. compileSdkVersion 31 diff --git a/pkgs/jnigen/example/kotlin_plugin/example/android/app/build.gradle b/pkgs/jnigen/example/kotlin_plugin/example/android/app/build.gradle index 542a2d4bb..355a12ad8 100644 --- a/pkgs/jnigen/example/kotlin_plugin/example/android/app/build.gradle +++ b/pkgs/jnigen/example/kotlin_plugin/example/android/app/build.gradle @@ -23,7 +23,9 @@ if (flutterVersionName == null) { } android { - compileSdkVersion flutter.compileSdkVersion + namespace "com.example.kotlin_plugin.example" + + compileSdkVersion 35 ndkVersion flutter.ndkVersion compileOptions { @@ -40,7 +42,6 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.kotlin_plugin.example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. diff --git a/pkgs/jnigen/example/kotlin_plugin/example/android/gradle/wrapper/gradle-wrapper.properties b/pkgs/jnigen/example/kotlin_plugin/example/android/gradle/wrapper/gradle-wrapper.properties index 3c472b99c..3c85cfe05 100644 --- a/pkgs/jnigen/example/kotlin_plugin/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/pkgs/jnigen/example/kotlin_plugin/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/pkgs/jnigen/example/kotlin_plugin/example/android/settings.gradle b/pkgs/jnigen/example/kotlin_plugin/example/android/settings.gradle index 536165d35..03e70fe44 100644 --- a/pkgs/jnigen/example/kotlin_plugin/example/android/settings.gradle +++ b/pkgs/jnigen/example/kotlin_plugin/example/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.6.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index 02d02f367..5c3c341ad 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart @@ -7,12 +7,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -22,46 +27,49 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; /// from: `Example` -class Example extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Example extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Example.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName(r'Example'); + static final _class = _$jni.JClass.forName(r'Example'); /// The type which includes information such as the signature of this class. - static const type = $ExampleType(); + static const type = $Example$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -70,56 +78,64 @@ class Example extends jni.JObject { r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;', ); - static final _thinkBeforeAnswering = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _thinkBeforeAnswering = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - Future thinkBeforeAnswering() async { - final $p = ReceivePort(); - final $c = jni.JObject.fromReference( - ProtectedJniExtensions.newPortContinuation($p)); - _thinkBeforeAnswering(reference.pointer, - _id_thinkBeforeAnswering as jni.JMethodIDPtr, $c.reference.pointer) - .object(const jni.JObjectType()); - final $o = jni.JGlobalReference(jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const jni.JStringType().jClass.reference.pointer; - if (!jni.Jni.env.IsInstanceOf($o.pointer, $k)) { + _$core.Future<_$jni.JString> thinkBeforeAnswering() async { + final $p = _$jni.ReceivePort(); + final $c = _$jni.JObject.fromReference( + _$jni.ProtectedJniExtensions.newPortContinuation($p)); + _thinkBeforeAnswering( + reference.pointer, + _id_thinkBeforeAnswering as _$jni.JMethodIDPtr, + $c.reference.pointer) + .object(const _$jni.JObjectType()); + final $o = + _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); + final $k = const _$jni.JStringType().jClass.reference.pointer; + if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k)) { throw 'Failed'; } - return const jni.JStringType().fromReference($o); + return const _$jni.JStringType().fromReference($o); } } -final class $ExampleType extends jni.JObjType { - const $ExampleType(); +final class $Example$Type extends _$jni.JObjType { + @_$jni.internal + const $Example$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'LExample;'; - @override - Example fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Example fromReference(_$jni.JReference reference) => Example.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($ExampleType).hashCode; + @_$core.override + int get hashCode => ($Example$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($ExampleType) && other is $ExampleType; + return other.runtimeType == ($Example$Type) && other is $Example$Type; } } diff --git a/pkgs/jnigen/example/notification_plugin/android/build.gradle b/pkgs/jnigen/example/notification_plugin/android/build.gradle index fd63c0d8a..763c15ec3 100644 --- a/pkgs/jnigen/example/notification_plugin/android/build.gradle +++ b/pkgs/jnigen/example/notification_plugin/android/build.gradle @@ -13,6 +13,8 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'com.example.notification_plugin' + // Bumping the plugin compileSdkVersion requires all clients of this plugin // to bump the version in their app. compileSdkVersion 31 diff --git a/pkgs/jnigen/example/notification_plugin/example/android/app/build.gradle b/pkgs/jnigen/example/notification_plugin/example/android/app/build.gradle index a8c8103ab..3491cecc5 100644 --- a/pkgs/jnigen/example/notification_plugin/example/android/app/build.gradle +++ b/pkgs/jnigen/example/notification_plugin/example/android/app/build.gradle @@ -23,7 +23,9 @@ if (flutterVersionName == null) { } android { - compileSdkVersion flutter.compileSdkVersion + namespace "com.example.notification_plugin_example" + + compileSdkVersion 35 ndkVersion flutter.ndkVersion compileOptions { @@ -40,7 +42,6 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.notification_plugin_example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. diff --git a/pkgs/jnigen/example/notification_plugin/example/android/gradle/wrapper/gradle-wrapper.properties b/pkgs/jnigen/example/notification_plugin/example/android/gradle/wrapper/gradle-wrapper.properties index cb24abda1..3c85cfe05 100644 --- a/pkgs/jnigen/example/notification_plugin/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/pkgs/jnigen/example/notification_plugin/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/pkgs/jnigen/example/notification_plugin/example/android/settings.gradle b/pkgs/jnigen/example/notification_plugin/example/android/settings.gradle index 536165d35..03e70fe44 100644 --- a/pkgs/jnigen/example/notification_plugin/example/android/settings.gradle +++ b/pkgs/jnigen/example/notification_plugin/example/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.6.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index 88d30a39f..d0d788d94 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart @@ -11,12 +11,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -26,47 +31,50 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; /// from: `com.example.notification_plugin.Notifications` -class Notifications extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Notifications extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Notifications.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/example/notification_plugin/Notifications'); + _$jni.JClass.forName(r'com/example/notification_plugin/Notifications'); /// The type which includes information such as the signature of this class. - static const type = $NotificationsType(); + static const type = $Notifications$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Notifications() { return Notifications.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -75,37 +83,37 @@ class Notifications extends jni.JObject { r'(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V', ); - static final _showNotification = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _showNotification = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - $Int32, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, int, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public void showNotification(android.content.Context context, int notificationID, java.lang.String title, java.lang.String text)` static void showNotification( - jni.JObject context, + _$jni.JObject context, int notificationID, - jni.JString title, - jni.JString text, + _$jni.JString title, + _$jni.JString text, ) { _showNotification( _class.reference.pointer, - _id_showNotification as jni.JMethodIDPtr, + _id_showNotification as _$jni.JMethodIDPtr, context.reference.pointer, notificationID, title.reference.pointer, @@ -114,28 +122,33 @@ class Notifications extends jni.JObject { } } -final class $NotificationsType extends jni.JObjType { - const $NotificationsType(); +final class $Notifications$Type extends _$jni.JObjType { + @_$jni.internal + const $Notifications$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/example/notification_plugin/Notifications;'; - @override - Notifications fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Notifications fromReference(_$jni.JReference reference) => Notifications.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($NotificationsType).hashCode; + @_$core.override + int get hashCode => ($Notifications$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($NotificationsType) && - other is $NotificationsType; + return other.runtimeType == ($Notifications$Type) && + other is $Notifications$Type; } } diff --git a/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle b/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle index 6ea97b832..d7c4919c0 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle +++ b/pkgs/jnigen/example/pdfbox_plugin/android/build.gradle @@ -13,6 +13,8 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'com.example.pdfbox_plugin' + // Bumping the plugin compileSdkVersion requires all clients of this plugin // to bump the version in their app. compileSdkVersion 31 diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/android/app/build.gradle b/pkgs/jnigen/example/pdfbox_plugin/example/android/app/build.gradle index ec6579a75..b1e71c460 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/example/android/app/build.gradle +++ b/pkgs/jnigen/example/pdfbox_plugin/example/android/app/build.gradle @@ -23,7 +23,9 @@ if (flutterVersionName == null) { } android { - compileSdkVersion flutter.compileSdkVersion + namespace "com.example.pdfbox_plugin_example" + + compileSdkVersion 35 ndkVersion flutter.ndkVersion compileOptions { @@ -40,7 +42,6 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.pdfbox_plugin_example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/android/gradle/wrapper/gradle-wrapper.properties b/pkgs/jnigen/example/pdfbox_plugin/example/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..7aeeb11c6 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/pkgs/jnigen/example/pdfbox_plugin/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/android/settings.gradle b/pkgs/jnigen/example/pdfbox_plugin/example/android/settings.gradle index 536165d35..03e70fe44 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/example/android/settings.gradle +++ b/pkgs/jnigen/example/pdfbox_plugin/example/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.6.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart index 80941a807..52fb69d27 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart @@ -158,7 +158,7 @@ class PDFFileInfo { /// Converts JString to dart string and deletes the original. /// Also handles the case where the underlying string is Null. String _fromJavaStr(JString jstr) { - if (jstr.reference.pointer == nullptr) { + if (jstr.isNull) { return '(null)'; } return jstr.toDartString(releaseOriginal: true); diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart index bd8260bda..5570187f8 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart @@ -25,12 +25,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -40,11 +45,11 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; import 'PDDocumentInformation.dart' as pddocumentinformation_; @@ -53,33 +58,36 @@ import 'PDDocumentInformation.dart' as pddocumentinformation_; /// This is the in-memory representation of the PDF document. /// The \#close() method must be called once the document is no longer needed. ///@author Ben Litchfield -class PDDocument extends jni.JObject { - @override - late final jni.JObjType $type = type; +class PDDocument extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal PDDocument.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocument'); + _$jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocument'); /// The type which includes information such as the signature of this class. - static const type = $PDDocumentType(); + static const type = $PDDocument$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -89,7 +97,7 @@ class PDDocument extends jni.JObject { /// You need to add at least one page for the document to be valid. factory PDDocument() { return PDDocument.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -97,16 +105,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/io/MemoryUsageSetting;)V', ); - static final _new$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -115,10 +123,10 @@ class PDDocument extends jni.JObject { /// You need to add at least one page for the document to be valid. ///@param memUsageSetting defines how memory is used for buffering PDF streams factory PDDocument.new$1( - jni.JObject memUsageSetting, + _$jni.JObject memUsageSetting, ) { return PDDocument.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as jni.JMethodIDPtr, memUsageSetting.reference.pointer) + _id_new$1 as _$jni.JMethodIDPtr, memUsageSetting.reference.pointer) .reference); } @@ -126,16 +134,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDocument;)V', ); - static final _new$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (org.apache.pdfbox.cos.COSDocument doc)` /// The returned object must be released after use, by calling the [release] method. @@ -143,10 +151,10 @@ class PDDocument extends jni.JObject { /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. factory PDDocument.new$2( - jni.JObject doc, + _$jni.JObject doc, ) { return PDDocument.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as jni.JMethodIDPtr, doc.reference.pointer) + _id_new$2 as _$jni.JMethodIDPtr, doc.reference.pointer) .reference); } @@ -154,19 +162,22 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/RandomAccessRead;)V', ); - static final _new$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _new$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source)` /// The returned object must be released after use, by calling the [release] method. @@ -175,12 +186,12 @@ class PDDocument extends jni.JObject { ///@param doc The COSDocument that this document wraps. ///@param source the parser which is used to read the pdf factory PDDocument.new$3( - jni.JObject doc, - jni.JObject source, + _$jni.JObject doc, + _$jni.JObject source, ) { return PDDocument.fromReference(_new$3( _class.reference.pointer, - _id_new$3 as jni.JMethodIDPtr, + _id_new$3 as _$jni.JMethodIDPtr, doc.reference.pointer, source.reference.pointer) .reference); @@ -190,24 +201,24 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/RandomAccessRead;Lorg/apache/pdfbox/pdmodel/encryption/AccessPermission;)V', ); - static final _new$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _new$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source, org.apache.pdfbox.pdmodel.encryption.AccessPermission permission)` /// The returned object must be released after use, by calling the [release] method. @@ -217,13 +228,13 @@ class PDDocument extends jni.JObject { ///@param source the parser which is used to read the pdf ///@param permission he access permissions of the pdf factory PDDocument.new$4( - jni.JObject doc, - jni.JObject source, - jni.JObject permission, + _$jni.JObject doc, + _$jni.JObject source, + _$jni.JObject permission, ) { return PDDocument.fromReference(_new$4( _class.reference.pointer, - _id_new$4 as jni.JMethodIDPtr, + _id_new$4 as _$jni.JMethodIDPtr, doc.reference.pointer, source.reference.pointer, permission.reference.pointer) @@ -235,16 +246,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)V', ); - static final _addPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _addPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void addPage(org.apache.pdfbox.pdmodel.PDPage page)` /// @@ -252,9 +263,9 @@ class PDDocument extends jni.JObject { /// hierarchy and set the parent of the page to the root. ///@param page The page to add to the document. void addPage( - jni.JObject page, + _$jni.JObject page, ) { - _addPage(reference.pointer, _id_addPage as jni.JMethodIDPtr, + _addPage(reference.pointer, _id_addPage as _$jni.JMethodIDPtr, page.reference.pointer) .check(); } @@ -264,16 +275,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;)V', ); - static final _addSignature = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _addSignature = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject)` /// @@ -288,9 +299,9 @@ class PDDocument extends jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature( - jni.JObject sigObject, + _$jni.JObject sigObject, ) { - _addSignature(reference.pointer, _id_addSignature as jni.JMethodIDPtr, + _addSignature(reference.pointer, _id_addSignature as _$jni.JMethodIDPtr, sigObject.reference.pointer) .check(); } @@ -300,19 +311,22 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V', ); - static final _addSignature$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _addSignature$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options)` /// @@ -328,10 +342,10 @@ class PDDocument extends jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$1( - jni.JObject sigObject, - jni.JObject options, + _$jni.JObject sigObject, + _$jni.JObject options, ) { - _addSignature$1(reference.pointer, _id_addSignature$1 as jni.JMethodIDPtr, + _addSignature$1(reference.pointer, _id_addSignature$1 as _$jni.JMethodIDPtr, sigObject.reference.pointer, options.reference.pointer) .check(); } @@ -341,19 +355,22 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;)V', ); - static final _addSignature$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _addSignature$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface)` /// @@ -368,10 +385,10 @@ class PDDocument extends jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$2( - jni.JObject sigObject, - jni.JObject signatureInterface, + _$jni.JObject sigObject, + _$jni.JObject signatureInterface, ) { - _addSignature$2(reference.pointer, _id_addSignature$2 as jni.JMethodIDPtr, + _addSignature$2(reference.pointer, _id_addSignature$2 as _$jni.JMethodIDPtr, sigObject.reference.pointer, signatureInterface.reference.pointer) .check(); } @@ -381,24 +398,24 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V', ); - static final _addSignature$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _addSignature$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options)` /// @@ -416,13 +433,13 @@ class PDDocument extends jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$3( - jni.JObject sigObject, - jni.JObject signatureInterface, - jni.JObject options, + _$jni.JObject sigObject, + _$jni.JObject signatureInterface, + _$jni.JObject options, ) { _addSignature$3( reference.pointer, - _id_addSignature$3 as jni.JMethodIDPtr, + _id_addSignature$3 as _$jni.JMethodIDPtr, sigObject.reference.pointer, signatureInterface.reference.pointer, options.reference.pointer) @@ -434,24 +451,24 @@ class PDDocument extends jni.JObject { r'(Ljava/util/List;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V', ); - static final _addSignatureField = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _addSignatureField = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void addSignatureField(java.util.List sigFields, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options)` /// @@ -464,13 +481,13 @@ class PDDocument extends jni.JObject { ///@deprecated The method is misleading, because only one signature may be /// added in a document. The method will be removed in the future. void addSignatureField( - jni.JList sigFields, - jni.JObject signatureInterface, - jni.JObject options, + _$jni.JList<_$jni.JObject> sigFields, + _$jni.JObject signatureInterface, + _$jni.JObject options, ) { _addSignatureField( reference.pointer, - _id_addSignatureField as jni.JMethodIDPtr, + _id_addSignatureField as _$jni.JMethodIDPtr, sigFields.reference.pointer, signatureInterface.reference.pointer, options.reference.pointer) @@ -482,25 +499,25 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)V', ); - static final _removePage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _removePage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void removePage(org.apache.pdfbox.pdmodel.PDPage page)` /// /// Remove the page from the document. ///@param page The page to remove from the document. void removePage( - jni.JObject page, + _$jni.JObject page, ) { - _removePage(reference.pointer, _id_removePage as jni.JMethodIDPtr, + _removePage(reference.pointer, _id_removePage as _$jni.JMethodIDPtr, page.reference.pointer) .check(); } @@ -510,15 +527,15 @@ class PDDocument extends jni.JObject { r'(I)V', ); - static final _removePage$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _removePage$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void removePage(int pageNumber)` /// @@ -527,8 +544,8 @@ class PDDocument extends jni.JObject { void removePage$1( int pageNumber, ) { - _removePage$1( - reference.pointer, _id_removePage$1 as jni.JMethodIDPtr, pageNumber) + _removePage$1(reference.pointer, _id_removePage$1 as _$jni.JMethodIDPtr, + pageNumber) .check(); } @@ -537,16 +554,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)Lorg/apache/pdfbox/pdmodel/PDPage;', ); - static final _importPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _importPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public org.apache.pdfbox.pdmodel.PDPage importPage(org.apache.pdfbox.pdmodel.PDPage page)` /// The returned object must be released after use, by calling the [release] method. @@ -572,12 +589,12 @@ class PDDocument extends jni.JObject { ///@param page The page to import. ///@return The page that was imported. ///@throws IOException If there is an error copying the page. - jni.JObject importPage( - jni.JObject page, + _$jni.JObject importPage( + _$jni.JObject page, ) { - return _importPage(reference.pointer, _id_importPage as jni.JMethodIDPtr, + return _importPage(reference.pointer, _id_importPage as _$jni.JMethodIDPtr, page.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_getDocument = _class.instanceMethodId( @@ -585,16 +602,16 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/cos/COSDocument;', ); - static final _getDocument = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDocument = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.cos.COSDocument getDocument()` @@ -602,9 +619,10 @@ class PDDocument extends jni.JObject { /// /// This will get the low level document. ///@return The document that this layer sits on top of. - jni.JObject getDocument() { - return _getDocument(reference.pointer, _id_getDocument as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getDocument() { + return _getDocument( + reference.pointer, _id_getDocument as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getDocumentInformation = _class.instanceMethodId( @@ -612,16 +630,16 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;', ); - static final _getDocumentInformation = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDocumentInformation = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.PDDocumentInformation getDocumentInformation()` @@ -636,8 +654,8 @@ class PDDocument extends jni.JObject { ///@return The documents /Info dictionary, never null. pddocumentinformation_.PDDocumentInformation getDocumentInformation() { return _getDocumentInformation( - reference.pointer, _id_getDocumentInformation as jni.JMethodIDPtr) - .object(const pddocumentinformation_.$PDDocumentInformationType()); + reference.pointer, _id_getDocumentInformation as _$jni.JMethodIDPtr) + .object(const pddocumentinformation_.$PDDocumentInformation$Type()); } static final _id_setDocumentInformation = _class.instanceMethodId( @@ -645,16 +663,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;)V', ); - static final _setDocumentInformation = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setDocumentInformation = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setDocumentInformation(org.apache.pdfbox.pdmodel.PDDocumentInformation info)` /// @@ -669,7 +687,7 @@ class PDDocument extends jni.JObject { ) { _setDocumentInformation( reference.pointer, - _id_setDocumentInformation as jni.JMethodIDPtr, + _id_setDocumentInformation as _$jni.JMethodIDPtr, info.reference.pointer) .check(); } @@ -679,16 +697,16 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/PDDocumentCatalog;', ); - static final _getDocumentCatalog = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDocumentCatalog = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.PDDocumentCatalog getDocumentCatalog()` @@ -696,10 +714,10 @@ class PDDocument extends jni.JObject { /// /// This will get the document CATALOG. This is guaranteed to not return null. ///@return The documents /Root dictionary - jni.JObject getDocumentCatalog() { + _$jni.JObject getDocumentCatalog() { return _getDocumentCatalog( - reference.pointer, _id_getDocumentCatalog as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getDocumentCatalog as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_isEncrypted = _class.instanceMethodId( @@ -707,16 +725,16 @@ class PDDocument extends jni.JObject { r'()Z', ); - static final _isEncrypted = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isEncrypted = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean isEncrypted()` @@ -724,7 +742,8 @@ class PDDocument extends jni.JObject { /// This will tell if this document is encrypted or not. ///@return true If this document is encrypted. bool isEncrypted() { - return _isEncrypted(reference.pointer, _id_isEncrypted as jni.JMethodIDPtr) + return _isEncrypted( + reference.pointer, _id_isEncrypted as _$jni.JMethodIDPtr) .boolean; } @@ -733,16 +752,16 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;', ); - static final _getEncryption = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getEncryption = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.encryption.PDEncryption getEncryption()` @@ -753,10 +772,10 @@ class PDDocument extends jni.JObject { /// but the only supported subclass at this time is a /// PDStandardEncryption object. ///@return The encryption dictionary(most likely a PDStandardEncryption object) - jni.JObject getEncryption() { + _$jni.JObject getEncryption() { return _getEncryption( - reference.pointer, _id_getEncryption as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getEncryption as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setEncryptionDictionary = _class.instanceMethodId( @@ -764,16 +783,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;)V', ); - static final _setEncryptionDictionary = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setEncryptionDictionary = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setEncryptionDictionary(org.apache.pdfbox.pdmodel.encryption.PDEncryption encryption)` /// @@ -781,11 +800,11 @@ class PDDocument extends jni.JObject { ///@param encryption The encryption dictionary(most likely a PDStandardEncryption object) ///@throws IOException If there is an error determining which security handler to use. void setEncryptionDictionary( - jni.JObject encryption, + _$jni.JObject encryption, ) { _setEncryptionDictionary( reference.pointer, - _id_setEncryptionDictionary as jni.JMethodIDPtr, + _id_setEncryptionDictionary as _$jni.JMethodIDPtr, encryption.reference.pointer) .check(); } @@ -795,17 +814,18 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;', ); - static final _getLastSignatureDictionary = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _getLastSignatureDictionary = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getLastSignatureDictionary()` /// The returned object must be released after use, by calling the [release] method. @@ -814,10 +834,10 @@ class PDDocument extends jni.JObject { /// last in time when empty signature fields are created first but signed after other fields. ///@return the last signature as PDSignatureField. ///@throws IOException if no document catalog can be found. - jni.JObject getLastSignatureDictionary() { + _$jni.JObject getLastSignatureDictionary() { return _getLastSignatureDictionary(reference.pointer, - _id_getLastSignatureDictionary as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _id_getLastSignatureDictionary as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getSignatureFields = _class.instanceMethodId( @@ -825,16 +845,16 @@ class PDDocument extends jni.JObject { r'()Ljava/util/List;', ); - static final _getSignatureFields = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSignatureFields = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.List getSignatureFields()` @@ -843,10 +863,10 @@ class PDDocument extends jni.JObject { /// Retrieve all signature fields from the document. ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. - jni.JList getSignatureFields() { + _$jni.JList<_$jni.JObject> getSignatureFields() { return _getSignatureFields( - reference.pointer, _id_getSignatureFields as jni.JMethodIDPtr) - .object(const jni.JListType(jni.JObjectType())); + reference.pointer, _id_getSignatureFields as _$jni.JMethodIDPtr) + .object(const _$jni.JListType(_$jni.JObjectType())); } static final _id_getSignatureDictionaries = _class.instanceMethodId( @@ -854,16 +874,16 @@ class PDDocument extends jni.JObject { r'()Ljava/util/List;', ); - static final _getSignatureDictionaries = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSignatureDictionaries = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.List getSignatureDictionaries()` @@ -872,10 +892,10 @@ class PDDocument extends jni.JObject { /// Retrieve all signature dictionaries from the document. ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. - jni.JList getSignatureDictionaries() { - return _getSignatureDictionaries( - reference.pointer, _id_getSignatureDictionaries as jni.JMethodIDPtr) - .object(const jni.JListType(jni.JObjectType())); + _$jni.JList<_$jni.JObject> getSignatureDictionaries() { + return _getSignatureDictionaries(reference.pointer, + _id_getSignatureDictionaries as _$jni.JMethodIDPtr) + .object(const _$jni.JListType(_$jni.JObjectType())); } static final _id_registerTrueTypeFontForClosing = _class.instanceMethodId( @@ -883,16 +903,17 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/fontbox/ttf/TrueTypeFont;)V', ); - static final _registerTrueTypeFontForClosing = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallVoidMethod') - .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + static final _registerTrueTypeFontForClosing = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void registerTrueTypeFontForClosing(org.apache.fontbox.ttf.TrueTypeFont ttf)` /// @@ -901,11 +922,11 @@ class PDDocument extends jni.JObject { /// method, it is done by the appropriate PDFont classes. ///@param ttf void registerTrueTypeFontForClosing( - jni.JObject ttf, + _$jni.JObject ttf, ) { _registerTrueTypeFontForClosing( reference.pointer, - _id_registerTrueTypeFontForClosing as jni.JMethodIDPtr, + _id_registerTrueTypeFontForClosing as _$jni.JMethodIDPtr, ttf.reference.pointer) .check(); } @@ -915,16 +936,16 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _load = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file)` /// The returned object must be released after use, by calling the [release] method. @@ -935,11 +956,11 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the file required a non-empty password. ///@throws IOException in case of a file reading or parsing error static PDDocument load( - jni.JObject file, + _$jni.JObject file, ) { - return _load(_class.reference.pointer, _id_load as jni.JMethodIDPtr, + return _load(_class.reference.pointer, _id_load as _$jni.JMethodIDPtr, file.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$1 = _class.staticMethodId( @@ -947,19 +968,22 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -971,12 +995,12 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the file required a non-empty password. ///@throws IOException in case of a file reading or parsing error static PDDocument load$1( - jni.JObject file, - jni.JObject memUsageSetting, + _$jni.JObject file, + _$jni.JObject memUsageSetting, ) { - return _load$1(_class.reference.pointer, _id_load$1 as jni.JMethodIDPtr, + return _load$1(_class.reference.pointer, _id_load$1 as _$jni.JMethodIDPtr, file.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$2 = _class.staticMethodId( @@ -984,19 +1008,22 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password)` /// The returned object must be released after use, by calling the [release] method. @@ -1008,12 +1035,12 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException in case of a file reading or parsing error static PDDocument load$2( - jni.JObject file, - jni.JString password, + _$jni.JObject file, + _$jni.JString password, ) { - return _load$2(_class.reference.pointer, _id_load$2 as jni.JMethodIDPtr, + return _load$2(_class.reference.pointer, _id_load$2 as _$jni.JMethodIDPtr, file.reference.pointer, password.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$3 = _class.staticMethodId( @@ -1021,24 +1048,24 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1051,17 +1078,17 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException in case of a file reading or parsing error static PDDocument load$3( - jni.JObject file, - jni.JString password, - jni.JObject memUsageSetting, + _$jni.JObject file, + _$jni.JString password, + _$jni.JObject memUsageSetting, ) { return _load$3( _class.reference.pointer, - _id_load$3 as jni.JMethodIDPtr, + _id_load$3 as _$jni.JMethodIDPtr, file.reference.pointer, password.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$4 = _class.staticMethodId( @@ -1069,26 +1096,26 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias)` /// The returned object must be released after use, by calling the [release] method. @@ -1101,19 +1128,19 @@ class PDDocument extends jni.JObject { ///@return loaded document ///@throws IOException in case of a file reading or parsing error static PDDocument load$4( - jni.JObject file, - jni.JString password, - jni.JObject keyStore, - jni.JString alias, + _$jni.JObject file, + _$jni.JString password, + _$jni.JObject keyStore, + _$jni.JString alias, ) { return _load$4( _class.reference.pointer, - _id_load$4 as jni.JMethodIDPtr, + _id_load$4 as _$jni.JMethodIDPtr, file.reference.pointer, password.reference.pointer, keyStore.reference.pointer, alias.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$5 = _class.staticMethodId( @@ -1121,28 +1148,28 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$5 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$5 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1156,21 +1183,21 @@ class PDDocument extends jni.JObject { ///@return loaded document ///@throws IOException in case of a file reading or parsing error static PDDocument load$5( - jni.JObject file, - jni.JString password, - jni.JObject keyStore, - jni.JString alias, - jni.JObject memUsageSetting, + _$jni.JObject file, + _$jni.JString password, + _$jni.JObject keyStore, + _$jni.JString alias, + _$jni.JObject memUsageSetting, ) { return _load$5( _class.reference.pointer, - _id_load$5 as jni.JMethodIDPtr, + _id_load$5 as _$jni.JMethodIDPtr, file.reference.pointer, password.reference.pointer, keyStore.reference.pointer, alias.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$6 = _class.staticMethodId( @@ -1178,16 +1205,16 @@ class PDDocument extends jni.JObject { r'(Ljava/io/InputStream;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$6 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _load$6 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input)` /// The returned object must be released after use, by calling the [release] method. @@ -1199,11 +1226,11 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument load$6( - jni.JObject input, + _$jni.JObject input, ) { - return _load$6(_class.reference.pointer, _id_load$6 as jni.JMethodIDPtr, + return _load$6(_class.reference.pointer, _id_load$6 as _$jni.JMethodIDPtr, input.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$7 = _class.staticMethodId( @@ -1211,19 +1238,22 @@ class PDDocument extends jni.JObject { r'(Ljava/io/InputStream;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$7 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$7 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1236,12 +1266,12 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument load$7( - jni.JObject input, - jni.JObject memUsageSetting, + _$jni.JObject input, + _$jni.JObject memUsageSetting, ) { - return _load$7(_class.reference.pointer, _id_load$7 as jni.JMethodIDPtr, + return _load$7(_class.reference.pointer, _id_load$7 as _$jni.JMethodIDPtr, input.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$8 = _class.staticMethodId( @@ -1249,19 +1279,22 @@ class PDDocument extends jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$8 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$8 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password)` /// The returned object must be released after use, by calling the [release] method. @@ -1274,12 +1307,12 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument load$8( - jni.JObject input, - jni.JString password, + _$jni.JObject input, + _$jni.JString password, ) { - return _load$8(_class.reference.pointer, _id_load$8 as jni.JMethodIDPtr, + return _load$8(_class.reference.pointer, _id_load$8 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$9 = _class.staticMethodId( @@ -1287,26 +1320,26 @@ class PDDocument extends jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$9 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$9 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias)` /// The returned object must be released after use, by calling the [release] method. @@ -1320,19 +1353,19 @@ class PDDocument extends jni.JObject { ///@return loaded document ///@throws IOException In case of a reading or parsing error. static PDDocument load$9( - jni.JObject input, - jni.JString password, - jni.JObject keyStore, - jni.JString alias, + _$jni.JObject input, + _$jni.JString password, + _$jni.JObject keyStore, + _$jni.JString alias, ) { return _load$9( _class.reference.pointer, - _id_load$9 as jni.JMethodIDPtr, + _id_load$9 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, keyStore.reference.pointer, alias.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$10 = _class.staticMethodId( @@ -1340,24 +1373,24 @@ class PDDocument extends jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$10 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$10 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1371,17 +1404,17 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument load$10( - jni.JObject input, - jni.JString password, - jni.JObject memUsageSetting, + _$jni.JObject input, + _$jni.JString password, + _$jni.JObject memUsageSetting, ) { return _load$10( _class.reference.pointer, - _id_load$10 as jni.JMethodIDPtr, + _id_load$10 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$11 = _class.staticMethodId( @@ -1389,28 +1422,28 @@ class PDDocument extends jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$11 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$11 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1426,21 +1459,21 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument load$11( - jni.JObject input, - jni.JString password, - jni.JObject keyStore, - jni.JString alias, - jni.JObject memUsageSetting, + _$jni.JObject input, + _$jni.JString password, + _$jni.JObject keyStore, + _$jni.JString alias, + _$jni.JObject memUsageSetting, ) { return _load$11( _class.reference.pointer, - _id_load$11 as jni.JMethodIDPtr, + _id_load$11 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, keyStore.reference.pointer, alias.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$12 = _class.staticMethodId( @@ -1448,16 +1481,16 @@ class PDDocument extends jni.JObject { r'([B)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$12 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _load$12 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input)` /// The returned object must be released after use, by calling the [release] method. @@ -1468,11 +1501,11 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument load$12( - jni.JArray input, + _$jni.JArray<_$jni.jbyte> input, ) { - return _load$12(_class.reference.pointer, _id_load$12 as jni.JMethodIDPtr, + return _load$12(_class.reference.pointer, _id_load$12 as _$jni.JMethodIDPtr, input.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$13 = _class.staticMethodId( @@ -1480,19 +1513,22 @@ class PDDocument extends jni.JObject { r'([BLjava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$13 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$13 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password)` /// The returned object must be released after use, by calling the [release] method. @@ -1504,12 +1540,12 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument load$13( - jni.JArray input, - jni.JString password, + _$jni.JArray<_$jni.jbyte> input, + _$jni.JString password, ) { - return _load$13(_class.reference.pointer, _id_load$13 as jni.JMethodIDPtr, + return _load$13(_class.reference.pointer, _id_load$13 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$14 = _class.staticMethodId( @@ -1517,26 +1553,26 @@ class PDDocument extends jni.JObject { r'([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$14 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$14 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias)` /// The returned object must be released after use, by calling the [release] method. @@ -1550,19 +1586,19 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument load$14( - jni.JArray input, - jni.JString password, - jni.JObject keyStore, - jni.JString alias, + _$jni.JArray<_$jni.jbyte> input, + _$jni.JString password, + _$jni.JObject keyStore, + _$jni.JString alias, ) { return _load$14( _class.reference.pointer, - _id_load$14 as jni.JMethodIDPtr, + _id_load$14 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, keyStore.reference.pointer, alias.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_load$15 = _class.staticMethodId( @@ -1570,28 +1606,28 @@ class PDDocument extends jni.JObject { r'([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$15 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _load$15 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1606,21 +1642,21 @@ class PDDocument extends jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument load$15( - jni.JArray input, - jni.JString password, - jni.JObject keyStore, - jni.JString alias, - jni.JObject memUsageSetting, + _$jni.JArray<_$jni.jbyte> input, + _$jni.JString password, + _$jni.JObject keyStore, + _$jni.JString alias, + _$jni.JObject memUsageSetting, ) { return _load$15( _class.reference.pointer, - _id_load$15 as jni.JMethodIDPtr, + _id_load$15 as _$jni.JMethodIDPtr, input.reference.pointer, password.reference.pointer, keyStore.reference.pointer, alias.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocumentType()); + .object(const $PDDocument$Type()); } static final _id_save = _class.instanceMethodId( @@ -1628,16 +1664,16 @@ class PDDocument extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _save = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _save = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void save(java.lang.String fileName)` /// @@ -1649,9 +1685,9 @@ class PDDocument extends jni.JObject { ///@param fileName The file to save as. ///@throws IOException if the output could not be written void save( - jni.JString fileName, + _$jni.JString fileName, ) { - _save(reference.pointer, _id_save as jni.JMethodIDPtr, + _save(reference.pointer, _id_save as _$jni.JMethodIDPtr, fileName.reference.pointer) .check(); } @@ -1661,16 +1697,16 @@ class PDDocument extends jni.JObject { r'(Ljava/io/File;)V', ); - static final _save$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _save$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void save(java.io.File file)` /// @@ -1682,9 +1718,9 @@ class PDDocument extends jni.JObject { ///@param file The file to save as. ///@throws IOException if the output could not be written void save$1( - jni.JObject file, + _$jni.JObject file, ) { - _save$1(reference.pointer, _id_save$1 as jni.JMethodIDPtr, + _save$1(reference.pointer, _id_save$1 as _$jni.JMethodIDPtr, file.reference.pointer) .check(); } @@ -1694,16 +1730,16 @@ class PDDocument extends jni.JObject { r'(Ljava/io/OutputStream;)V', ); - static final _save$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _save$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void save(java.io.OutputStream output)` /// @@ -1716,9 +1752,9 @@ class PDDocument extends jni.JObject { /// it in a java.io.BufferedOutputStream, unless it is already buffered. ///@throws IOException if the output could not be written void save$2( - jni.JObject output, + _$jni.JObject output, ) { - _save$2(reference.pointer, _id_save$2 as jni.JMethodIDPtr, + _save$2(reference.pointer, _id_save$2 as _$jni.JMethodIDPtr, output.reference.pointer) .check(); } @@ -1728,16 +1764,16 @@ class PDDocument extends jni.JObject { r'(Ljava/io/OutputStream;)V', ); - static final _saveIncremental = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _saveIncremental = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void saveIncremental(java.io.OutputStream output)` /// @@ -1755,10 +1791,10 @@ class PDDocument extends jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream. void saveIncremental( - jni.JObject output, + _$jni.JObject output, ) { - _saveIncremental(reference.pointer, _id_saveIncremental as jni.JMethodIDPtr, - output.reference.pointer) + _saveIncremental(reference.pointer, + _id_saveIncremental as _$jni.JMethodIDPtr, output.reference.pointer) .check(); } @@ -1767,19 +1803,22 @@ class PDDocument extends jni.JObject { r'(Ljava/io/OutputStream;Ljava/util/Set;)V', ); - static final _saveIncremental$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _saveIncremental$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void saveIncremental(java.io.OutputStream output, java.util.Set objectsToWrite)` /// @@ -1802,12 +1841,12 @@ class PDDocument extends jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream. void saveIncremental$1( - jni.JObject output, - jni.JSet objectsToWrite, + _$jni.JObject output, + _$jni.JSet<_$jni.JObject> objectsToWrite, ) { _saveIncremental$1( reference.pointer, - _id_saveIncremental$1 as jni.JMethodIDPtr, + _id_saveIncremental$1 as _$jni.JMethodIDPtr, output.reference.pointer, objectsToWrite.reference.pointer) .check(); @@ -1819,16 +1858,16 @@ class PDDocument extends jni.JObject { ); static final _saveIncrementalForExternalSigning = - ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.digitalsignature.ExternalSigningSupport saveIncrementalForExternalSigning(java.io.OutputStream output)` /// The returned object must be released after use, by calling the [release] method. @@ -1870,14 +1909,14 @@ class PDDocument extends jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream or /// signature options were not set. - jni.JObject saveIncrementalForExternalSigning( - jni.JObject output, + _$jni.JObject saveIncrementalForExternalSigning( + _$jni.JObject output, ) { return _saveIncrementalForExternalSigning( reference.pointer, - _id_saveIncrementalForExternalSigning as jni.JMethodIDPtr, + _id_saveIncrementalForExternalSigning as _$jni.JMethodIDPtr, output.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_getPage = _class.instanceMethodId( @@ -1885,13 +1924,15 @@ class PDDocument extends jni.JObject { r'(I)Lorg/apache/pdfbox/pdmodel/PDPage;', ); - static final _getPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') + static final _getPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public org.apache.pdfbox.pdmodel.PDPage getPage(int pageIndex)` /// The returned object must be released after use, by calling the [release] method. @@ -1903,12 +1944,12 @@ class PDDocument extends jni.JObject { /// PDDocument\#getPages() instead. ///@param pageIndex the 0-based page index ///@return the page at the given index. - jni.JObject getPage( + _$jni.JObject getPage( int pageIndex, ) { return _getPage( - reference.pointer, _id_getPage as jni.JMethodIDPtr, pageIndex) - .object(const jni.JObjectType()); + reference.pointer, _id_getPage as _$jni.JMethodIDPtr, pageIndex) + .object(const _$jni.JObjectType()); } static final _id_getPages = _class.instanceMethodId( @@ -1916,16 +1957,16 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/PDPageTree;', ); - static final _getPages = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getPages = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.PDPageTree getPages()` @@ -1933,9 +1974,9 @@ class PDDocument extends jni.JObject { /// /// Returns the page tree. ///@return the page tree - jni.JObject getPages() { - return _getPages(reference.pointer, _id_getPages as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getPages() { + return _getPages(reference.pointer, _id_getPages as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getNumberOfPages = _class.instanceMethodId( @@ -1943,16 +1984,16 @@ class PDDocument extends jni.JObject { r'()I', ); - static final _getNumberOfPages = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNumberOfPages = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getNumberOfPages()` @@ -1961,7 +2002,7 @@ class PDDocument extends jni.JObject { ///@return The total number of pages in the PDF document. int getNumberOfPages() { return _getNumberOfPages( - reference.pointer, _id_getNumberOfPages as jni.JMethodIDPtr) + reference.pointer, _id_getNumberOfPages as _$jni.JMethodIDPtr) .integer; } @@ -1970,16 +2011,16 @@ class PDDocument extends jni.JObject { r'()V', ); - static final _close = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _close = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void close()` @@ -1987,7 +2028,7 @@ class PDDocument extends jni.JObject { /// This will close the underlying COSDocument object. ///@throws IOException If there is an error releasing resources. void close() { - _close(reference.pointer, _id_close as jni.JMethodIDPtr).check(); + _close(reference.pointer, _id_close as _$jni.JMethodIDPtr).check(); } static final _id_protect = _class.instanceMethodId( @@ -1995,16 +2036,16 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/encryption/ProtectionPolicy;)V', ); - static final _protect = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _protect = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void protect(org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy policy)` /// @@ -2019,9 +2060,9 @@ class PDDocument extends jni.JObject { ///@param policy The protection policy. ///@throws IOException if there isn't any suitable security handler. void protect( - jni.JObject policy, + _$jni.JObject policy, ) { - _protect(reference.pointer, _id_protect as jni.JMethodIDPtr, + _protect(reference.pointer, _id_protect as _$jni.JMethodIDPtr, policy.reference.pointer) .check(); } @@ -2031,17 +2072,18 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/encryption/AccessPermission;', ); - static final _getCurrentAccessPermission = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _getCurrentAccessPermission = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `public org.apache.pdfbox.pdmodel.encryption.AccessPermission getCurrentAccessPermission()` /// The returned object must be released after use, by calling the [release] method. @@ -2051,10 +2093,10 @@ class PDDocument extends jni.JObject { /// only mode so that permissions cannot be changed. Methods providing access to content should rely on this object /// to verify if the current user is allowed to proceed. ///@return the access permissions for the current user on the document. - jni.JObject getCurrentAccessPermission() { + _$jni.JObject getCurrentAccessPermission() { return _getCurrentAccessPermission(reference.pointer, - _id_getCurrentAccessPermission as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _id_getCurrentAccessPermission as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_isAllSecurityToBeRemoved = _class.instanceMethodId( @@ -2062,16 +2104,16 @@ class PDDocument extends jni.JObject { r'()Z', ); - static final _isAllSecurityToBeRemoved = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isAllSecurityToBeRemoved = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean isAllSecurityToBeRemoved()` @@ -2079,8 +2121,8 @@ class PDDocument extends jni.JObject { /// Indicates if all security is removed or not when writing the pdf. ///@return returns true if all security shall be removed otherwise false bool isAllSecurityToBeRemoved() { - return _isAllSecurityToBeRemoved( - reference.pointer, _id_isAllSecurityToBeRemoved as jni.JMethodIDPtr) + return _isAllSecurityToBeRemoved(reference.pointer, + _id_isAllSecurityToBeRemoved as _$jni.JMethodIDPtr) .boolean; } @@ -2089,15 +2131,15 @@ class PDDocument extends jni.JObject { r'(Z)V', ); - static final _setAllSecurityToBeRemoved = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setAllSecurityToBeRemoved = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setAllSecurityToBeRemoved(boolean removeAllSecurity)` /// @@ -2108,7 +2150,7 @@ class PDDocument extends jni.JObject { ) { _setAllSecurityToBeRemoved( reference.pointer, - _id_setAllSecurityToBeRemoved as jni.JMethodIDPtr, + _id_setAllSecurityToBeRemoved as _$jni.JMethodIDPtr, removeAllSecurity ? 1 : 0) .check(); } @@ -2118,16 +2160,16 @@ class PDDocument extends jni.JObject { r'()Ljava/lang/Long;', ); - static final _getDocumentId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDocumentId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Long getDocumentId()` @@ -2135,10 +2177,10 @@ class PDDocument extends jni.JObject { /// /// Provides the document ID. ///@return the document ID - jni.JLong getDocumentId() { + _$jni.JLong getDocumentId() { return _getDocumentId( - reference.pointer, _id_getDocumentId as jni.JMethodIDPtr) - .object(const jni.JLongType()); + reference.pointer, _id_getDocumentId as _$jni.JMethodIDPtr) + .object(const _$jni.JLongType()); } static final _id_setDocumentId = _class.instanceMethodId( @@ -2146,25 +2188,25 @@ class PDDocument extends jni.JObject { r'(Ljava/lang/Long;)V', ); - static final _setDocumentId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setDocumentId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setDocumentId(java.lang.Long docId)` /// /// Sets the document ID to the given value. ///@param docId the new document ID void setDocumentId( - jni.JLong docId, + _$jni.JLong docId, ) { - _setDocumentId(reference.pointer, _id_setDocumentId as jni.JMethodIDPtr, + _setDocumentId(reference.pointer, _id_setDocumentId as _$jni.JMethodIDPtr, docId.reference.pointer) .check(); } @@ -2174,16 +2216,16 @@ class PDDocument extends jni.JObject { r'()F', ); - static final _getVersion = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getVersion = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getVersion()` @@ -2191,7 +2233,7 @@ class PDDocument extends jni.JObject { /// Returns the PDF specification version this document conforms to. ///@return the PDF version (e.g. 1.4f) double getVersion() { - return _getVersion(reference.pointer, _id_getVersion as jni.JMethodIDPtr) + return _getVersion(reference.pointer, _id_getVersion as _$jni.JMethodIDPtr) .float; } @@ -2200,15 +2242,15 @@ class PDDocument extends jni.JObject { r'(F)V', ); - static final _setVersion = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setVersion = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); /// from: `public void setVersion(float newVersion)` /// @@ -2218,7 +2260,7 @@ class PDDocument extends jni.JObject { double newVersion, ) { _setVersion( - reference.pointer, _id_setVersion as jni.JMethodIDPtr, newVersion) + reference.pointer, _id_setVersion as _$jni.JMethodIDPtr, newVersion) .check(); } @@ -2227,16 +2269,16 @@ class PDDocument extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/ResourceCache;', ); - static final _getResourceCache = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getResourceCache = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.ResourceCache getResourceCache()` @@ -2244,10 +2286,10 @@ class PDDocument extends jni.JObject { /// /// Returns the resource cache associated with this document, or null if there is none. ///@return the resource cache or null. - jni.JObject getResourceCache() { + _$jni.JObject getResourceCache() { return _getResourceCache( - reference.pointer, _id_getResourceCache as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getResourceCache as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setResourceCache = _class.instanceMethodId( @@ -2255,53 +2297,58 @@ class PDDocument extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/ResourceCache;)V', ); - static final _setResourceCache = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setResourceCache = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setResourceCache(org.apache.pdfbox.pdmodel.ResourceCache resourceCache)` /// /// Sets the resource cache associated with this document. ///@param resourceCache A resource cache, or null. void setResourceCache( - jni.JObject resourceCache, + _$jni.JObject resourceCache, ) { _setResourceCache( reference.pointer, - _id_setResourceCache as jni.JMethodIDPtr, + _id_setResourceCache as _$jni.JMethodIDPtr, resourceCache.reference.pointer) .check(); } } -final class $PDDocumentType extends jni.JObjType { - const $PDDocumentType(); +final class $PDDocument$Type extends _$jni.JObjType { + @_$jni.internal + const $PDDocument$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocument;'; - @override - PDDocument fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + PDDocument fromReference(_$jni.JReference reference) => PDDocument.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($PDDocumentType).hashCode; + @_$core.override + int get hashCode => ($PDDocument$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($PDDocumentType) && other is $PDDocumentType; + return other.runtimeType == ($PDDocument$Type) && other is $PDDocument$Type; } } diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart index 3e1c7ca2c..8696ca3bc 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart @@ -25,12 +25,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -40,11 +45,11 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; /// from: `org.apache.pdfbox.pdmodel.PDDocumentInformation` /// @@ -53,33 +58,36 @@ import 'package:jni/jni.dart' as jni; /// method then it will clear the value. ///@author Ben Litchfield ///@author Gerardo Ortiz -class PDDocumentInformation extends jni.JObject { - @override - late final jni.JObjType $type = type; +class PDDocumentInformation extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal PDDocumentInformation.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocumentInformation'); + _$jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocumentInformation'); /// The type which includes information such as the signature of this class. - static const type = $PDDocumentInformationType(); + static const type = $PDDocumentInformation$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -88,7 +96,7 @@ class PDDocumentInformation extends jni.JObject { /// Default Constructor. factory PDDocumentInformation() { return PDDocumentInformation.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -96,16 +104,16 @@ class PDDocumentInformation extends jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDictionary;)V', ); - static final _new$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (org.apache.pdfbox.cos.COSDictionary dic)` /// The returned object must be released after use, by calling the [release] method. @@ -113,10 +121,10 @@ class PDDocumentInformation extends jni.JObject { /// Constructor that is used for a preexisting dictionary. ///@param dic The underlying dictionary. factory PDDocumentInformation.new$1( - jni.JObject dic, + _$jni.JObject dic, ) { return PDDocumentInformation.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as jni.JMethodIDPtr, dic.reference.pointer) + _id_new$1 as _$jni.JMethodIDPtr, dic.reference.pointer) .reference); } @@ -125,16 +133,16 @@ class PDDocumentInformation extends jni.JObject { r'()Lorg/apache/pdfbox/cos/COSDictionary;', ); - static final _getCOSObject = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCOSObject = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.cos.COSDictionary getCOSObject()` @@ -142,10 +150,10 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the underlying dictionary that this object wraps. ///@return The underlying info dictionary. - jni.JObject getCOSObject() { + _$jni.JObject getCOSObject() { return _getCOSObject( - reference.pointer, _id_getCOSObject as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getCOSObject as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getPropertyStringValue = _class.instanceMethodId( @@ -153,16 +161,16 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)Ljava/lang/Object;', ); - static final _getPropertyStringValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getPropertyStringValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.lang.Object getPropertyStringValue(java.lang.String propertyKey)` /// The returned object must be released after use, by calling the [release] method. @@ -175,14 +183,14 @@ class PDDocumentInformation extends jni.JObject { /// ///@param propertyKey the dictionaries key ///@return the properties value - jni.JObject getPropertyStringValue( - jni.JString propertyKey, + _$jni.JObject getPropertyStringValue( + _$jni.JString propertyKey, ) { return _getPropertyStringValue( reference.pointer, - _id_getPropertyStringValue as jni.JMethodIDPtr, + _id_getPropertyStringValue as _$jni.JMethodIDPtr, propertyKey.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_getTitle = _class.instanceMethodId( @@ -190,16 +198,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getTitle = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTitle = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getTitle()` @@ -207,9 +215,9 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the title of the document. This will return null if no title exists. ///@return The title of the document. - jni.JString getTitle() { - return _getTitle(reference.pointer, _id_getTitle as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getTitle() { + return _getTitle(reference.pointer, _id_getTitle as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setTitle = _class.instanceMethodId( @@ -217,25 +225,25 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setTitle = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setTitle = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setTitle(java.lang.String title)` /// /// This will set the title of the document. ///@param title The new title for the document. void setTitle( - jni.JString title, + _$jni.JString title, ) { - _setTitle(reference.pointer, _id_setTitle as jni.JMethodIDPtr, + _setTitle(reference.pointer, _id_setTitle as _$jni.JMethodIDPtr, title.reference.pointer) .check(); } @@ -245,16 +253,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getAuthor = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getAuthor = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getAuthor()` @@ -262,9 +270,9 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the author of the document. This will return null if no author exists. ///@return The author of the document. - jni.JString getAuthor() { - return _getAuthor(reference.pointer, _id_getAuthor as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getAuthor() { + return _getAuthor(reference.pointer, _id_getAuthor as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setAuthor = _class.instanceMethodId( @@ -272,25 +280,25 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setAuthor = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setAuthor = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setAuthor(java.lang.String author)` /// /// This will set the author of the document. ///@param author The new author for the document. void setAuthor( - jni.JString author, + _$jni.JString author, ) { - _setAuthor(reference.pointer, _id_setAuthor as jni.JMethodIDPtr, + _setAuthor(reference.pointer, _id_setAuthor as _$jni.JMethodIDPtr, author.reference.pointer) .check(); } @@ -300,16 +308,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getSubject = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSubject = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getSubject()` @@ -317,9 +325,9 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the subject of the document. This will return null if no subject exists. ///@return The subject of the document. - jni.JString getSubject() { - return _getSubject(reference.pointer, _id_getSubject as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getSubject() { + return _getSubject(reference.pointer, _id_getSubject as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setSubject = _class.instanceMethodId( @@ -327,25 +335,25 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setSubject = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setSubject = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setSubject(java.lang.String subject)` /// /// This will set the subject of the document. ///@param subject The new subject for the document. void setSubject( - jni.JString subject, + _$jni.JString subject, ) { - _setSubject(reference.pointer, _id_setSubject as jni.JMethodIDPtr, + _setSubject(reference.pointer, _id_setSubject as _$jni.JMethodIDPtr, subject.reference.pointer) .check(); } @@ -355,16 +363,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getKeywords = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getKeywords = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getKeywords()` @@ -372,9 +380,10 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the keywords of the document. This will return null if no keywords exists. ///@return The keywords of the document. - jni.JString getKeywords() { - return _getKeywords(reference.pointer, _id_getKeywords as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getKeywords() { + return _getKeywords( + reference.pointer, _id_getKeywords as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setKeywords = _class.instanceMethodId( @@ -382,25 +391,25 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setKeywords = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setKeywords = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setKeywords(java.lang.String keywords)` /// /// This will set the keywords of the document. ///@param keywords The new keywords for the document. void setKeywords( - jni.JString keywords, + _$jni.JString keywords, ) { - _setKeywords(reference.pointer, _id_setKeywords as jni.JMethodIDPtr, + _setKeywords(reference.pointer, _id_setKeywords as _$jni.JMethodIDPtr, keywords.reference.pointer) .check(); } @@ -410,16 +419,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getCreator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCreator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getCreator()` @@ -427,9 +436,9 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the creator of the document. This will return null if no creator exists. ///@return The creator of the document. - jni.JString getCreator() { - return _getCreator(reference.pointer, _id_getCreator as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getCreator() { + return _getCreator(reference.pointer, _id_getCreator as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setCreator = _class.instanceMethodId( @@ -437,25 +446,25 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setCreator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCreator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setCreator(java.lang.String creator)` /// /// This will set the creator of the document. ///@param creator The new creator for the document. void setCreator( - jni.JString creator, + _$jni.JString creator, ) { - _setCreator(reference.pointer, _id_setCreator as jni.JMethodIDPtr, + _setCreator(reference.pointer, _id_setCreator as _$jni.JMethodIDPtr, creator.reference.pointer) .check(); } @@ -465,16 +474,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getProducer = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getProducer = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getProducer()` @@ -482,9 +491,10 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the producer of the document. This will return null if no producer exists. ///@return The producer of the document. - jni.JString getProducer() { - return _getProducer(reference.pointer, _id_getProducer as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getProducer() { + return _getProducer( + reference.pointer, _id_getProducer as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setProducer = _class.instanceMethodId( @@ -492,25 +502,25 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setProducer = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setProducer = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setProducer(java.lang.String producer)` /// /// This will set the producer of the document. ///@param producer The new producer for the document. void setProducer( - jni.JString producer, + _$jni.JString producer, ) { - _setProducer(reference.pointer, _id_setProducer as jni.JMethodIDPtr, + _setProducer(reference.pointer, _id_setProducer as _$jni.JMethodIDPtr, producer.reference.pointer) .check(); } @@ -520,16 +530,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/util/Calendar;', ); - static final _getCreationDate = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCreationDate = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Calendar getCreationDate()` @@ -537,10 +547,10 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the creation date of the document. This will return null if no creation date exists. ///@return The creation date of the document. - jni.JObject getCreationDate() { + _$jni.JObject getCreationDate() { return _getCreationDate( - reference.pointer, _id_getCreationDate as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getCreationDate as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setCreationDate = _class.instanceMethodId( @@ -548,26 +558,26 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/util/Calendar;)V', ); - static final _setCreationDate = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCreationDate = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setCreationDate(java.util.Calendar date)` /// /// This will set the creation date of the document. ///@param date The new creation date for the document. void setCreationDate( - jni.JObject date, + _$jni.JObject date, ) { - _setCreationDate(reference.pointer, _id_setCreationDate as jni.JMethodIDPtr, - date.reference.pointer) + _setCreationDate(reference.pointer, + _id_setCreationDate as _$jni.JMethodIDPtr, date.reference.pointer) .check(); } @@ -576,16 +586,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/util/Calendar;', ); - static final _getModificationDate = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getModificationDate = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Calendar getModificationDate()` @@ -593,10 +603,10 @@ class PDDocumentInformation extends jni.JObject { /// /// This will get the modification date of the document. This will return null if no modification date exists. ///@return The modification date of the document. - jni.JObject getModificationDate() { + _$jni.JObject getModificationDate() { return _getModificationDate( - reference.pointer, _id_getModificationDate as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getModificationDate as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setModificationDate = _class.instanceMethodId( @@ -604,26 +614,28 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/util/Calendar;)V', ); - static final _setModificationDate = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setModificationDate = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setModificationDate(java.util.Calendar date)` /// /// This will set the modification date of the document. ///@param date The new modification date for the document. void setModificationDate( - jni.JObject date, + _$jni.JObject date, ) { - _setModificationDate(reference.pointer, - _id_setModificationDate as jni.JMethodIDPtr, date.reference.pointer) + _setModificationDate( + reference.pointer, + _id_setModificationDate as _$jni.JMethodIDPtr, + date.reference.pointer) .check(); } @@ -632,16 +644,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getTrapped = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTrapped = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getTrapped()` @@ -650,9 +662,9 @@ class PDDocumentInformation extends jni.JObject { /// This will get the trapped value for the document. /// This will return null if one is not found. ///@return The trapped value for the document. - jni.JString getTrapped() { - return _getTrapped(reference.pointer, _id_getTrapped as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getTrapped() { + return _getTrapped(reference.pointer, _id_getTrapped as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getMetadataKeys = _class.instanceMethodId( @@ -660,16 +672,16 @@ class PDDocumentInformation extends jni.JObject { r'()Ljava/util/Set;', ); - static final _getMetadataKeys = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getMetadataKeys = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Set getMetadataKeys()` @@ -678,10 +690,10 @@ class PDDocumentInformation extends jni.JObject { /// This will get the keys of all metadata information fields for the document. ///@return all metadata key strings. ///@since Apache PDFBox 1.3.0 - jni.JSet getMetadataKeys() { + _$jni.JSet<_$jni.JString> getMetadataKeys() { return _getMetadataKeys( - reference.pointer, _id_getMetadataKeys as jni.JMethodIDPtr) - .object(const jni.JSetType(jni.JStringType())); + reference.pointer, _id_getMetadataKeys as _$jni.JMethodIDPtr) + .object(const _$jni.JSetType(_$jni.JStringType())); } static final _id_getCustomMetadataValue = _class.instanceMethodId( @@ -689,16 +701,16 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _getCustomMetadataValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getCustomMetadataValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.lang.String getCustomMetadataValue(java.lang.String fieldName)` /// The returned object must be released after use, by calling the [release] method. @@ -707,14 +719,14 @@ class PDDocumentInformation extends jni.JObject { /// This will return null if one is not found. ///@param fieldName Name of custom metadata field from pdf document. ///@return String Value of metadata field - jni.JString getCustomMetadataValue( - jni.JString fieldName, + _$jni.JString getCustomMetadataValue( + _$jni.JString fieldName, ) { return _getCustomMetadataValue( reference.pointer, - _id_getCustomMetadataValue as jni.JMethodIDPtr, + _id_getCustomMetadataValue as _$jni.JMethodIDPtr, fieldName.reference.pointer) - .object(const jni.JStringType()); + .object(const _$jni.JStringType()); } static final _id_setCustomMetadataValue = _class.instanceMethodId( @@ -722,19 +734,22 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;Ljava/lang/String;)V', ); - static final _setCustomMetadataValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _setCustomMetadataValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setCustomMetadataValue(java.lang.String fieldName, java.lang.String fieldValue)` /// @@ -742,12 +757,12 @@ class PDDocumentInformation extends jni.JObject { ///@param fieldName The name of the custom metadata field. ///@param fieldValue The value to the custom metadata field. void setCustomMetadataValue( - jni.JString fieldName, - jni.JString fieldValue, + _$jni.JString fieldName, + _$jni.JString fieldValue, ) { _setCustomMetadataValue( reference.pointer, - _id_setCustomMetadataValue as jni.JMethodIDPtr, + _id_setCustomMetadataValue as _$jni.JMethodIDPtr, fieldName.reference.pointer, fieldValue.reference.pointer) .check(); @@ -758,16 +773,16 @@ class PDDocumentInformation extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setTrapped = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setTrapped = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setTrapped(java.lang.String value)` /// @@ -776,37 +791,42 @@ class PDDocumentInformation extends jni.JObject { ///@param value The new trapped value for the document. ///@throws IllegalArgumentException if the parameter is invalid. void setTrapped( - jni.JString value, + _$jni.JString value, ) { - _setTrapped(reference.pointer, _id_setTrapped as jni.JMethodIDPtr, + _setTrapped(reference.pointer, _id_setTrapped as _$jni.JMethodIDPtr, value.reference.pointer) .check(); } } -final class $PDDocumentInformationType - extends jni.JObjType { - const $PDDocumentInformationType(); +final class $PDDocumentInformation$Type + extends _$jni.JObjType { + @_$jni.internal + const $PDDocumentInformation$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;'; - @override - PDDocumentInformation fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + PDDocumentInformation fromReference(_$jni.JReference reference) => PDDocumentInformation.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($PDDocumentInformationType).hashCode; + @_$core.override + int get hashCode => ($PDDocumentInformation$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($PDDocumentInformationType) && - other is $PDDocumentInformationType; + return other.runtimeType == ($PDDocumentInformation$Type) && + other is $PDDocumentInformation$Type; } } diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart index 64b442cdc..b4354d1e5 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart @@ -25,12 +25,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -40,11 +45,11 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; import '../pdmodel/PDDocument.dart' as pddocument_; @@ -57,33 +62,36 @@ import '../pdmodel/PDDocument.dart' as pddocument_; /// The basic flow of this process is that we get a document and use a series of processXXX() functions that work on /// smaller and smaller chunks of the page. Eventually, we fully process each page and then print it. ///@author Ben Litchfield -class PDFTextStripper extends jni.JObject { - @override - late final jni.JObjType $type = type; +class PDFTextStripper extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal PDFTextStripper.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'org/apache/pdfbox/text/PDFTextStripper'); + _$jni.JClass.forName(r'org/apache/pdfbox/text/PDFTextStripper'); /// The type which includes information such as the signature of this class. - static const type = $PDFTextStripperType(); + static const type = $PDFTextStripper$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -93,7 +101,7 @@ class PDFTextStripper extends jni.JObject { ///@throws IOException If there is an error loading the properties. factory PDFTextStripper() { return PDFTextStripper.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -102,16 +110,16 @@ class PDFTextStripper extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDDocument;)Ljava/lang/String;', ); - static final _getText = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getText = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.lang.String getText(org.apache.pdfbox.pdmodel.PDDocument doc)` /// The returned object must be released after use, by calling the [release] method. @@ -126,12 +134,12 @@ class PDFTextStripper extends jni.JObject { ///@param doc The document to get the text from. ///@return The text of the PDF document. ///@throws IOException if the doc state is invalid or it is encrypted. - jni.JString getText( + _$jni.JString getText( pddocument_.PDDocument doc, ) { - return _getText(reference.pointer, _id_getText as jni.JMethodIDPtr, + return _getText(reference.pointer, _id_getText as _$jni.JMethodIDPtr, doc.reference.pointer) - .object(const jni.JStringType()); + .object(const _$jni.JStringType()); } static final _id_writeText = _class.instanceMethodId( @@ -139,19 +147,22 @@ class PDFTextStripper extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDDocument;Ljava/io/Writer;)V', ); - static final _writeText = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _writeText = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void writeText(org.apache.pdfbox.pdmodel.PDDocument doc, java.io.Writer outputStream)` /// @@ -161,9 +172,9 @@ class PDFTextStripper extends jni.JObject { ///@throws IOException If the doc is in an invalid state. void writeText( pddocument_.PDDocument doc, - jni.JObject outputStream, + _$jni.JObject outputStream, ) { - _writeText(reference.pointer, _id_writeText as jni.JMethodIDPtr, + _writeText(reference.pointer, _id_writeText as _$jni.JMethodIDPtr, doc.reference.pointer, outputStream.reference.pointer) .check(); } @@ -173,16 +184,16 @@ class PDFTextStripper extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)V', ); - static final _processPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _processPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void processPage(org.apache.pdfbox.pdmodel.PDPage page)` /// @@ -190,9 +201,9 @@ class PDFTextStripper extends jni.JObject { ///@param page The page to process. ///@throws IOException If there is an error processing the page. void processPage( - jni.JObject page, + _$jni.JObject page, ) { - _processPage(reference.pointer, _id_processPage as jni.JMethodIDPtr, + _processPage(reference.pointer, _id_processPage as _$jni.JMethodIDPtr, page.reference.pointer) .check(); } @@ -202,16 +213,16 @@ class PDFTextStripper extends jni.JObject { r'()I', ); - static final _getStartPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getStartPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getStartPage()` @@ -222,7 +233,7 @@ class PDFTextStripper extends jni.JObject { ///@return Value of property startPage. int getStartPage() { return _getStartPage( - reference.pointer, _id_getStartPage as jni.JMethodIDPtr) + reference.pointer, _id_getStartPage as _$jni.JMethodIDPtr) .integer; } @@ -231,15 +242,15 @@ class PDFTextStripper extends jni.JObject { r'(I)V', ); - static final _setStartPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setStartPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setStartPage(int startPageValue)` /// @@ -248,7 +259,7 @@ class PDFTextStripper extends jni.JObject { void setStartPage( int startPageValue, ) { - _setStartPage(reference.pointer, _id_setStartPage as jni.JMethodIDPtr, + _setStartPage(reference.pointer, _id_setStartPage as _$jni.JMethodIDPtr, startPageValue) .check(); } @@ -258,16 +269,16 @@ class PDFTextStripper extends jni.JObject { r'()I', ); - static final _getEndPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getEndPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getEndPage()` @@ -277,7 +288,7 @@ class PDFTextStripper extends jni.JObject { /// Integer.MAX_VALUE such that all pages of the pdf will be extracted. ///@return Value of property endPage. int getEndPage() { - return _getEndPage(reference.pointer, _id_getEndPage as jni.JMethodIDPtr) + return _getEndPage(reference.pointer, _id_getEndPage as _$jni.JMethodIDPtr) .integer; } @@ -286,15 +297,15 @@ class PDFTextStripper extends jni.JObject { r'(I)V', ); - static final _setEndPage = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setEndPage = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setEndPage(int endPageValue)` /// @@ -303,8 +314,8 @@ class PDFTextStripper extends jni.JObject { void setEndPage( int endPageValue, ) { - _setEndPage( - reference.pointer, _id_setEndPage as jni.JMethodIDPtr, endPageValue) + _setEndPage(reference.pointer, _id_setEndPage as _$jni.JMethodIDPtr, + endPageValue) .check(); } @@ -313,16 +324,16 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setLineSeparator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setLineSeparator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setLineSeparator(java.lang.String separator)` /// @@ -330,11 +341,11 @@ class PDFTextStripper extends jni.JObject { /// preference is not set explicitly using this method. ///@param separator The desired line separator string. void setLineSeparator( - jni.JString separator, + _$jni.JString separator, ) { _setLineSeparator( reference.pointer, - _id_setLineSeparator as jni.JMethodIDPtr, + _id_setLineSeparator as _$jni.JMethodIDPtr, separator.reference.pointer) .check(); } @@ -344,16 +355,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getLineSeparator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getLineSeparator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getLineSeparator()` @@ -361,10 +372,10 @@ class PDFTextStripper extends jni.JObject { /// /// This will get the line separator. ///@return The desired line separator string. - jni.JString getLineSeparator() { + _$jni.JString getLineSeparator() { return _getLineSeparator( - reference.pointer, _id_getLineSeparator as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getLineSeparator as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getWordSeparator = _class.instanceMethodId( @@ -372,16 +383,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getWordSeparator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getWordSeparator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getWordSeparator()` @@ -389,10 +400,10 @@ class PDFTextStripper extends jni.JObject { /// /// This will get the word separator. ///@return The desired word separator string. - jni.JString getWordSeparator() { + _$jni.JString getWordSeparator() { return _getWordSeparator( - reference.pointer, _id_getWordSeparator as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getWordSeparator as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setWordSeparator = _class.instanceMethodId( @@ -400,16 +411,16 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setWordSeparator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setWordSeparator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setWordSeparator(java.lang.String separator)` /// @@ -419,11 +430,11 @@ class PDFTextStripper extends jni.JObject { /// the empty string. ///@param separator The desired page separator string. void setWordSeparator( - jni.JString separator, + _$jni.JString separator, ) { _setWordSeparator( reference.pointer, - _id_setWordSeparator as jni.JMethodIDPtr, + _id_setWordSeparator as _$jni.JMethodIDPtr, separator.reference.pointer) .check(); } @@ -435,16 +446,16 @@ class PDFTextStripper extends jni.JObject { ); static final _getSuppressDuplicateOverlappingText = - ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getSuppressDuplicateOverlappingText()` @@ -452,7 +463,7 @@ class PDFTextStripper extends jni.JObject { /// @return Returns the suppressDuplicateOverlappingText. bool getSuppressDuplicateOverlappingText() { return _getSuppressDuplicateOverlappingText(reference.pointer, - _id_getSuppressDuplicateOverlappingText as jni.JMethodIDPtr) + _id_getSuppressDuplicateOverlappingText as _$jni.JMethodIDPtr) .boolean; } @@ -463,15 +474,14 @@ class PDFTextStripper extends jni.JObject { ); static final _setSuppressDuplicateOverlappingText = - ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setSuppressDuplicateOverlappingText(boolean suppressDuplicateOverlappingTextValue)` /// @@ -484,7 +494,7 @@ class PDFTextStripper extends jni.JObject { ) { _setSuppressDuplicateOverlappingText( reference.pointer, - _id_setSuppressDuplicateOverlappingText as jni.JMethodIDPtr, + _id_setSuppressDuplicateOverlappingText as _$jni.JMethodIDPtr, suppressDuplicateOverlappingTextValue ? 1 : 0) .check(); } @@ -494,16 +504,16 @@ class PDFTextStripper extends jni.JObject { r'()Z', ); - static final _getSeparateByBeads = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSeparateByBeads = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getSeparateByBeads()` @@ -512,7 +522,7 @@ class PDFTextStripper extends jni.JObject { ///@return If the text will be grouped by beads. bool getSeparateByBeads() { return _getSeparateByBeads( - reference.pointer, _id_getSeparateByBeads as jni.JMethodIDPtr) + reference.pointer, _id_getSeparateByBeads as _$jni.JMethodIDPtr) .boolean; } @@ -521,15 +531,15 @@ class PDFTextStripper extends jni.JObject { r'(Z)V', ); - static final _setShouldSeparateByBeads = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setShouldSeparateByBeads = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setShouldSeparateByBeads(boolean aShouldSeparateByBeads)` /// @@ -540,7 +550,7 @@ class PDFTextStripper extends jni.JObject { ) { _setShouldSeparateByBeads( reference.pointer, - _id_setShouldSeparateByBeads as jni.JMethodIDPtr, + _id_setShouldSeparateByBeads as _$jni.JMethodIDPtr, aShouldSeparateByBeads ? 1 : 0) .check(); } @@ -550,16 +560,16 @@ class PDFTextStripper extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;', ); - static final _getEndBookmark = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getEndBookmark = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getEndBookmark()` @@ -567,10 +577,10 @@ class PDFTextStripper extends jni.JObject { /// /// Get the bookmark where text extraction should end, inclusive. Default is null. ///@return The ending bookmark. - jni.JObject getEndBookmark() { + _$jni.JObject getEndBookmark() { return _getEndBookmark( - reference.pointer, _id_getEndBookmark as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getEndBookmark as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setEndBookmark = _class.instanceMethodId( @@ -578,25 +588,25 @@ class PDFTextStripper extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;)V', ); - static final _setEndBookmark = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setEndBookmark = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setEndBookmark(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem aEndBookmark)` /// /// Set the bookmark where the text extraction should stop. ///@param aEndBookmark The ending bookmark. void setEndBookmark( - jni.JObject aEndBookmark, + _$jni.JObject aEndBookmark, ) { - _setEndBookmark(reference.pointer, _id_setEndBookmark as jni.JMethodIDPtr, + _setEndBookmark(reference.pointer, _id_setEndBookmark as _$jni.JMethodIDPtr, aEndBookmark.reference.pointer) .check(); } @@ -606,16 +616,16 @@ class PDFTextStripper extends jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;', ); - static final _getStartBookmark = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getStartBookmark = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getStartBookmark()` @@ -623,10 +633,10 @@ class PDFTextStripper extends jni.JObject { /// /// Get the bookmark where text extraction should start, inclusive. Default is null. ///@return The starting bookmark. - jni.JObject getStartBookmark() { + _$jni.JObject getStartBookmark() { return _getStartBookmark( - reference.pointer, _id_getStartBookmark as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getStartBookmark as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setStartBookmark = _class.instanceMethodId( @@ -634,27 +644,27 @@ class PDFTextStripper extends jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;)V', ); - static final _setStartBookmark = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setStartBookmark = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setStartBookmark(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem aStartBookmark)` /// /// Set the bookmark where text extraction should start, inclusive. ///@param aStartBookmark The starting bookmark. void setStartBookmark( - jni.JObject aStartBookmark, + _$jni.JObject aStartBookmark, ) { _setStartBookmark( reference.pointer, - _id_setStartBookmark as jni.JMethodIDPtr, + _id_setStartBookmark as _$jni.JMethodIDPtr, aStartBookmark.reference.pointer) .check(); } @@ -664,16 +674,16 @@ class PDFTextStripper extends jni.JObject { r'()Z', ); - static final _getAddMoreFormatting = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getAddMoreFormatting = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getAddMoreFormatting()` @@ -682,7 +692,7 @@ class PDFTextStripper extends jni.JObject { ///@return true if some more text formatting will be added bool getAddMoreFormatting() { return _getAddMoreFormatting( - reference.pointer, _id_getAddMoreFormatting as jni.JMethodIDPtr) + reference.pointer, _id_getAddMoreFormatting as _$jni.JMethodIDPtr) .boolean; } @@ -691,15 +701,15 @@ class PDFTextStripper extends jni.JObject { r'(Z)V', ); - static final _setAddMoreFormatting = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setAddMoreFormatting = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setAddMoreFormatting(boolean newAddMoreFormatting)` /// @@ -710,7 +720,7 @@ class PDFTextStripper extends jni.JObject { ) { _setAddMoreFormatting( reference.pointer, - _id_setAddMoreFormatting as jni.JMethodIDPtr, + _id_setAddMoreFormatting as _$jni.JMethodIDPtr, newAddMoreFormatting ? 1 : 0) .check(); } @@ -720,16 +730,16 @@ class PDFTextStripper extends jni.JObject { r'()Z', ); - static final _getSortByPosition = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSortByPosition = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getSortByPosition()` @@ -738,7 +748,7 @@ class PDFTextStripper extends jni.JObject { ///@return true If the text tokens will be sorted before being written. bool getSortByPosition() { return _getSortByPosition( - reference.pointer, _id_getSortByPosition as jni.JMethodIDPtr) + reference.pointer, _id_getSortByPosition as _$jni.JMethodIDPtr) .boolean; } @@ -747,15 +757,15 @@ class PDFTextStripper extends jni.JObject { r'(Z)V', ); - static final _setSortByPosition = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setSortByPosition = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setSortByPosition(boolean newSortByPosition)` /// @@ -772,7 +782,7 @@ class PDFTextStripper extends jni.JObject { ) { _setSortByPosition( reference.pointer, - _id_setSortByPosition as jni.JMethodIDPtr, + _id_setSortByPosition as _$jni.JMethodIDPtr, newSortByPosition ? 1 : 0) .check(); } @@ -782,16 +792,16 @@ class PDFTextStripper extends jni.JObject { r'()F', ); - static final _getSpacingTolerance = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSpacingTolerance = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getSpacingTolerance()` @@ -801,7 +811,7 @@ class PDFTextStripper extends jni.JObject { ///@return The current tolerance / scaling factor double getSpacingTolerance() { return _getSpacingTolerance( - reference.pointer, _id_getSpacingTolerance as jni.JMethodIDPtr) + reference.pointer, _id_getSpacingTolerance as _$jni.JMethodIDPtr) .float; } @@ -810,15 +820,15 @@ class PDFTextStripper extends jni.JObject { r'(F)V', ); - static final _setSpacingTolerance = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setSpacingTolerance = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); /// from: `public void setSpacingTolerance(float spacingToleranceValue)` /// @@ -829,8 +839,10 @@ class PDFTextStripper extends jni.JObject { void setSpacingTolerance( double spacingToleranceValue, ) { - _setSpacingTolerance(reference.pointer, - _id_setSpacingTolerance as jni.JMethodIDPtr, spacingToleranceValue) + _setSpacingTolerance( + reference.pointer, + _id_setSpacingTolerance as _$jni.JMethodIDPtr, + spacingToleranceValue) .check(); } @@ -839,16 +851,16 @@ class PDFTextStripper extends jni.JObject { r'()F', ); - static final _getAverageCharTolerance = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getAverageCharTolerance = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getAverageCharTolerance()` @@ -857,8 +869,8 @@ class PDFTextStripper extends jni.JObject { /// be added. Note that the default value for this has been determined from trial and error. ///@return The current tolerance / scaling factor double getAverageCharTolerance() { - return _getAverageCharTolerance( - reference.pointer, _id_getAverageCharTolerance as jni.JMethodIDPtr) + return _getAverageCharTolerance(reference.pointer, + _id_getAverageCharTolerance as _$jni.JMethodIDPtr) .float; } @@ -867,15 +879,15 @@ class PDFTextStripper extends jni.JObject { r'(F)V', ); - static final _setAverageCharTolerance = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setAverageCharTolerance = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); /// from: `public void setAverageCharTolerance(float averageCharToleranceValue)` /// @@ -888,7 +900,7 @@ class PDFTextStripper extends jni.JObject { ) { _setAverageCharTolerance( reference.pointer, - _id_setAverageCharTolerance as jni.JMethodIDPtr, + _id_setAverageCharTolerance as _$jni.JMethodIDPtr, averageCharToleranceValue) .check(); } @@ -898,16 +910,16 @@ class PDFTextStripper extends jni.JObject { r'()F', ); - static final _getIndentThreshold = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getIndentThreshold = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getIndentThreshold()` @@ -917,7 +929,7 @@ class PDFTextStripper extends jni.JObject { ///@return the number of whitespace character widths to use when detecting paragraph indents. double getIndentThreshold() { return _getIndentThreshold( - reference.pointer, _id_getIndentThreshold as jni.JMethodIDPtr) + reference.pointer, _id_getIndentThreshold as _$jni.JMethodIDPtr) .float; } @@ -926,15 +938,15 @@ class PDFTextStripper extends jni.JObject { r'(F)V', ); - static final _setIndentThreshold = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setIndentThreshold = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); /// from: `public void setIndentThreshold(float indentThresholdValue)` /// @@ -946,7 +958,7 @@ class PDFTextStripper extends jni.JObject { double indentThresholdValue, ) { _setIndentThreshold(reference.pointer, - _id_setIndentThreshold as jni.JMethodIDPtr, indentThresholdValue) + _id_setIndentThreshold as _$jni.JMethodIDPtr, indentThresholdValue) .check(); } @@ -955,16 +967,16 @@ class PDFTextStripper extends jni.JObject { r'()F', ); - static final _getDropThreshold = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDropThreshold = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getDropThreshold()` @@ -974,7 +986,7 @@ class PDFTextStripper extends jni.JObject { ///@return the character height multiple for max allowed whitespace between lines in the same paragraph. double getDropThreshold() { return _getDropThreshold( - reference.pointer, _id_getDropThreshold as jni.JMethodIDPtr) + reference.pointer, _id_getDropThreshold as _$jni.JMethodIDPtr) .float; } @@ -983,15 +995,15 @@ class PDFTextStripper extends jni.JObject { r'(F)V', ); - static final _setDropThreshold = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setDropThreshold = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); /// from: `public void setDropThreshold(float dropThresholdValue)` /// @@ -1003,7 +1015,7 @@ class PDFTextStripper extends jni.JObject { double dropThresholdValue, ) { _setDropThreshold(reference.pointer, - _id_setDropThreshold as jni.JMethodIDPtr, dropThresholdValue) + _id_setDropThreshold as _$jni.JMethodIDPtr, dropThresholdValue) .check(); } @@ -1012,16 +1024,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getParagraphStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getParagraphStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getParagraphStart()` @@ -1029,10 +1041,10 @@ class PDFTextStripper extends jni.JObject { /// /// Returns the string which will be used at the beginning of a paragraph. ///@return the paragraph start string - jni.JString getParagraphStart() { + _$jni.JString getParagraphStart() { return _getParagraphStart( - reference.pointer, _id_getParagraphStart as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getParagraphStart as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setParagraphStart = _class.instanceMethodId( @@ -1040,26 +1052,26 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setParagraphStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setParagraphStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setParagraphStart(java.lang.String s)` /// /// Sets the string which will be used at the beginning of a paragraph. ///@param s the paragraph start string void setParagraphStart( - jni.JString s, + _$jni.JString s, ) { _setParagraphStart(reference.pointer, - _id_setParagraphStart as jni.JMethodIDPtr, s.reference.pointer) + _id_setParagraphStart as _$jni.JMethodIDPtr, s.reference.pointer) .check(); } @@ -1068,16 +1080,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getParagraphEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getParagraphEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getParagraphEnd()` @@ -1085,10 +1097,10 @@ class PDFTextStripper extends jni.JObject { /// /// Returns the string which will be used at the end of a paragraph. ///@return the paragraph end string - jni.JString getParagraphEnd() { + _$jni.JString getParagraphEnd() { return _getParagraphEnd( - reference.pointer, _id_getParagraphEnd as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getParagraphEnd as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setParagraphEnd = _class.instanceMethodId( @@ -1096,26 +1108,26 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setParagraphEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setParagraphEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setParagraphEnd(java.lang.String s)` /// /// Sets the string which will be used at the end of a paragraph. ///@param s the paragraph end string void setParagraphEnd( - jni.JString s, + _$jni.JString s, ) { - _setParagraphEnd(reference.pointer, _id_setParagraphEnd as jni.JMethodIDPtr, - s.reference.pointer) + _setParagraphEnd(reference.pointer, + _id_setParagraphEnd as _$jni.JMethodIDPtr, s.reference.pointer) .check(); } @@ -1124,16 +1136,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getPageStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getPageStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getPageStart()` @@ -1141,10 +1153,10 @@ class PDFTextStripper extends jni.JObject { /// /// Returns the string which will be used at the beginning of a page. ///@return the page start string - jni.JString getPageStart() { + _$jni.JString getPageStart() { return _getPageStart( - reference.pointer, _id_getPageStart as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getPageStart as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setPageStart = _class.instanceMethodId( @@ -1152,25 +1164,25 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setPageStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setPageStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setPageStart(java.lang.String pageStartValue)` /// /// Sets the string which will be used at the beginning of a page. ///@param pageStartValue the page start string void setPageStart( - jni.JString pageStartValue, + _$jni.JString pageStartValue, ) { - _setPageStart(reference.pointer, _id_setPageStart as jni.JMethodIDPtr, + _setPageStart(reference.pointer, _id_setPageStart as _$jni.JMethodIDPtr, pageStartValue.reference.pointer) .check(); } @@ -1180,16 +1192,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getPageEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getPageEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getPageEnd()` @@ -1197,9 +1209,9 @@ class PDFTextStripper extends jni.JObject { /// /// Returns the string which will be used at the end of a page. ///@return the page end string - jni.JString getPageEnd() { - return _getPageEnd(reference.pointer, _id_getPageEnd as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getPageEnd() { + return _getPageEnd(reference.pointer, _id_getPageEnd as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setPageEnd = _class.instanceMethodId( @@ -1207,25 +1219,25 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setPageEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setPageEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setPageEnd(java.lang.String pageEndValue)` /// /// Sets the string which will be used at the end of a page. ///@param pageEndValue the page end string void setPageEnd( - jni.JString pageEndValue, + _$jni.JString pageEndValue, ) { - _setPageEnd(reference.pointer, _id_setPageEnd as jni.JMethodIDPtr, + _setPageEnd(reference.pointer, _id_setPageEnd as _$jni.JMethodIDPtr, pageEndValue.reference.pointer) .check(); } @@ -1235,16 +1247,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getArticleStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getArticleStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getArticleStart()` @@ -1252,10 +1264,10 @@ class PDFTextStripper extends jni.JObject { /// /// Returns the string which will be used at the beginning of an article. ///@return the article start string - jni.JString getArticleStart() { + _$jni.JString getArticleStart() { return _getArticleStart( - reference.pointer, _id_getArticleStart as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getArticleStart as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setArticleStart = _class.instanceMethodId( @@ -1263,25 +1275,27 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setArticleStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setArticleStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setArticleStart(java.lang.String articleStartValue)` /// /// Sets the string which will be used at the beginning of an article. ///@param articleStartValue the article start string void setArticleStart( - jni.JString articleStartValue, + _$jni.JString articleStartValue, ) { - _setArticleStart(reference.pointer, _id_setArticleStart as jni.JMethodIDPtr, + _setArticleStart( + reference.pointer, + _id_setArticleStart as _$jni.JMethodIDPtr, articleStartValue.reference.pointer) .check(); } @@ -1291,16 +1305,16 @@ class PDFTextStripper extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getArticleEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getArticleEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getArticleEnd()` @@ -1308,10 +1322,10 @@ class PDFTextStripper extends jni.JObject { /// /// Returns the string which will be used at the end of an article. ///@return the article end string - jni.JString getArticleEnd() { + _$jni.JString getArticleEnd() { return _getArticleEnd( - reference.pointer, _id_getArticleEnd as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getArticleEnd as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setArticleEnd = _class.instanceMethodId( @@ -1319,52 +1333,57 @@ class PDFTextStripper extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setArticleEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setArticleEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setArticleEnd(java.lang.String articleEndValue)` /// /// Sets the string which will be used at the end of an article. ///@param articleEndValue the article end string void setArticleEnd( - jni.JString articleEndValue, + _$jni.JString articleEndValue, ) { - _setArticleEnd(reference.pointer, _id_setArticleEnd as jni.JMethodIDPtr, + _setArticleEnd(reference.pointer, _id_setArticleEnd as _$jni.JMethodIDPtr, articleEndValue.reference.pointer) .check(); } } -final class $PDFTextStripperType extends jni.JObjType { - const $PDFTextStripperType(); +final class $PDFTextStripper$Type extends _$jni.JObjType { + @_$jni.internal + const $PDFTextStripper$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lorg/apache/pdfbox/text/PDFTextStripper;'; - @override - PDFTextStripper fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + PDFTextStripper fromReference(_$jni.JReference reference) => PDFTextStripper.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($PDFTextStripperType).hashCode; + @_$core.override + int get hashCode => ($PDFTextStripper$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($PDFTextStripperType) && - other is $PDFTextStripperType; + return other.runtimeType == ($PDFTextStripper$Type) && + other is $PDFTextStripper$Type; } } diff --git a/pkgs/jnigen/lib/jnigen.dart b/pkgs/jnigen/lib/jnigen.dart index 4528ee32c..42d63c19c 100644 --- a/pkgs/jnigen/lib/jnigen.dart +++ b/pkgs/jnigen/lib/jnigen.dart @@ -5,7 +5,7 @@ /// This library exports a high level programmatic API to jnigen, the entry /// point of which is runJniGenTask function, which takes run configuration as /// a JniGenTask. -library jnigen; +library; export 'src/config/config.dart'; export 'src/config/filters.dart'; diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index cb1d0fcdb..1c7420c43 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart @@ -15,8 +15,11 @@ import 'resolver.dart'; import 'visitor.dart'; // Import prefixes. -const _jni = 'jni'; -const _ffi = 'ffi'; +const _jni = '_\$jni'; +const _core = '_\$core'; + +// dart:core types +const _override = '@$_core.override'; // package:jni types. const _jType = '$_jni.JObjType'; @@ -27,16 +30,14 @@ const _jArray = '$_jni.JArray'; const _jObject = '$_jni.JObject'; const _jResult = '$_jni.JniResult'; const _jThrowable = '$_jni.JThrowablePtr'; - -// package:ffi types. -const _voidPointer = '$_ffi.Pointer<$_ffi.Void>'; +const _methodInvocation = '$_jni.MethodInvocation'; +const _protectedExtension = '$_jni.ProtectedJniExtensions'; +const _voidPointer = '$_jni.Pointer<$_jni.Void>'; +const _internal = '@$_jni.internal'; // Prefixes and suffixes. const _typeParamPrefix = '\$'; -// Misc. -const _protectedExtension = 'ProtectedJniExtensions'; - /// Used for C bindings. const _selfPointer = 'reference.pointer'; @@ -124,11 +125,11 @@ class DartGenerator extends Visitor> { static const autoGeneratedNotice = '// Autogenerated by jnigen. ' 'DO NOT EDIT!\n\n'; static const defaultImports = ''' -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as $_core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as $_jni; +import 'package:jni/jni.dart' as $_jni; '''; @@ -141,12 +142,17 @@ import 'package:jni/jni.dart' as jni; // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -310,7 +316,7 @@ ${modifier}final $classRef = $_jni.JClass.forName(r'$internalName'); // Class definition. final name = node.finalName; final superName = node.superclass!.accept(_TypeGenerator(resolver)); - final implClassName = '\$${name}Impl'; + final implClassName = '\$$name'; final typeParamsDef = _encloseIfNotEmpty( '<', node.allTypeParams @@ -330,10 +336,10 @@ ${modifier}final $classRef = $_jni.JClass.forName(r'$internalName'); typeParams.join(', '), ')', ); - final typeClassesDef = typeParams - .map((typeParam) => - 'final $_jType<$_typeParamPrefix$typeParam> $typeParam;') - .join(_newLine(depth: 1)); + final typeClassesDef = typeParams.map((typeParam) => ''' + $_internal + final $_jType<$_typeParamPrefix$typeParam> $typeParam; +''').join('\n'); final ctorTypeClassesDef = typeParams .map((typeParam) => 'this.$typeParam,') .join(_newLine(depth: 2)); @@ -346,18 +352,22 @@ ${modifier}final $classRef = $_jni.JClass.forName(r'$internalName'); .join(_newLine(depth: 2)); s.write(''' class $name$typeParamsDef extends $superName { - @override - late final $_jType<$name$typeParamsCall> $instanceTypeGetter = $staticTypeGetter$staticTypeGetterCallArgs; + $_internal + $_override + final $_jType<$name$typeParamsCall> $instanceTypeGetter; $typeClassesDef + $_internal $name.fromReference( $ctorTypeClassesDef $_jReference reference, - ): super.fromReference( - $superTypeClassesCall - reference - ); + ) : + $instanceTypeGetter = $staticTypeGetter$staticTypeGetterCallArgs, + super.fromReference( + $superTypeClassesCall + reference + ); '''); @@ -397,19 +407,17 @@ class $name$typeParamsDef extends $superName { false)) { s.write(''' /// Maps a specific port to the implemented interface. - static final Map _\$impls = {}; + static final $_core.Map _\$impls = {}; '''); - s.write(r''' - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( + s.write(''' + static $_jni.JObjectPtr _\$invoke( int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, + $_jni.JObjectPtr descriptor, + $_jni.JObjectPtr args, ) { - return _$invokeMethod( + return _\$invokeMethod( port, - $MethodInvocation.fromAddresses( + $_methodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -417,19 +425,19 @@ class $name$typeParamsDef extends $superName { ); } - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + static final $_jni.Pointer< + $_jni.NativeFunction< + $_jni.JObjectPtr Function( + $_jni.Int64, $_jni.JObjectPtr, $_jni.JObjectPtr)>> + _\$invokePointer = $_jni.Pointer.fromFunction(_\$invoke); - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, + static $_jni.Pointer<$_jni.Void> _\$invokeMethod( + int \$p, + $_methodInvocation \$i, ) { try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; + final \$d = \$i.methodDescriptor.toDartString(releaseOriginal: true); + final \$a = \$i.args; '''); final proxyMethodIf = _InterfaceMethodIf(resolver, s); for (final method in node.methods) { @@ -439,39 +447,47 @@ class $name$typeParamsDef extends $superName { } catch (e) { return $_protectedExtension.newDartException(e); } - return jni.nullptr; + return $_jni.nullptr; } - factory $name.implement( + static void implementIn$typeParamsDef( + $_jni.JImplementer implementer, $implClassName$typeParamsCall \$impl, ) { -'''); - final typeClassesCall = typeParams - .map((typeParam) => '\$impl.$typeParam,') - .join(_newLine(depth: 3)); - s.write(''' - final \$p = ReceivePort(); - final \$x = $name.fromReference( - $typeClassesCall - $_protectedExtension.newPortProxy( - r'${node.binaryName}', - \$p, - _\$invokePointer, - ), - ).._\$p = \$p; - final \$a = \$p.sendPort.nativePort; - _\$impls[\$a] = \$impl; - \$p.listen((\$m) { + late final $_jni.RawReceivePort \$p; + \$p = $_jni.RawReceivePort((\$m) { if (\$m == null) { _\$impls.remove(\$p.sendPort.nativePort); \$p.close(); return; } - final \$i = \$MethodInvocation.fromMessage(\$m as List); + final \$i = $_methodInvocation.fromMessage(\$m); final \$r = _\$invokeMethod(\$p.sendPort.nativePort, \$i); $_protectedExtension.returnResult(\$i.result, \$r); }); - return \$x; + implementer.add( + r'${node.binaryName}', + \$p, + _\$invokePointer, + ); + final \$a = \$p.sendPort.nativePort; + _\$impls[\$a] = \$impl; + } + + factory $name.implement( + $implClassName$typeParamsCall \$impl, + ) { +'''); + final typeClassesCall = typeParams + .map((typeParam) => '\$impl.$typeParam,') + .join(_newLine(depth: 3)); + s.write(''' + final \$i = $_jni.JImplementer(); + implementIn(\$i, \$impl); + return $name.fromReference( + $typeClassesCall + \$i.implementReference(), + ); } '''); } @@ -537,7 +553,7 @@ abstract interface class $implClassName$typeParamsDef { '', ); final typeClassesDef = typeParams.map((typeParam) => ''' -@override +$_override final $_jType<\$$typeParam> $typeParam; ''').join(_newLine(depth: 1)); s.write(''' @@ -577,29 +593,34 @@ class _$implClassName$typeParamsDef implements $implClassName$typeParamsCall { final class $typeClassName$typeParamsDef extends $_jType<$name$typeParamsCall> { $typeClassesDef + $_internal const $typeClassName( $ctorTypeClassesDef ); - @override + $_internal + $_override String get signature => r'$signature'; - @override + $_internal + $_override $name$typeParamsCall fromReference($_jReference reference) => $name.fromReference( $typeClassesCall reference ); - @override + $_internal + $_override $_jType get superType => ${superTypeClass.name}; - @override + $_internal + $_override final superCount = ${node.superCount}; - @override + $_override int get hashCode => $hashCode; - @override + $_override bool operator ==(Object other) { return other.runtimeType == ($typeClassName$typeParamsCall) && other is $typeClassName$typeParamsCall$equalityTypeClasses; @@ -882,7 +903,7 @@ class _TypeSig extends TypeVisitor { @override String visitPrimitiveType(PrimitiveType node) { - if (isFfi) return node.ffiVarArgType; + if (isFfi) return '$_jni.${node.ffiVarArgType}'; if (node.name == 'boolean') return 'int'; return node.dartType; } @@ -1014,7 +1035,7 @@ class _MethodTypeSig extends Visitor { _voidPointer, '$_jni.JMethodIDPtr', isFfi && callParams.isNotEmpty - ? '$_ffi.VarArgs<($callParams${node.params.length == 1 ? ',' : ''})>' + ? '$_jni.VarArgs<($callParams${node.params.length == 1 ? ',' : ''})>' : callParams ].join(', '); final isCtor = node.isConstructor; @@ -1064,7 +1085,7 @@ ${modifier}final _id_$name = $classRef.${kind}Id( s.write(''' ${modifier}final _$name = $_protectedExtension - .lookup<$_ffi.NativeFunction<$ffiSig>>('$methodName') + .lookup<$_jni.NativeFunction<$ffiSig>>('$methodName') .asFunction<$dartSig>(); '''); } @@ -1185,7 +1206,8 @@ ${modifier}final _$name = $_protectedExtension final name = node.finalName; final returnType = isSuspendFun(node) - ? 'Future<${node.asyncReturnType!.accept(_TypeGenerator(resolver))}>' + ? '$_core.Future<' + '${node.asyncReturnType!.accept(_TypeGenerator(resolver))}>' : node.returnType.accept(_TypeGenerator(resolver)); final returnTypeClass = (node.asyncReturnType ?? node.returnType) .accept(_TypeClassGenerator(resolver)) @@ -1219,7 +1241,7 @@ ${modifier}final _$name = $_protectedExtension node.asyncReturnType!.accept(_TypeClassGenerator(resolver)).name; s.write('''async { $typeInference - final \$p = ReceivePort(); + final \$p = $_jni.ReceivePort(); final \$c = $_jObject.fromReference($_protectedExtension.newPortContinuation(\$p)); $callExpr; final \$o = $_jGlobalReference($_jPointer.fromAddress(await \$p.first)); @@ -1358,13 +1380,13 @@ class OutsideInBuffer { /// /// For example in `JArray> a`, `T` can be retreived using /// ```dart -/// ((((a.$type as jni.JArrayType).elementType) as $JMapType).K) -/// as jni.JObjType<$T> +/// ((((a.$type as JArrayType).elementType) as $JMapType).K) +/// as JObjType<$T> /// ``` /// and /// ```dart -/// ((((a.$type as jni.JArrayType).elementType) as $JMapType).V) -/// as jni.JObjType<$T> +/// ((((a.$type as JArrayType).elementType) as $JMapType).V) +/// as JObjType<$T> /// ``` class _ParamTypeLocator extends Visitor>> { final Resolver resolver; @@ -1568,7 +1590,7 @@ class _InterfaceParamCast extends Visitor { typeVarFromMap: true, )) .name; - s.write('\$a[$paramIndex].castTo($typeClass, releaseOriginal: true)'); + s.write('\$a[$paramIndex].as($typeClass, releaseOriginal: true)'); if (node.type.kind == Kind.primitive) { // Convert to Dart type. final name = (node.type.type as PrimitiveType).name; @@ -1599,7 +1621,7 @@ class _InterfaceReturnBox extends TypeVisitor { // Casting is done to create a new global reference. The user might // use the original reference elsewhere and so the original object // should not be `setAsReleased`. - return '(\$r as $_jObject).castTo(const ${_jObject}Type())' + return '(\$r as $_jObject).as(const ${_jObject}Type())' '.reference.toPointer()'; } diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index d8268fd73..b5a0b34c2 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart @@ -7,70 +7,80 @@ import '../elements/elements.dart'; import '../logging/logging.dart'; import 'visitor.dart'; -const Set _keywords = { - 'abstract', - 'as', - 'assert', - 'async', - 'await', - 'break', - 'case', - 'catch', - 'class', - 'const', - 'continue', - 'covariant', - 'default', - 'deferred', - 'do', - 'dynamic', - 'else', - 'enum', - 'export', - 'extends', - 'extension', - 'external', - 'factory', - 'false', - 'final', - 'finally', - 'for', - 'Function', - 'get', - 'hide', - 'if', - 'implements', - 'import', - 'in', - 'interface', - 'is', - 'late', - 'library', - 'mixin', - 'new', - 'null', - 'on', - 'operator', - 'part', - 'required', - 'rethrow', - 'return', - 'set', - 'show', - 'static', - 'super', - 'switch', - 'sync', - 'this', - 'throw', - 'true', - 'try', - 'typedef', - 'var', - 'void', - 'while', - 'with', - 'yield', +class _Allowed { + static const none = 0; + static const fields = 1 << 0; + static const methods = 1 << 1; + static const classes = 1 << 2; + static const all = fields | methods | classes; +} + +enum _ElementKind { + field, + method, + klass; + + bool isAllowed(String identifier) { + return 1 << index & (_keywords[identifier] ?? _Allowed.all) != 0; + } +} + +const _keywords = { + 'abstract': _Allowed.fields | _Allowed.methods, + 'assert': _Allowed.none, + 'await': _Allowed.none, // Cannot be used in async context + 'break': _Allowed.none, + 'case': _Allowed.none, + 'catch': _Allowed.none, + 'class': _Allowed.none, + 'const': _Allowed.none, + 'continue': _Allowed.none, + 'covariant': _Allowed.fields | _Allowed.methods, + 'default': _Allowed.none, + 'deferred': _Allowed.fields | _Allowed.methods, + 'do': _Allowed.none, + 'dynamic': _Allowed.fields | _Allowed.methods, + 'else': _Allowed.none, + 'enum': _Allowed.none, + 'export': _Allowed.fields | _Allowed.methods, + 'extends': _Allowed.none, + 'extension': _Allowed.fields | _Allowed.methods, + 'external': _Allowed.fields | _Allowed.methods, + 'factory': _Allowed.fields | _Allowed.fields, + 'false': _Allowed.none, + 'final': _Allowed.none, + 'finally': _Allowed.none, + 'for': _Allowed.none, + 'Function': _Allowed.fields | _Allowed.methods, + 'if': _Allowed.none, + 'implements': _Allowed.fields | _Allowed.methods, + 'import': _Allowed.methods, + 'in': _Allowed.none, + 'interface': _Allowed.fields | _Allowed.methods, + 'is': _Allowed.none, + 'late': _Allowed.fields | _Allowed.methods, + 'library': _Allowed.fields | _Allowed.methods, + 'mixin': _Allowed.fields | _Allowed.methods, + 'new': _Allowed.none, + 'null': _Allowed.none, + 'operator': _Allowed.fields | _Allowed.methods, + 'part': _Allowed.fields | _Allowed.methods, + 'required': _Allowed.fields | _Allowed.methods, + 'rethrow': _Allowed.none, + 'return': _Allowed.none, + 'static': _Allowed.fields | _Allowed.methods, + 'super': _Allowed.none, + 'switch': _Allowed.none, + 'this': _Allowed.none, + 'throw': _Allowed.none, + 'true': _Allowed.none, + 'try': _Allowed.none, + 'typedef': _Allowed.fields | _Allowed.methods, + 'var': _Allowed.none, + 'void': _Allowed.none, + 'while': _Allowed.none, + 'with': _Allowed.none, + 'yield': _Allowed.none, // Cannot be used in async context }; /// Methods & properties already defined by dart JObject base class. @@ -78,6 +88,7 @@ const Set _keywords = { /// If a second method or field has the same name, it will be appended by a /// numeric suffix. const Map _definedSyms = { + 'as': 1, 'fromReference': 1, 'toString': 1, 'hashCode': 1, @@ -111,10 +122,11 @@ String _preprocess(String name) { /// Examples: /// * `yield` -> `yield$` /// * `foo` -> `foo` -String _keywordRename(String name) => - _keywords.contains(name) ? '$name\$' : name; +String _keywordRename(String name, _ElementKind kind) => + kind.isAllowed(name) ? name : '$name\$'; -String _renameConflict(Map counts, String name) { +String _renameConflict( + Map counts, String name, _ElementKind kind) { if (counts.containsKey(name)) { final count = counts[name]!; final renamed = '$name\$$count'; @@ -122,7 +134,7 @@ String _renameConflict(Map counts, String name) { return renamed; } counts[name] = 1; - return _keywordRename(name); + return _keywordRename(name, kind); } class Renamer implements Visitor { @@ -157,6 +169,10 @@ class _ClassRenamer implements Visitor { renamed.add(node); nameCounts[node] = {..._definedSyms}; + if (node.declKind == DeclKind.interfaceKind) { + nameCounts[node]!['implement'] = 1; + nameCounts[node]!['implementIn'] = 1; + } node.methodNumsAfterRenaming = {}; // TODO(https://github.com/dart-lang/native/issues/1516): Nested classes @@ -169,10 +185,10 @@ class _ClassRenamer implements Visitor { // the names need to be unique. final uniquifyName = config.outputConfig.dartConfig.structure == OutputStructure.singleFile; - node.finalName = - uniquifyName ? _renameConflict(classNameCounts, className) : className; - // TODO(#143): $ at the beginning is a temporary fix for the name collision. - node.typeClassName = '\$${node.finalName}Type'; + node.finalName = uniquifyName + ? _renameConflict(classNameCounts, className, _ElementKind.klass) + : className; + node.typeClassName = '\$${node.finalName}\$Type'; log.fine('Class ${node.binaryName} is named ${node.finalName}'); final superClass = (node.superclass!.type as DeclaredType).classDecl; @@ -215,11 +231,12 @@ class _MethodRenamer implements Visitor { // Don't rename if superNum == 0 // Unless the node name is a keyword. final superNumText = superNum == 0 ? '' : '$superNum'; - final methodName = superNum == 0 ? _keywordRename(name) : name; + final methodName = + superNum == 0 ? _keywordRename(name, _ElementKind.method) : name; node.finalName = '$methodName$superNumText'; node.classDecl.methodNumsAfterRenaming[sig] = superNum; } else { - node.finalName = _renameConflict(nameCounts, name); + node.finalName = _renameConflict(nameCounts, name, _ElementKind.method); node.classDecl.methodNumsAfterRenaming[sig] = nameCounts[name]! - 1; } log.fine('Method ${node.classDecl.binaryName}#${node.name}' @@ -248,7 +265,7 @@ class _FieldRenamer implements Visitor { @override void visit(Field node) { final fieldName = _preprocess(node.name); - node.finalName = _renameConflict(nameCounts, fieldName); + node.finalName = _renameConflict(nameCounts, fieldName, _ElementKind.field); log.fine('Field ${node.classDecl.binaryName}#${node.name}' ' is named ${node.finalName}'); } @@ -261,6 +278,6 @@ class _ParamRenamer implements Visitor { @override void visit(Param node) { - node.finalName = _keywordRename(node.name); + node.finalName = _keywordRename(node.name, _ElementKind.field); } } diff --git a/pkgs/jnigen/lib/src/bindings/resolver.dart b/pkgs/jnigen/lib/src/bindings/resolver.dart index 1ad96d729..a6805237c 100644 --- a/pkgs/jnigen/lib/src/bindings/resolver.dart +++ b/pkgs/jnigen/lib/src/bindings/resolver.dart @@ -51,8 +51,7 @@ class Resolver { /// Get the prefix for the class String resolvePrefix(ClassDecl classDecl) { if (classDecl.path == 'package:jni/jni.dart') { - // For package:jni we don't use a leading underscore. - return 'jni.'; + return '_\$jni.'; } final binaryName = classDecl.binaryName; final target = getFileClassName(binaryName); diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart index 8065d5683..b22656216 100644 --- a/pkgs/jnigen/lib/src/elements/elements.dart +++ b/pkgs/jnigen/lib/src/elements/elements.dart @@ -270,7 +270,7 @@ class PrimitiveType extends ReferredType { dartType: 'int', boxedName: 'Byte', cType: 'int8_t', - ffiVarArgType: '\$Int32', + ffiVarArgType: 'Int32', ), 'short': PrimitiveType._( name: 'short', @@ -278,7 +278,7 @@ class PrimitiveType extends ReferredType { dartType: 'int', boxedName: 'Short', cType: 'int16_t', - ffiVarArgType: '\$Int32', + ffiVarArgType: 'Int32', ), 'char': PrimitiveType._( name: 'char', @@ -286,7 +286,7 @@ class PrimitiveType extends ReferredType { dartType: 'int', boxedName: 'Character', cType: 'uint16_t', - ffiVarArgType: '\$Int32', + ffiVarArgType: 'Int32', ), 'int': PrimitiveType._( name: 'int', @@ -294,7 +294,7 @@ class PrimitiveType extends ReferredType { dartType: 'int', boxedName: 'Integer', cType: 'int32_t', - ffiVarArgType: '\$Int32', + ffiVarArgType: 'Int32', ), 'long': PrimitiveType._( name: 'long', @@ -302,7 +302,7 @@ class PrimitiveType extends ReferredType { dartType: 'int', boxedName: 'Long', cType: 'int64_t', - ffiVarArgType: 'ffi.Int64', + ffiVarArgType: 'Int64', ), 'float': PrimitiveType._( name: 'float', @@ -310,7 +310,7 @@ class PrimitiveType extends ReferredType { dartType: 'double', boxedName: 'Float', cType: 'float', - ffiVarArgType: 'ffi.Double', + ffiVarArgType: 'Double', ), 'double': PrimitiveType._( name: 'double', @@ -318,7 +318,7 @@ class PrimitiveType extends ReferredType { dartType: 'double', boxedName: 'Double', cType: 'double', - ffiVarArgType: 'ffi.Double', + ffiVarArgType: 'Double', ), 'boolean': PrimitiveType._( name: 'boolean', @@ -326,7 +326,7 @@ class PrimitiveType extends ReferredType { dartType: 'bool', boxedName: 'Boolean', cType: 'uint8_t', - ffiVarArgType: '\$Int32', + ffiVarArgType: 'Int32', ), 'void': PrimitiveType._( name: 'void', @@ -334,7 +334,7 @@ class PrimitiveType extends ReferredType { dartType: 'void', boxedName: 'Void', // Not used. cType: 'void', - ffiVarArgType: 'ffi.Void', // Not used. + ffiVarArgType: 'Void', // Not used. ), }; diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index 37c75980f..a99beac93 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml @@ -18,20 +18,20 @@ topics: - jni dependencies: - args: ^2.3.0 + args: ^2.5.0 cli_config: '>=0.1.0 <0.3.0' json_annotation: ^4.9.0 - logging: ^1.0.2 - meta: ^1.8.0 + logging: ^1.2.0 + meta: ^1.15.0 package_config: ^2.1.0 - path: ^1.8.0 + path: ^1.9.0 pub_semver: ^2.1.4 - yaml: ^3.1.0 + yaml: ^3.1.2 dev_dependencies: - build_runner: ^2.2.0 - dart_flutter_team_lints: ^2.0.0 + build_runner: ^2.4.12 + dart_flutter_team_lints: ^3.2.0 jni: path: ../jni json_serializable: ^6.8.0 - test: ^1.24.1 + test: ^1.25.8 diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart index 574d4fd1e..67b312dc2 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -24,12 +24,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -39,11 +44,11 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; import 'JsonParser.dart' as jsonparser_; @@ -51,41 +56,44 @@ import 'JsonParser.dart' as jsonparser_; /// /// 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; +class JsonFactory_Feature extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal JsonFactory_Feature.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory$Feature'); + _$jni.JClass.forName(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 const type = $JsonFactory_Feature$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($JsonFactory_FeatureType())); + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($JsonFactory_Feature$Type())); } static final _id_valueOf = _class.staticMethodId( @@ -93,25 +101,25 @@ class JsonFactory_Feature extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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, + _$jni.JString name, ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, name.reference.pointer) - .object(const $JsonFactory_FeatureType()); + .object(const $JsonFactory_Feature$Type()); } static final _id_collectDefaults = _class.staticMethodId( @@ -119,16 +127,16 @@ class JsonFactory_Feature extends jni.JObject { r'()I', ); - static final _collectDefaults = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _collectDefaults = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public int collectDefaults()` @@ -138,7 +146,7 @@ class JsonFactory_Feature extends jni.JObject { ///@return Bit field of features enabled by default static int collectDefaults() { return _collectDefaults( - _class.reference.pointer, _id_collectDefaults as jni.JMethodIDPtr) + _class.reference.pointer, _id_collectDefaults as _$jni.JMethodIDPtr) .integer; } @@ -147,22 +155,22 @@ class JsonFactory_Feature extends jni.JObject { r'()Z', ); - static final _enabledByDefault = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _enabledByDefault = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean enabledByDefault()` bool enabledByDefault() { return _enabledByDefault( - reference.pointer, _id_enabledByDefault as jni.JMethodIDPtr) + reference.pointer, _id_enabledByDefault as _$jni.JMethodIDPtr) .boolean; } @@ -171,20 +179,23 @@ class JsonFactory_Feature extends jni.JObject { r'(I)Z', ); - static final _enabledIn = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _enabledIn = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public boolean enabledIn(int flags)` bool enabledIn( int flags, ) { return _enabledIn( - reference.pointer, _id_enabledIn as jni.JMethodIDPtr, flags) + reference.pointer, _id_enabledIn as _$jni.JMethodIDPtr, flags) .boolean; } @@ -193,47 +204,54 @@ class JsonFactory_Feature extends jni.JObject { r'()I', ); - static final _getMask = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getMask = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getMask()` int getMask() { - return _getMask(reference.pointer, _id_getMask as jni.JMethodIDPtr).integer; + return _getMask(reference.pointer, _id_getMask as _$jni.JMethodIDPtr) + .integer; } } -final class $JsonFactory_FeatureType extends jni.JObjType { - const $JsonFactory_FeatureType(); +final class $JsonFactory_Feature$Type + extends _$jni.JObjType { + @_$jni.internal + const $JsonFactory_Feature$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;'; - @override - JsonFactory_Feature fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + JsonFactory_Feature fromReference(_$jni.JReference reference) => JsonFactory_Feature.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonFactory_FeatureType).hashCode; + @_$core.override + int get hashCode => ($JsonFactory_Feature$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonFactory_FeatureType) && - other is $JsonFactory_FeatureType; + return other.runtimeType == ($JsonFactory_Feature$Type) && + other is $JsonFactory_Feature$Type; } } @@ -256,19 +274,22 @@ final class $JsonFactory_FeatureType extends jni.JObjType { /// the default constructor is used for constructing factory /// instances. ///@author Tatu Saloranta -class JsonFactory extends jni.JObject { - @override - late final jni.JObjType $type = type; +class JsonFactory extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal JsonFactory.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory'); + _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory'); /// The type which includes information such as the signature of this class. - static const type = $JsonFactoryType(); + static const type = $JsonFactory$Type(); static final _id_FORMAT_NAME_JSON = _class.staticFieldId( r'FORMAT_NAME_JSON', r'Ljava/lang/String;', @@ -279,8 +300,8 @@ class JsonFactory extends jni.JObject { /// /// Name used to identify JSON format /// (and returned by \#getFormatName() - static jni.JString get FORMAT_NAME_JSON => - _id_FORMAT_NAME_JSON.get(_class, const jni.JStringType()); + static _$jni.JString get FORMAT_NAME_JSON => + _id_FORMAT_NAME_JSON.get(_class, const _$jni.JStringType()); static final _id_DEFAULT_ROOT_VALUE_SEPARATOR = _class.staticFieldId( r'DEFAULT_ROOT_VALUE_SEPARATOR', @@ -289,8 +310,8 @@ class JsonFactory extends jni.JObject { /// from: `static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR` /// The returned object must be released after use, by calling the [release] method. - static jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => - _id_DEFAULT_ROOT_VALUE_SEPARATOR.get(_class, const jni.JObjectType()); + static _$jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => + _id_DEFAULT_ROOT_VALUE_SEPARATOR.get(_class, const _$jni.JObjectType()); /// from: `static public final char DEFAULT_QUOTE_CHAR` /// @@ -300,16 +321,16 @@ class JsonFactory extends jni.JObject { r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` @@ -325,7 +346,7 @@ class JsonFactory extends jni.JObject { /// factory instance. factory JsonFactory() { return JsonFactory.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -333,24 +354,24 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/ObjectCodec;)V', ); - static final _new$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (com.fasterxml.jackson.core.ObjectCodec oc)` /// The returned object must be released after use, by calling the [release] method. factory JsonFactory.new$1( - jni.JObject oc, + _$jni.JObject oc, ) { return JsonFactory.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as jni.JMethodIDPtr, oc.reference.pointer) + _id_new$1 as _$jni.JMethodIDPtr, oc.reference.pointer) .reference); } @@ -358,16 +379,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactoryBuilder;)V', ); - static final _new$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (com.fasterxml.jackson.core.JsonFactoryBuilder b)` /// The returned object must be released after use, by calling the [release] method. @@ -376,10 +397,10 @@ class JsonFactory extends jni.JObject { ///@param b Builder that contains settings to use ///@since 2.10 factory JsonFactory.new$2( - jni.JObject b, + _$jni.JObject b, ) { return JsonFactory.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as jni.JMethodIDPtr, b.reference.pointer) + _id_new$2 as _$jni.JMethodIDPtr, b.reference.pointer) .reference); } @@ -388,16 +409,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/TSFBuilder;', ); - static final _rebuild = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _rebuild = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.TSFBuilder rebuild()` @@ -407,9 +428,9 @@ class JsonFactory extends jni.JObject { /// with settings of this factory. ///@return Builder instance to use ///@since 2.10 - jni.JObject rebuild() { - return _rebuild(reference.pointer, _id_rebuild as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject rebuild() { + return _rebuild(reference.pointer, _id_rebuild as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_builder = _class.staticMethodId( @@ -417,16 +438,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/TSFBuilder;', ); - static final _builder = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _builder = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.TSFBuilder builder()` @@ -440,9 +461,9 @@ class JsonFactory extends jni.JObject { /// NOTE: signature unfortunately does not expose true implementation type; this /// will be fixed in 3.0. ///@return Builder instance to use - static jni.JObject builder() { - return _builder(_class.reference.pointer, _id_builder as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + static _$jni.JObject builder() { + return _builder(_class.reference.pointer, _id_builder as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_copy = _class.instanceMethodId( @@ -450,16 +471,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _copy = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _copy = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonFactory copy()` @@ -478,8 +499,8 @@ class JsonFactory extends jni.JObject { ///@return Copy of this factory instance ///@since 2.1 JsonFactory copy() { - return _copy(reference.pointer, _id_copy as jni.JMethodIDPtr) - .object(const $JsonFactoryType()); + return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr) + .object(const $JsonFactory$Type()); } static final _id_requiresPropertyOrdering = _class.instanceMethodId( @@ -487,16 +508,16 @@ class JsonFactory extends jni.JObject { r'()Z', ); - static final _requiresPropertyOrdering = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _requiresPropertyOrdering = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean requiresPropertyOrdering()` @@ -516,8 +537,8 @@ class JsonFactory extends jni.JObject { /// requires Object properties to be ordered. ///@since 2.3 bool requiresPropertyOrdering() { - return _requiresPropertyOrdering( - reference.pointer, _id_requiresPropertyOrdering as jni.JMethodIDPtr) + return _requiresPropertyOrdering(reference.pointer, + _id_requiresPropertyOrdering as _$jni.JMethodIDPtr) .boolean; } @@ -526,16 +547,16 @@ class JsonFactory extends jni.JObject { r'()Z', ); - static final _canHandleBinaryNatively = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _canHandleBinaryNatively = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean canHandleBinaryNatively()` @@ -552,8 +573,8 @@ class JsonFactory extends jni.JObject { /// supports native binary content ///@since 2.3 bool canHandleBinaryNatively() { - return _canHandleBinaryNatively( - reference.pointer, _id_canHandleBinaryNatively as jni.JMethodIDPtr) + return _canHandleBinaryNatively(reference.pointer, + _id_canHandleBinaryNatively as _$jni.JMethodIDPtr) .boolean; } @@ -562,16 +583,16 @@ class JsonFactory extends jni.JObject { r'()Z', ); - static final _canUseCharArrays = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _canUseCharArrays = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean canUseCharArrays()` @@ -589,7 +610,7 @@ class JsonFactory extends jni.JObject { ///@since 2.4 bool canUseCharArrays() { return _canUseCharArrays( - reference.pointer, _id_canUseCharArrays as jni.JMethodIDPtr) + reference.pointer, _id_canUseCharArrays as _$jni.JMethodIDPtr) .boolean; } @@ -598,16 +619,16 @@ class JsonFactory extends jni.JObject { r'()Z', ); - static final _canParseAsync = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _canParseAsync = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean canParseAsync()` @@ -621,7 +642,7 @@ class JsonFactory extends jni.JObject { ///@since 2.9 bool canParseAsync() { return _canParseAsync( - reference.pointer, _id_canParseAsync as jni.JMethodIDPtr) + reference.pointer, _id_canParseAsync as _$jni.JMethodIDPtr) .boolean; } @@ -630,24 +651,24 @@ class JsonFactory extends jni.JObject { r'()Ljava/lang/Class;', ); - static final _getFormatReadFeatureType = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFormatReadFeatureType = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Class getFormatReadFeatureType()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject getFormatReadFeatureType() { - return _getFormatReadFeatureType( - reference.pointer, _id_getFormatReadFeatureType as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getFormatReadFeatureType() { + return _getFormatReadFeatureType(reference.pointer, + _id_getFormatReadFeatureType as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getFormatWriteFeatureType = _class.instanceMethodId( @@ -655,24 +676,24 @@ class JsonFactory extends jni.JObject { r'()Ljava/lang/Class;', ); - static final _getFormatWriteFeatureType = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFormatWriteFeatureType = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Class getFormatWriteFeatureType()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject getFormatWriteFeatureType() { + _$jni.JObject getFormatWriteFeatureType() { return _getFormatWriteFeatureType(reference.pointer, - _id_getFormatWriteFeatureType as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _id_getFormatWriteFeatureType as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_canUseSchema = _class.instanceMethodId( @@ -680,16 +701,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/FormatSchema;)Z', ); - static final _canUseSchema = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _canUseSchema = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)` /// @@ -703,10 +724,10 @@ class JsonFactory extends jni.JObject { ///@return Whether parsers and generators constructed by this factory /// can use specified format schema instance bool canUseSchema( - jni.JObject schema, + _$jni.JObject schema, ) { return _canUseSchema(reference.pointer, - _id_canUseSchema as jni.JMethodIDPtr, schema.reference.pointer) + _id_canUseSchema as _$jni.JMethodIDPtr, schema.reference.pointer) .boolean; } @@ -715,16 +736,16 @@ class JsonFactory extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getFormatName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFormatName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getFormatName()` @@ -736,10 +757,10 @@ class JsonFactory extends jni.JObject { /// Note: sub-classes should override this method; default /// implementation will return null for all sub-classes ///@return Name of the format handled by parsers, generators this factory creates - jni.JString getFormatName() { + _$jni.JString getFormatName() { return _getFormatName( - reference.pointer, _id_getFormatName as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getFormatName as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_hasFormat = _class.instanceMethodId( @@ -747,25 +768,25 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/format/InputAccessor;)Lcom/fasterxml/jackson/core/format/MatchStrength;', ); - static final _hasFormat = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _hasFormat = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)` /// The returned object must be released after use, by calling the [release] method. - jni.JObject hasFormat( - jni.JObject acc, + _$jni.JObject hasFormat( + _$jni.JObject acc, ) { - return _hasFormat(reference.pointer, _id_hasFormat as jni.JMethodIDPtr, + return _hasFormat(reference.pointer, _id_hasFormat as _$jni.JMethodIDPtr, acc.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_requiresCustomCodec = _class.instanceMethodId( @@ -773,16 +794,16 @@ class JsonFactory extends jni.JObject { r'()Z', ); - static final _requiresCustomCodec = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _requiresCustomCodec = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean requiresCustomCodec()` @@ -798,7 +819,7 @@ class JsonFactory extends jni.JObject { ///@since 2.1 bool requiresCustomCodec() { return _requiresCustomCodec( - reference.pointer, _id_requiresCustomCodec as jni.JMethodIDPtr) + reference.pointer, _id_requiresCustomCodec as _$jni.JMethodIDPtr) .boolean; } @@ -807,23 +828,23 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/Version;', ); - static final _version = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _version = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.Version version()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject version() { - return _version(reference.pointer, _id_version as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject version() { + return _version(reference.pointer, _id_version as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_configure = _class.instanceMethodId( @@ -831,16 +852,17 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _configure = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _configure = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -855,9 +877,9 @@ class JsonFactory extends jni.JObject { JsonFactory_Feature f, bool state, ) { - return _configure(reference.pointer, _id_configure as jni.JMethodIDPtr, + return _configure(reference.pointer, _id_configure as _$jni.JMethodIDPtr, f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_enable = _class.instanceMethodId( @@ -865,16 +887,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _enable = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _enable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -887,9 +909,9 @@ class JsonFactory extends jni.JObject { JsonFactory enable( JsonFactory_Feature f, ) { - return _enable(reference.pointer, _id_enable as jni.JMethodIDPtr, + return _enable(reference.pointer, _id_enable as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_disable = _class.instanceMethodId( @@ -897,16 +919,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _disable = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _disable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -919,9 +941,9 @@ class JsonFactory extends jni.JObject { JsonFactory disable( JsonFactory_Feature f, ) { - return _disable(reference.pointer, _id_disable as jni.JMethodIDPtr, + return _disable(reference.pointer, _id_disable as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_isEnabled = _class.instanceMethodId( @@ -929,16 +951,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Z', ); - static final _isEnabled = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonFactory.Feature f)` /// @@ -948,7 +970,7 @@ class JsonFactory extends jni.JObject { bool isEnabled( JsonFactory_Feature f, ) { - return _isEnabled(reference.pointer, _id_isEnabled as jni.JMethodIDPtr, + return _isEnabled(reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -958,22 +980,22 @@ class JsonFactory extends jni.JObject { r'()I', ); - static final _getParserFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getParserFeatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final int getParserFeatures()` int getParserFeatures() { return _getParserFeatures( - reference.pointer, _id_getParserFeatures as jni.JMethodIDPtr) + reference.pointer, _id_getParserFeatures as _$jni.JMethodIDPtr) .integer; } @@ -982,22 +1004,22 @@ class JsonFactory extends jni.JObject { r'()I', ); - static final _getGeneratorFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getGeneratorFeatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final int getGeneratorFeatures()` int getGeneratorFeatures() { return _getGeneratorFeatures( - reference.pointer, _id_getGeneratorFeatures as jni.JMethodIDPtr) + reference.pointer, _id_getGeneratorFeatures as _$jni.JMethodIDPtr) .integer; } @@ -1006,22 +1028,22 @@ class JsonFactory extends jni.JObject { r'()I', ); - static final _getFormatParserFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFormatParserFeatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getFormatParserFeatures()` int getFormatParserFeatures() { - return _getFormatParserFeatures( - reference.pointer, _id_getFormatParserFeatures as jni.JMethodIDPtr) + return _getFormatParserFeatures(reference.pointer, + _id_getFormatParserFeatures as _$jni.JMethodIDPtr) .integer; } @@ -1030,22 +1052,23 @@ class JsonFactory extends jni.JObject { r'()I', ); - static final _getFormatGeneratorFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _getFormatGeneratorFeatures = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `public int getFormatGeneratorFeatures()` int getFormatGeneratorFeatures() { return _getFormatGeneratorFeatures(reference.pointer, - _id_getFormatGeneratorFeatures as jni.JMethodIDPtr) + _id_getFormatGeneratorFeatures as _$jni.JMethodIDPtr) .integer; } @@ -1054,16 +1077,17 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _configure$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _configure$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -1077,9 +1101,12 @@ class JsonFactory extends jni.JObject { jsonparser_.JsonParser_Feature f, bool state, ) { - return _configure$1(reference.pointer, _id_configure$1 as jni.JMethodIDPtr, - f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactoryType()); + return _configure$1( + reference.pointer, + _id_configure$1 as _$jni.JMethodIDPtr, + f.reference.pointer, + state ? 1 : 0) + .object(const $JsonFactory$Type()); } static final _id_enable$1 = _class.instanceMethodId( @@ -1087,16 +1114,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _enable$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _enable$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1108,9 +1135,9 @@ class JsonFactory extends jni.JObject { JsonFactory enable$1( jsonparser_.JsonParser_Feature f, ) { - return _enable$1(reference.pointer, _id_enable$1 as jni.JMethodIDPtr, + return _enable$1(reference.pointer, _id_enable$1 as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_disable$1 = _class.instanceMethodId( @@ -1118,16 +1145,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _disable$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _disable$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1139,9 +1166,9 @@ class JsonFactory extends jni.JObject { JsonFactory disable$1( jsonparser_.JsonParser_Feature f, ) { - return _disable$1(reference.pointer, _id_disable$1 as jni.JMethodIDPtr, + return _disable$1(reference.pointer, _id_disable$1 as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_isEnabled$1 = _class.instanceMethodId( @@ -1149,16 +1176,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Z', ); - static final _isEnabled$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)` /// @@ -1168,8 +1195,8 @@ class JsonFactory extends jni.JObject { bool isEnabled$1( jsonparser_.JsonParser_Feature f, ) { - return _isEnabled$1(reference.pointer, _id_isEnabled$1 as jni.JMethodIDPtr, - f.reference.pointer) + return _isEnabled$1(reference.pointer, + _id_isEnabled$1 as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -1178,16 +1205,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/StreamReadFeature;)Z', ); - static final _isEnabled$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.StreamReadFeature f)` /// @@ -1196,10 +1223,10 @@ class JsonFactory extends jni.JObject { ///@return True if specified feature is enabled ///@since 2.10 bool isEnabled$2( - jni.JObject f, + _$jni.JObject f, ) { - return _isEnabled$2(reference.pointer, _id_isEnabled$2 as jni.JMethodIDPtr, - f.reference.pointer) + return _isEnabled$2(reference.pointer, + _id_isEnabled$2 as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -1208,16 +1235,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/io/InputDecorator;', ); - static final _getInputDecorator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getInputDecorator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.io.InputDecorator getInputDecorator()` @@ -1226,10 +1253,10 @@ class JsonFactory extends jni.JObject { /// Method for getting currently configured input decorator (if any; /// there is no default decorator). ///@return InputDecorator configured, if any - jni.JObject getInputDecorator() { + _$jni.JObject getInputDecorator() { return _getInputDecorator( - reference.pointer, _id_getInputDecorator as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getInputDecorator as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setInputDecorator = _class.instanceMethodId( @@ -1237,16 +1264,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/io/InputDecorator;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setInputDecorator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setInputDecorator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setInputDecorator(com.fasterxml.jackson.core.io.InputDecorator d)` /// The returned object must be released after use, by calling the [release] method. @@ -1256,11 +1283,11 @@ class JsonFactory extends jni.JObject { ///@return This factory instance (to allow call chaining) ///@deprecated Since 2.10 use JsonFactoryBuilder\#inputDecorator(InputDecorator) instead JsonFactory setInputDecorator( - jni.JObject d, + _$jni.JObject d, ) { return _setInputDecorator(reference.pointer, - _id_setInputDecorator as jni.JMethodIDPtr, d.reference.pointer) - .object(const $JsonFactoryType()); + _id_setInputDecorator as _$jni.JMethodIDPtr, d.reference.pointer) + .object(const $JsonFactory$Type()); } static final _id_configure$2 = _class.instanceMethodId( @@ -1268,16 +1295,17 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _configure$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _configure$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -1288,12 +1316,15 @@ class JsonFactory extends jni.JObject { ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) JsonFactory configure$2( - jni.JObject f, + _$jni.JObject f, bool state, ) { - return _configure$2(reference.pointer, _id_configure$2 as jni.JMethodIDPtr, - f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactoryType()); + return _configure$2( + reference.pointer, + _id_configure$2 as _$jni.JMethodIDPtr, + f.reference.pointer, + state ? 1 : 0) + .object(const $JsonFactory$Type()); } static final _id_enable$2 = _class.instanceMethodId( @@ -1301,16 +1332,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _enable$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _enable$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1320,11 +1351,11 @@ class JsonFactory extends jni.JObject { ///@param f Feature to enable ///@return This factory instance (to allow call chaining) JsonFactory enable$2( - jni.JObject f, + _$jni.JObject f, ) { - return _enable$2(reference.pointer, _id_enable$2 as jni.JMethodIDPtr, + return _enable$2(reference.pointer, _id_enable$2 as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_disable$2 = _class.instanceMethodId( @@ -1332,16 +1363,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _disable$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _disable$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1351,11 +1382,11 @@ class JsonFactory extends jni.JObject { ///@param f Feature to disable ///@return This factory instance (to allow call chaining) JsonFactory disable$2( - jni.JObject f, + _$jni.JObject f, ) { - return _disable$2(reference.pointer, _id_disable$2 as jni.JMethodIDPtr, + return _disable$2(reference.pointer, _id_disable$2 as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_isEnabled$3 = _class.instanceMethodId( @@ -1363,16 +1394,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Z', ); - static final _isEnabled$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator.Feature f)` /// @@ -1380,10 +1411,10 @@ class JsonFactory extends jni.JObject { ///@param f Feature to check ///@return Whether specified feature is enabled bool isEnabled$3( - jni.JObject f, + _$jni.JObject f, ) { - return _isEnabled$3(reference.pointer, _id_isEnabled$3 as jni.JMethodIDPtr, - f.reference.pointer) + return _isEnabled$3(reference.pointer, + _id_isEnabled$3 as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -1392,16 +1423,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/StreamWriteFeature;)Z', ); - static final _isEnabled$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.StreamWriteFeature f)` /// @@ -1410,10 +1441,10 @@ class JsonFactory extends jni.JObject { ///@return Whether specified feature is enabled ///@since 2.10 bool isEnabled$4( - jni.JObject f, + _$jni.JObject f, ) { - return _isEnabled$4(reference.pointer, _id_isEnabled$4 as jni.JMethodIDPtr, - f.reference.pointer) + return _isEnabled$4(reference.pointer, + _id_isEnabled$4 as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -1422,16 +1453,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/io/CharacterEscapes;', ); - static final _getCharacterEscapes = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCharacterEscapes = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.io.CharacterEscapes getCharacterEscapes()` @@ -1440,10 +1471,10 @@ class JsonFactory extends jni.JObject { /// Method for accessing custom escapes factory uses for JsonGenerators /// it creates. ///@return Configured {@code CharacterEscapes}, if any; {@code null} if none - jni.JObject getCharacterEscapes() { + _$jni.JObject getCharacterEscapes() { return _getCharacterEscapes( - reference.pointer, _id_getCharacterEscapes as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getCharacterEscapes as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setCharacterEscapes = _class.instanceMethodId( @@ -1451,16 +1482,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/io/CharacterEscapes;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setCharacterEscapes = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCharacterEscapes = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setCharacterEscapes(com.fasterxml.jackson.core.io.CharacterEscapes esc)` /// The returned object must be released after use, by calling the [release] method. @@ -1470,11 +1501,13 @@ class JsonFactory extends jni.JObject { ///@param esc CharaterEscapes to set (or {@code null} for "none") ///@return This factory instance (to allow call chaining) JsonFactory setCharacterEscapes( - jni.JObject esc, + _$jni.JObject esc, ) { - return _setCharacterEscapes(reference.pointer, - _id_setCharacterEscapes as jni.JMethodIDPtr, esc.reference.pointer) - .object(const $JsonFactoryType()); + return _setCharacterEscapes( + reference.pointer, + _id_setCharacterEscapes as _$jni.JMethodIDPtr, + esc.reference.pointer) + .object(const $JsonFactory$Type()); } static final _id_getOutputDecorator = _class.instanceMethodId( @@ -1482,16 +1515,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/io/OutputDecorator;', ); - static final _getOutputDecorator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getOutputDecorator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.io.OutputDecorator getOutputDecorator()` @@ -1501,10 +1534,10 @@ class JsonFactory extends jni.JObject { /// there is no default decorator). ///@return OutputDecorator configured for generators factory creates, if any; /// {@code null} if none. - jni.JObject getOutputDecorator() { + _$jni.JObject getOutputDecorator() { return _getOutputDecorator( - reference.pointer, _id_getOutputDecorator as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getOutputDecorator as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setOutputDecorator = _class.instanceMethodId( @@ -1512,16 +1545,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/io/OutputDecorator;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setOutputDecorator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setOutputDecorator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setOutputDecorator(com.fasterxml.jackson.core.io.OutputDecorator d)` /// The returned object must be released after use, by calling the [release] method. @@ -1531,11 +1564,11 @@ class JsonFactory extends jni.JObject { ///@param d Output decorator to use, if any ///@deprecated Since 2.10 use JsonFactoryBuilder\#outputDecorator(OutputDecorator) instead JsonFactory setOutputDecorator( - jni.JObject d, + _$jni.JObject d, ) { return _setOutputDecorator(reference.pointer, - _id_setOutputDecorator as jni.JMethodIDPtr, d.reference.pointer) - .object(const $JsonFactoryType()); + _id_setOutputDecorator as _$jni.JMethodIDPtr, d.reference.pointer) + .object(const $JsonFactory$Type()); } static final _id_setRootValueSeparator = _class.instanceMethodId( @@ -1543,16 +1576,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setRootValueSeparator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setRootValueSeparator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setRootValueSeparator(java.lang.String sep)` /// The returned object must be released after use, by calling the [release] method. @@ -1563,13 +1596,13 @@ class JsonFactory extends jni.JObject { /// automatically added ///@return This factory instance (to allow call chaining) JsonFactory setRootValueSeparator( - jni.JString sep, + _$jni.JString sep, ) { return _setRootValueSeparator( reference.pointer, - _id_setRootValueSeparator as jni.JMethodIDPtr, + _id_setRootValueSeparator as _$jni.JMethodIDPtr, sep.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_getRootValueSeparator = _class.instanceMethodId( @@ -1577,26 +1610,26 @@ class JsonFactory extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getRootValueSeparator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getRootValueSeparator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getRootValueSeparator()` /// The returned object must be released after use, by calling the [release] method. /// /// @return Root value separator configured, if any - jni.JString getRootValueSeparator() { + _$jni.JString getRootValueSeparator() { return _getRootValueSeparator( - reference.pointer, _id_getRootValueSeparator as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getRootValueSeparator as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setCodec = _class.instanceMethodId( @@ -1604,16 +1637,16 @@ class JsonFactory extends jni.JObject { r'(Lcom/fasterxml/jackson/core/ObjectCodec;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setCodec = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCodec = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setCodec(com.fasterxml.jackson.core.ObjectCodec oc)` /// The returned object must be released after use, by calling the [release] method. @@ -1626,11 +1659,11 @@ class JsonFactory extends jni.JObject { ///@param oc Codec to use ///@return This factory instance (to allow call chaining) JsonFactory setCodec( - jni.JObject oc, + _$jni.JObject oc, ) { - return _setCodec(reference.pointer, _id_setCodec as jni.JMethodIDPtr, + return _setCodec(reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, oc.reference.pointer) - .object(const $JsonFactoryType()); + .object(const $JsonFactory$Type()); } static final _id_getCodec = _class.instanceMethodId( @@ -1638,23 +1671,23 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/ObjectCodec;', ); - static final _getCodec = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCodec = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.ObjectCodec getCodec()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject getCodec() { - return _getCodec(reference.pointer, _id_getCodec as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getCodec() { + return _getCodec(reference.pointer, _id_getCodec as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_createParser = _class.instanceMethodId( @@ -1662,16 +1695,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.File f)` /// The returned object must be released after use, by calling the [release] method. @@ -1693,11 +1726,11 @@ class JsonFactory extends jni.JObject { ///@param f File that contains JSON content to parse ///@since 2.1 jsonparser_.JsonParser createParser( - jni.JObject f, + _$jni.JObject f, ) { return _createParser(reference.pointer, - _id_createParser as jni.JMethodIDPtr, f.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser as _$jni.JMethodIDPtr, f.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$1 = _class.instanceMethodId( @@ -1705,16 +1738,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.net.URL url)` /// The returned object must be released after use, by calling the [release] method. @@ -1734,11 +1767,11 @@ class JsonFactory extends jni.JObject { ///@param url URL pointing to resource that contains JSON content to parse ///@since 2.1 jsonparser_.JsonParser createParser$1( - jni.JObject url, + _$jni.JObject url, ) { return _createParser$1(reference.pointer, - _id_createParser$1 as jni.JMethodIDPtr, url.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$1 as _$jni.JMethodIDPtr, url.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$2 = _class.instanceMethodId( @@ -1746,16 +1779,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.InputStream in)` /// The returned object must be released after use, by calling the [release] method. @@ -1778,11 +1811,11 @@ class JsonFactory extends jni.JObject { ///@param in InputStream to use for reading JSON content to parse ///@since 2.1 jsonparser_.JsonParser createParser$2( - jni.JObject in$, + _$jni.JObject in$, ) { return _createParser$2(reference.pointer, - _id_createParser$2 as jni.JMethodIDPtr, in$.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$2 as _$jni.JMethodIDPtr, in$.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$3 = _class.instanceMethodId( @@ -1790,16 +1823,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.Reader r)` /// The returned object must be released after use, by calling the [release] method. @@ -1815,11 +1848,11 @@ class JsonFactory extends jni.JObject { ///@param r Reader to use for reading JSON content to parse ///@since 2.1 jsonparser_.JsonParser createParser$3( - jni.JObject r, + _$jni.JObject r, ) { return _createParser$3(reference.pointer, - _id_createParser$3 as jni.JMethodIDPtr, r.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$3 as _$jni.JMethodIDPtr, r.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$4 = _class.instanceMethodId( @@ -1827,16 +1860,16 @@ class JsonFactory extends jni.JObject { r'([B)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(byte[] data)` /// The returned object must be released after use, by calling the [release] method. @@ -1845,11 +1878,11 @@ class JsonFactory extends jni.JObject { /// the contents of given byte array. ///@since 2.1 jsonparser_.JsonParser createParser$4( - jni.JArray data, + _$jni.JArray<_$jni.jbyte> data, ) { return _createParser$4(reference.pointer, - _id_createParser$4 as jni.JMethodIDPtr, data.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$4 as _$jni.JMethodIDPtr, data.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$5 = _class.instanceMethodId( @@ -1857,16 +1890,20 @@ class JsonFactory extends jni.JObject { r'([BII)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$5 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - 'globalEnv_CallObjectMethod') + static final _createParser$5 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(byte[] data, int offset, int len)` /// The returned object must be released after use, by calling the [release] method. @@ -1878,17 +1915,17 @@ class JsonFactory extends jni.JObject { ///@param len Length of contents to parse within buffer ///@since 2.1 jsonparser_.JsonParser createParser$5( - jni.JArray data, + _$jni.JArray<_$jni.jbyte> data, int offset, int len, ) { return _createParser$5( reference.pointer, - _id_createParser$5 as jni.JMethodIDPtr, + _id_createParser$5 as _$jni.JMethodIDPtr, data.reference.pointer, offset, len) - .object(const jsonparser_.$JsonParserType()); + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$6 = _class.instanceMethodId( @@ -1896,16 +1933,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$6 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$6 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.lang.String content)` /// The returned object must be released after use, by calling the [release] method. @@ -1914,11 +1951,11 @@ class JsonFactory extends jni.JObject { /// contents of given String. ///@since 2.1 jsonparser_.JsonParser createParser$6( - jni.JString content, + _$jni.JString content, ) { return _createParser$6(reference.pointer, - _id_createParser$6 as jni.JMethodIDPtr, content.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$6 as _$jni.JMethodIDPtr, content.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$7 = _class.instanceMethodId( @@ -1926,16 +1963,16 @@ class JsonFactory extends jni.JObject { r'([C)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$7 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$7 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(char[] content)` /// The returned object must be released after use, by calling the [release] method. @@ -1944,11 +1981,11 @@ class JsonFactory extends jni.JObject { /// contents of given char array. ///@since 2.4 jsonparser_.JsonParser createParser$7( - jni.JArray content, + _$jni.JArray<_$jni.jchar> content, ) { return _createParser$7(reference.pointer, - _id_createParser$7 as jni.JMethodIDPtr, content.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$7 as _$jni.JMethodIDPtr, content.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$8 = _class.instanceMethodId( @@ -1956,16 +1993,20 @@ class JsonFactory extends jni.JObject { r'([CII)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$8 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - 'globalEnv_CallObjectMethod') + static final _createParser$8 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(char[] content, int offset, int len)` /// The returned object must be released after use, by calling the [release] method. @@ -1973,17 +2014,17 @@ class JsonFactory extends jni.JObject { /// Method for constructing parser for parsing contents of given char array. ///@since 2.4 jsonparser_.JsonParser createParser$8( - jni.JArray content, + _$jni.JArray<_$jni.jchar> content, int offset, int len, ) { return _createParser$8( reference.pointer, - _id_createParser$8 as jni.JMethodIDPtr, + _id_createParser$8 as _$jni.JMethodIDPtr, content.reference.pointer, offset, len) - .object(const jsonparser_.$JsonParserType()); + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createParser$9 = _class.instanceMethodId( @@ -1991,16 +2032,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/DataInput;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$9 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createParser$9 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.DataInput in)` /// The returned object must be released after use, by calling the [release] method. @@ -2012,11 +2053,11 @@ class JsonFactory extends jni.JObject { /// will throw UnsupportedOperationException ///@since 2.8 jsonparser_.JsonParser createParser$9( - jni.JObject in$, + _$jni.JObject in$, ) { return _createParser$9(reference.pointer, - _id_createParser$9 as jni.JMethodIDPtr, in$.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createParser$9 as _$jni.JMethodIDPtr, in$.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createNonBlockingByteArrayParser = _class.instanceMethodId( @@ -2025,16 +2066,16 @@ class JsonFactory extends jni.JObject { ); static final _createNonBlockingByteArrayParser = - ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonParser createNonBlockingByteArrayParser()` @@ -2055,8 +2096,8 @@ class JsonFactory extends jni.JObject { ///@since 2.9 jsonparser_.JsonParser createNonBlockingByteArrayParser() { return _createNonBlockingByteArrayParser(reference.pointer, - _id_createNonBlockingByteArrayParser as jni.JMethodIDPtr) - .object(const jsonparser_.$JsonParserType()); + _id_createNonBlockingByteArrayParser as _$jni.JMethodIDPtr) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createGenerator = _class.instanceMethodId( @@ -2064,19 +2105,22 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _createGenerator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2099,16 +2143,16 @@ class JsonFactory extends jni.JObject { ///@param out OutputStream to use for writing JSON content ///@param enc Character encoding to use ///@since 2.1 - jni.JObject createGenerator( - jni.JObject out, - jni.JObject enc, + _$jni.JObject createGenerator( + _$jni.JObject out, + _$jni.JObject enc, ) { return _createGenerator( reference.pointer, - _id_createGenerator as jni.JMethodIDPtr, + _id_createGenerator as _$jni.JMethodIDPtr, out.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_createGenerator$1 = _class.instanceMethodId( @@ -2116,16 +2160,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createGenerator$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out)` /// The returned object must be released after use, by calling the [release] method. @@ -2135,12 +2179,12 @@ class JsonFactory extends jni.JObject { /// /// Note: there are formats that use fixed encoding (like most binary data formats). ///@since 2.1 - jni.JObject createGenerator$1( - jni.JObject out, + _$jni.JObject createGenerator$1( + _$jni.JObject out, ) { return _createGenerator$1(reference.pointer, - _id_createGenerator$1 as jni.JMethodIDPtr, out.reference.pointer) - .object(const jni.JObjectType()); + _id_createGenerator$1 as _$jni.JMethodIDPtr, out.reference.pointer) + .object(const _$jni.JObjectType()); } static final _id_createGenerator$2 = _class.instanceMethodId( @@ -2148,16 +2192,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createGenerator$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.Writer w)` /// The returned object must be released after use, by calling the [release] method. @@ -2173,12 +2217,12 @@ class JsonFactory extends jni.JObject { /// Using application needs to close it explicitly. ///@since 2.1 ///@param w Writer to use for writing JSON content - jni.JObject createGenerator$2( - jni.JObject w, + _$jni.JObject createGenerator$2( + _$jni.JObject w, ) { return _createGenerator$2(reference.pointer, - _id_createGenerator$2 as jni.JMethodIDPtr, w.reference.pointer) - .object(const jni.JObjectType()); + _id_createGenerator$2 as _$jni.JMethodIDPtr, w.reference.pointer) + .object(const _$jni.JObjectType()); } static final _id_createGenerator$3 = _class.instanceMethodId( @@ -2186,19 +2230,22 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/File;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _createGenerator$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.File f, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2215,16 +2262,16 @@ class JsonFactory extends jni.JObject { ///@param f File to write contents to ///@param enc Character encoding to use ///@since 2.1 - jni.JObject createGenerator$3( - jni.JObject f, - jni.JObject enc, + _$jni.JObject createGenerator$3( + _$jni.JObject f, + _$jni.JObject enc, ) { return _createGenerator$3( reference.pointer, - _id_createGenerator$3 as jni.JMethodIDPtr, + _id_createGenerator$3 as _$jni.JMethodIDPtr, f.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_createGenerator$4 = _class.instanceMethodId( @@ -2232,19 +2279,22 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/DataOutput;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _createGenerator$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2252,16 +2302,16 @@ class JsonFactory extends jni.JObject { /// Method for constructing generator for writing content using specified /// DataOutput instance. ///@since 2.8 - jni.JObject createGenerator$4( - jni.JObject out, - jni.JObject enc, + _$jni.JObject createGenerator$4( + _$jni.JObject out, + _$jni.JObject enc, ) { return _createGenerator$4( reference.pointer, - _id_createGenerator$4 as jni.JMethodIDPtr, + _id_createGenerator$4 as _$jni.JMethodIDPtr, out.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_createGenerator$5 = _class.instanceMethodId( @@ -2269,16 +2319,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/DataOutput;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$5 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createGenerator$5 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out)` /// The returned object must be released after use, by calling the [release] method. @@ -2288,12 +2338,12 @@ class JsonFactory extends jni.JObject { /// /// Note: there are formats that use fixed encoding (like most binary data formats). ///@since 2.8 - jni.JObject createGenerator$5( - jni.JObject out, + _$jni.JObject createGenerator$5( + _$jni.JObject out, ) { return _createGenerator$5(reference.pointer, - _id_createGenerator$5 as jni.JMethodIDPtr, out.reference.pointer) - .object(const jni.JObjectType()); + _id_createGenerator$5 as _$jni.JMethodIDPtr, out.reference.pointer) + .object(const _$jni.JObjectType()); } static final _id_createJsonParser = _class.instanceMethodId( @@ -2301,16 +2351,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonParser = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.File f)` /// The returned object must be released after use, by calling the [release] method. @@ -2334,11 +2384,11 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(File) instead. jsonparser_.JsonParser createJsonParser( - jni.JObject f, + _$jni.JObject f, ) { return _createJsonParser(reference.pointer, - _id_createJsonParser as jni.JMethodIDPtr, f.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createJsonParser as _$jni.JMethodIDPtr, f.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonParser$1 = _class.instanceMethodId( @@ -2346,16 +2396,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonParser$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.net.URL url)` /// The returned object must be released after use, by calling the [release] method. @@ -2378,11 +2428,11 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(URL) instead. jsonparser_.JsonParser createJsonParser$1( - jni.JObject url, + _$jni.JObject url, ) { return _createJsonParser$1(reference.pointer, - _id_createJsonParser$1 as jni.JMethodIDPtr, url.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createJsonParser$1 as _$jni.JMethodIDPtr, url.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonParser$2 = _class.instanceMethodId( @@ -2390,16 +2440,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonParser$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.InputStream in)` /// The returned object must be released after use, by calling the [release] method. @@ -2425,11 +2475,11 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(InputStream) instead. jsonparser_.JsonParser createJsonParser$2( - jni.JObject in$, + _$jni.JObject in$, ) { return _createJsonParser$2(reference.pointer, - _id_createJsonParser$2 as jni.JMethodIDPtr, in$.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createJsonParser$2 as _$jni.JMethodIDPtr, in$.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonParser$3 = _class.instanceMethodId( @@ -2437,16 +2487,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonParser$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.Reader r)` /// The returned object must be released after use, by calling the [release] method. @@ -2465,11 +2515,11 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(Reader) instead. jsonparser_.JsonParser createJsonParser$3( - jni.JObject r, + _$jni.JObject r, ) { return _createJsonParser$3(reference.pointer, - _id_createJsonParser$3 as jni.JMethodIDPtr, r.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + _id_createJsonParser$3 as _$jni.JMethodIDPtr, r.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonParser$4 = _class.instanceMethodId( @@ -2477,16 +2527,16 @@ class JsonFactory extends jni.JObject { r'([B)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonParser$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data)` /// The returned object must be released after use, by calling the [release] method. @@ -2498,11 +2548,13 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[]) instead. jsonparser_.JsonParser createJsonParser$4( - jni.JArray data, + _$jni.JArray<_$jni.jbyte> data, ) { - return _createJsonParser$4(reference.pointer, - _id_createJsonParser$4 as jni.JMethodIDPtr, data.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + return _createJsonParser$4( + reference.pointer, + _id_createJsonParser$4 as _$jni.JMethodIDPtr, + data.reference.pointer) + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonParser$5 = _class.instanceMethodId( @@ -2510,16 +2562,20 @@ class JsonFactory extends jni.JObject { r'([BII)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$5 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - 'globalEnv_CallObjectMethod') + static final _createJsonParser$5 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data, int offset, int len)` /// The returned object must be released after use, by calling the [release] method. @@ -2534,17 +2590,17 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[],int,int) instead. jsonparser_.JsonParser createJsonParser$5( - jni.JArray data, + _$jni.JArray<_$jni.jbyte> data, int offset, int len, ) { return _createJsonParser$5( reference.pointer, - _id_createJsonParser$5 as jni.JMethodIDPtr, + _id_createJsonParser$5 as _$jni.JMethodIDPtr, data.reference.pointer, offset, len) - .object(const jsonparser_.$JsonParserType()); + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonParser$6 = _class.instanceMethodId( @@ -2552,16 +2608,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$6 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonParser$6 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.lang.String content)` /// The returned object must be released after use, by calling the [release] method. @@ -2574,13 +2630,13 @@ class JsonFactory extends jni.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(String) instead. jsonparser_.JsonParser createJsonParser$6( - jni.JString content, + _$jni.JString content, ) { return _createJsonParser$6( reference.pointer, - _id_createJsonParser$6 as jni.JMethodIDPtr, + _id_createJsonParser$6 as _$jni.JMethodIDPtr, content.reference.pointer) - .object(const jsonparser_.$JsonParserType()); + .object(const jsonparser_.$JsonParser$Type()); } static final _id_createJsonGenerator = _class.instanceMethodId( @@ -2588,19 +2644,22 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createJsonGenerator = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _createJsonGenerator = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2625,16 +2684,16 @@ class JsonFactory extends jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(OutputStream, JsonEncoding) instead. - jni.JObject createJsonGenerator( - jni.JObject out, - jni.JObject enc, + _$jni.JObject createJsonGenerator( + _$jni.JObject out, + _$jni.JObject enc, ) { return _createJsonGenerator( reference.pointer, - _id_createJsonGenerator as jni.JMethodIDPtr, + _id_createJsonGenerator as _$jni.JMethodIDPtr, out.reference.pointer, enc.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_createJsonGenerator$1 = _class.instanceMethodId( @@ -2642,16 +2701,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createJsonGenerator$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonGenerator$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.Writer out)` /// The returned object must be released after use, by calling the [release] method. @@ -2669,14 +2728,14 @@ class JsonFactory extends jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(Writer) instead. - jni.JObject createJsonGenerator$1( - jni.JObject out, + _$jni.JObject createJsonGenerator$1( + _$jni.JObject out, ) { return _createJsonGenerator$1( reference.pointer, - _id_createJsonGenerator$1 as jni.JMethodIDPtr, + _id_createJsonGenerator$1 as _$jni.JMethodIDPtr, out.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_createJsonGenerator$2 = _class.instanceMethodId( @@ -2684,16 +2743,16 @@ class JsonFactory extends jni.JObject { r'(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createJsonGenerator$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _createJsonGenerator$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out)` /// The returned object must be released after use, by calling the [release] method. @@ -2706,14 +2765,14 @@ class JsonFactory extends jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(OutputStream) instead. - jni.JObject createJsonGenerator$2( - jni.JObject out, + _$jni.JObject createJsonGenerator$2( + _$jni.JObject out, ) { return _createJsonGenerator$2( reference.pointer, - _id_createJsonGenerator$2 as jni.JMethodIDPtr, + _id_createJsonGenerator$2 as _$jni.JMethodIDPtr, out.reference.pointer) - .object(const jni.JObjectType()); + .object(const _$jni.JObjectType()); } static final _id_$_getBufferRecycler = _class.instanceMethodId( @@ -2721,16 +2780,16 @@ class JsonFactory extends jni.JObject { r'()Lcom/fasterxml/jackson/core/util/BufferRecycler;', ); - static final _$_getBufferRecycler = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _$_getBufferRecycler = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.util.BufferRecycler _getBufferRecycler()` @@ -2741,34 +2800,40 @@ class JsonFactory extends jni.JObject { /// /// Note: only public to give access for {@code ObjectMapper} ///@return Buffer recycler instance to use - jni.JObject $_getBufferRecycler() { + _$jni.JObject $_getBufferRecycler() { return _$_getBufferRecycler( - reference.pointer, _id_$_getBufferRecycler as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_$_getBufferRecycler as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } } -final class $JsonFactoryType extends jni.JObjType { - const $JsonFactoryType(); +final class $JsonFactory$Type extends _$jni.JObjType { + @_$jni.internal + const $JsonFactory$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory;'; - @override - JsonFactory fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + JsonFactory fromReference(_$jni.JReference reference) => JsonFactory.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonFactoryType).hashCode; + @_$core.override + int get hashCode => ($JsonFactory$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonFactoryType) && other is $JsonFactoryType; + return other.runtimeType == ($JsonFactory$Type) && + other is $JsonFactory$Type; } } diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart index 2b0f71a24..c7b36643c 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -24,12 +24,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -39,52 +44,55 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +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; +class JsonParser_Feature extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal JsonParser_Feature.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$Feature'); + _$jni.JClass.forName(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 const type = $JsonParser_Feature$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($JsonParser_FeatureType())); + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($JsonParser_Feature$Type())); } static final _id_valueOf = _class.staticMethodId( @@ -92,25 +100,25 @@ class JsonParser_Feature extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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, + _$jni.JString name, ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, name.reference.pointer) - .object(const $JsonParser_FeatureType()); + .object(const $JsonParser_Feature$Type()); } static final _id_collectDefaults = _class.staticMethodId( @@ -118,16 +126,16 @@ class JsonParser_Feature extends jni.JObject { r'()I', ); - static final _collectDefaults = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _collectDefaults = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public int collectDefaults()` @@ -137,7 +145,7 @@ class JsonParser_Feature extends jni.JObject { ///@return Bit mask of all features that are enabled by default static int collectDefaults() { return _collectDefaults( - _class.reference.pointer, _id_collectDefaults as jni.JMethodIDPtr) + _class.reference.pointer, _id_collectDefaults as _$jni.JMethodIDPtr) .integer; } @@ -146,22 +154,22 @@ class JsonParser_Feature extends jni.JObject { r'()Z', ); - static final _enabledByDefault = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _enabledByDefault = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean enabledByDefault()` bool enabledByDefault() { return _enabledByDefault( - reference.pointer, _id_enabledByDefault as jni.JMethodIDPtr) + reference.pointer, _id_enabledByDefault as _$jni.JMethodIDPtr) .boolean; } @@ -170,20 +178,23 @@ class JsonParser_Feature extends jni.JObject { r'(I)Z', ); - static final _enabledIn = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _enabledIn = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public boolean enabledIn(int flags)` bool enabledIn( int flags, ) { return _enabledIn( - reference.pointer, _id_enabledIn as jni.JMethodIDPtr, flags) + reference.pointer, _id_enabledIn as _$jni.JMethodIDPtr, flags) .boolean; } @@ -192,47 +203,54 @@ class JsonParser_Feature extends jni.JObject { r'()I', ); - static final _getMask = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getMask = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getMask()` int getMask() { - return _getMask(reference.pointer, _id_getMask as jni.JMethodIDPtr).integer; + return _getMask(reference.pointer, _id_getMask as _$jni.JMethodIDPtr) + .integer; } } -final class $JsonParser_FeatureType extends jni.JObjType { - const $JsonParser_FeatureType(); +final class $JsonParser_Feature$Type + extends _$jni.JObjType { + @_$jni.internal + const $JsonParser_Feature$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$Feature;'; - @override - JsonParser_Feature fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + JsonParser_Feature fromReference(_$jni.JReference reference) => JsonParser_Feature.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonParser_FeatureType).hashCode; + @_$core.override + int get hashCode => ($JsonParser_Feature$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_FeatureType) && - other is $JsonParser_FeatureType; + return other.runtimeType == ($JsonParser_Feature$Type) && + other is $JsonParser_Feature$Type; } } @@ -240,41 +258,44 @@ final class $JsonParser_FeatureType extends jni.JObjType { /// /// 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; +class JsonParser_NumberType extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal JsonParser_NumberType.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$NumberType'); + _$jni.JClass.forName(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 const type = $JsonParser_NumberType$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($JsonParser_NumberTypeType())); + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($JsonParser_NumberType$Type())); } static final _id_valueOf = _class.staticMethodId( @@ -282,52 +303,57 @@ class JsonParser_NumberType extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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, + _$jni.JString name, ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, name.reference.pointer) - .object(const $JsonParser_NumberTypeType()); + .object(const $JsonParser_NumberType$Type()); } } -final class $JsonParser_NumberTypeType - extends jni.JObjType { - const $JsonParser_NumberTypeType(); +final class $JsonParser_NumberType$Type + extends _$jni.JObjType { + @_$jni.internal + const $JsonParser_NumberType$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;'; - @override - JsonParser_NumberType fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + JsonParser_NumberType fromReference(_$jni.JReference reference) => JsonParser_NumberType.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonParser_NumberTypeType).hashCode; + @_$core.override + int get hashCode => ($JsonParser_NumberType$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_NumberTypeType) && - other is $JsonParser_NumberTypeType; + return other.runtimeType == ($JsonParser_NumberType$Type) && + other is $JsonParser_NumberType$Type; } } @@ -337,34 +363,37 @@ final class $JsonParser_NumberTypeType /// Instances are created using factory methods of /// a JsonFactory instance. ///@author Tatu Saloranta -class JsonParser extends jni.JObject { - @override - late final jni.JObjType $type = type; +class JsonParser extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal JsonParser.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser'); + _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser'); /// The type which includes information such as the signature of this class. - static const type = $JsonParserType(); + static const type = $JsonParser$Type(); static final _id_getCodec = _class.instanceMethodId( r'getCodec', r'()Lcom/fasterxml/jackson/core/ObjectCodec;', ); - static final _getCodec = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCodec = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.ObjectCodec getCodec()` @@ -374,9 +403,9 @@ class JsonParser extends jni.JObject { /// parser, if any. Codec is used by \#readValueAs(Class) /// method (and its variants). ///@return Codec assigned to this parser, if any; {@code null} if none - jni.JObject getCodec() { - return _getCodec(reference.pointer, _id_getCodec as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getCodec() { + return _getCodec(reference.pointer, _id_getCodec as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setCodec = _class.instanceMethodId( @@ -384,16 +413,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/ObjectCodec;)V', ); - static final _setCodec = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCodec = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract void setCodec(com.fasterxml.jackson.core.ObjectCodec oc)` /// @@ -402,9 +431,9 @@ class JsonParser extends jni.JObject { /// method (and its variants). ///@param oc Codec to assign, if any; {@code null} if none void setCodec( - jni.JObject oc, + _$jni.JObject oc, ) { - _setCodec(reference.pointer, _id_setCodec as jni.JMethodIDPtr, + _setCodec(reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, oc.reference.pointer) .check(); } @@ -414,16 +443,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Object;', ); - static final _getInputSource = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getInputSource = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object getInputSource()` @@ -443,10 +472,10 @@ class JsonParser extends jni.JObject { /// In general use of this accessor should be considered as /// "last effort", i.e. only used if no other mechanism is applicable. ///@return Input source this parser was configured with - jni.JObject getInputSource() { + _$jni.JObject getInputSource() { return _getInputSource( - reference.pointer, _id_getInputSource as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getInputSource as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setRequestPayloadOnError = _class.instanceMethodId( @@ -454,16 +483,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/util/RequestPayload;)V', ); - static final _setRequestPayloadOnError = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setRequestPayloadOnError = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setRequestPayloadOnError(com.fasterxml.jackson.core.util.RequestPayload payload)` /// @@ -471,11 +500,11 @@ class JsonParser extends jni.JObject { ///@param payload Payload to pass ///@since 2.8 void setRequestPayloadOnError( - jni.JObject payload, + _$jni.JObject payload, ) { _setRequestPayloadOnError( reference.pointer, - _id_setRequestPayloadOnError as jni.JMethodIDPtr, + _id_setRequestPayloadOnError as _$jni.JMethodIDPtr, payload.reference.pointer) .check(); } @@ -485,19 +514,23 @@ class JsonParser extends jni.JObject { r'([BLjava/lang/String;)V', ); - static final _setRequestPayloadOnError$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_CallVoidMethod') - .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + static final _setRequestPayloadOnError$1 = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setRequestPayloadOnError(byte[] payload, java.lang.String charset)` /// @@ -506,12 +539,12 @@ class JsonParser extends jni.JObject { ///@param charset Character encoding for (lazily) decoding payload ///@since 2.8 void setRequestPayloadOnError$1( - jni.JArray payload, - jni.JString charset, + _$jni.JArray<_$jni.jbyte> payload, + _$jni.JString charset, ) { _setRequestPayloadOnError$1( reference.pointer, - _id_setRequestPayloadOnError$1 as jni.JMethodIDPtr, + _id_setRequestPayloadOnError$1 as _$jni.JMethodIDPtr, payload.reference.pointer, charset.reference.pointer) .check(); @@ -522,16 +555,17 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setRequestPayloadOnError$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallVoidMethod') - .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + static final _setRequestPayloadOnError$2 = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setRequestPayloadOnError(java.lang.String payload)` /// @@ -539,11 +573,11 @@ class JsonParser extends jni.JObject { ///@param payload Payload to pass ///@since 2.8 void setRequestPayloadOnError$2( - jni.JString payload, + _$jni.JString payload, ) { _setRequestPayloadOnError$2( reference.pointer, - _id_setRequestPayloadOnError$2 as jni.JMethodIDPtr, + _id_setRequestPayloadOnError$2 as _$jni.JMethodIDPtr, payload.reference.pointer) .check(); } @@ -553,16 +587,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/FormatSchema;)V', ); - static final _setSchema = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setSchema = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setSchema(com.fasterxml.jackson.core.FormatSchema schema)` /// @@ -577,9 +611,9 @@ class JsonParser extends jni.JObject { ///@param schema Schema to use ///@throws UnsupportedOperationException if parser does not support schema void setSchema( - jni.JObject schema, + _$jni.JObject schema, ) { - _setSchema(reference.pointer, _id_setSchema as jni.JMethodIDPtr, + _setSchema(reference.pointer, _id_setSchema as _$jni.JMethodIDPtr, schema.reference.pointer) .check(); } @@ -589,16 +623,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/FormatSchema;', ); - static final _getSchema = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSchema = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.FormatSchema getSchema()` @@ -608,9 +642,9 @@ class JsonParser extends jni.JObject { /// Default implementation returns null. ///@return Schema in use by this parser, if any; {@code null} if none ///@since 2.1 - jni.JObject getSchema() { - return _getSchema(reference.pointer, _id_getSchema as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getSchema() { + return _getSchema(reference.pointer, _id_getSchema as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_canUseSchema = _class.instanceMethodId( @@ -618,16 +652,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/FormatSchema;)Z', ); - static final _canUseSchema = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _canUseSchema = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)` /// @@ -636,10 +670,10 @@ class JsonParser extends jni.JObject { ///@param schema Schema to check ///@return True if this parser can use given schema; false if not bool canUseSchema( - jni.JObject schema, + _$jni.JObject schema, ) { return _canUseSchema(reference.pointer, - _id_canUseSchema as jni.JMethodIDPtr, schema.reference.pointer) + _id_canUseSchema as _$jni.JMethodIDPtr, schema.reference.pointer) .boolean; } @@ -648,16 +682,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _requiresCustomCodec = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _requiresCustomCodec = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean requiresCustomCodec()` @@ -672,7 +706,7 @@ class JsonParser extends jni.JObject { ///@since 2.1 bool requiresCustomCodec() { return _requiresCustomCodec( - reference.pointer, _id_requiresCustomCodec as jni.JMethodIDPtr) + reference.pointer, _id_requiresCustomCodec as _$jni.JMethodIDPtr) .boolean; } @@ -681,16 +715,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _canParseAsync = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _canParseAsync = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean canParseAsync()` @@ -708,7 +742,7 @@ class JsonParser extends jni.JObject { ///@since 2.9 bool canParseAsync() { return _canParseAsync( - reference.pointer, _id_canParseAsync as jni.JMethodIDPtr) + reference.pointer, _id_canParseAsync as _$jni.JMethodIDPtr) .boolean; } @@ -717,16 +751,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/async/NonBlockingInputFeeder;', ); - static final _getNonBlockingInputFeeder = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNonBlockingInputFeeder = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.async.NonBlockingInputFeeder getNonBlockingInputFeeder()` @@ -737,10 +771,10 @@ class JsonParser extends jni.JObject { /// parsers that use blocking I/O. ///@return Input feeder to use with non-blocking (async) parsing ///@since 2.9 - jni.JObject getNonBlockingInputFeeder() { + _$jni.JObject getNonBlockingInputFeeder() { return _getNonBlockingInputFeeder(reference.pointer, - _id_getNonBlockingInputFeeder as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _id_getNonBlockingInputFeeder as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getReadCapabilities = _class.instanceMethodId( @@ -748,16 +782,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;', ); - static final _getReadCapabilities = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getReadCapabilities = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities()` @@ -767,10 +801,10 @@ class JsonParser extends jni.JObject { /// underlying data format being read (directly or indirectly). ///@return Set of read capabilities for content to read via this parser ///@since 2.12 - jni.JObject getReadCapabilities() { + _$jni.JObject getReadCapabilities() { return _getReadCapabilities( - reference.pointer, _id_getReadCapabilities as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getReadCapabilities as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_version = _class.instanceMethodId( @@ -778,16 +812,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/Version;', ); - static final _version = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _version = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.Version version()` @@ -797,9 +831,9 @@ class JsonParser extends jni.JObject { /// Left for sub-classes to implement. ///@return Version of this generator (derived from version declared for /// {@code jackson-core} jar that contains the class - jni.JObject version() { - return _version(reference.pointer, _id_version as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject version() { + return _version(reference.pointer, _id_version as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_close = _class.instanceMethodId( @@ -807,16 +841,16 @@ class JsonParser extends jni.JObject { r'()V', ); - static final _close = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _close = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract void close()` @@ -836,7 +870,7 @@ class JsonParser extends jni.JObject { /// stream or reader it does own them. ///@throws IOException if there is either an underlying I/O problem void close() { - _close(reference.pointer, _id_close as jni.JMethodIDPtr).check(); + _close(reference.pointer, _id_close as _$jni.JMethodIDPtr).check(); } static final _id_isClosed = _class.instanceMethodId( @@ -844,16 +878,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _isClosed = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isClosed = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract boolean isClosed()` @@ -866,7 +900,7 @@ class JsonParser extends jni.JObject { /// end of input. ///@return {@code True} if this parser instance has been closed bool isClosed() { - return _isClosed(reference.pointer, _id_isClosed as jni.JMethodIDPtr) + return _isClosed(reference.pointer, _id_isClosed as _$jni.JMethodIDPtr) .boolean; } @@ -875,16 +909,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonStreamContext;', ); - static final _getParsingContext = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getParsingContext = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonStreamContext getParsingContext()` @@ -899,10 +933,10 @@ class JsonParser extends jni.JObject { /// Contexts can also be used for simple xpath-like matching of /// input, if so desired. ///@return Stream input context (JsonStreamContext) associated with this parser - jni.JObject getParsingContext() { + _$jni.JObject getParsingContext() { return _getParsingContext( - reference.pointer, _id_getParsingContext as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getParsingContext as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_currentLocation = _class.instanceMethodId( @@ -910,16 +944,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _currentLocation = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _currentLocation = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonLocation currentLocation()` @@ -937,10 +971,10 @@ class JsonParser extends jni.JObject { /// to other library) ///@return Location of the last processed input unit (byte or character) ///@since 2.13 - jni.JObject currentLocation() { + _$jni.JObject currentLocation() { return _currentLocation( - reference.pointer, _id_currentLocation as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_currentLocation as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_currentTokenLocation = _class.instanceMethodId( @@ -948,16 +982,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _currentTokenLocation = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _currentTokenLocation = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonLocation currentTokenLocation()` @@ -975,10 +1009,10 @@ class JsonParser extends jni.JObject { /// to other library) ///@return Starting location of the token parser currently points to ///@since 2.13 (will eventually replace \#getTokenLocation) - jni.JObject currentTokenLocation() { + _$jni.JObject currentTokenLocation() { return _currentTokenLocation( - reference.pointer, _id_currentTokenLocation as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_currentTokenLocation as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getCurrentLocation = _class.instanceMethodId( @@ -986,16 +1020,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _getCurrentLocation = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCurrentLocation = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonLocation getCurrentLocation()` @@ -1004,10 +1038,10 @@ class JsonParser extends jni.JObject { /// Alias for \#currentLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Location of the last processed input unit (byte or character) - jni.JObject getCurrentLocation() { + _$jni.JObject getCurrentLocation() { return _getCurrentLocation( - reference.pointer, _id_getCurrentLocation as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getCurrentLocation as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getTokenLocation = _class.instanceMethodId( @@ -1015,16 +1049,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _getTokenLocation = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTokenLocation = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonLocation getTokenLocation()` @@ -1033,10 +1067,10 @@ class JsonParser extends jni.JObject { /// Alias for \#currentTokenLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Starting location of the token parser currently points to - jni.JObject getTokenLocation() { + _$jni.JObject getTokenLocation() { return _getTokenLocation( - reference.pointer, _id_getTokenLocation as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getTokenLocation as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_currentValue = _class.instanceMethodId( @@ -1044,16 +1078,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Object;', ); - static final _currentValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _currentValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object currentValue()` @@ -1070,10 +1104,10 @@ class JsonParser extends jni.JObject { /// and gets passed through data-binding. ///@return "Current value" associated with the current input context (state) of this parser ///@since 2.13 (added as replacement for older \#getCurrentValue() - jni.JObject currentValue() { + _$jni.JObject currentValue() { return _currentValue( - reference.pointer, _id_currentValue as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_currentValue as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_assignCurrentValue = _class.instanceMethodId( @@ -1081,16 +1115,16 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/Object;)V', ); - static final _assignCurrentValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _assignCurrentValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void assignCurrentValue(java.lang.Object v)` /// @@ -1101,10 +1135,10 @@ class JsonParser extends jni.JObject { ///@param v Current value to assign for the current input context of this parser ///@since 2.13 (added as replacement for older \#setCurrentValue void assignCurrentValue( - jni.JObject v, + _$jni.JObject v, ) { _assignCurrentValue(reference.pointer, - _id_assignCurrentValue as jni.JMethodIDPtr, v.reference.pointer) + _id_assignCurrentValue as _$jni.JMethodIDPtr, v.reference.pointer) .check(); } @@ -1113,16 +1147,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Object;', ); - static final _getCurrentValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCurrentValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object getCurrentValue()` @@ -1131,10 +1165,10 @@ class JsonParser extends jni.JObject { /// Alias for \#currentValue(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Location of the last processed input unit (byte or character) - jni.JObject getCurrentValue() { + _$jni.JObject getCurrentValue() { return _getCurrentValue( - reference.pointer, _id_getCurrentValue as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getCurrentValue as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setCurrentValue = _class.instanceMethodId( @@ -1142,16 +1176,16 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/Object;)V', ); - static final _setCurrentValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCurrentValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setCurrentValue(java.lang.Object v)` /// @@ -1159,10 +1193,10 @@ class JsonParser extends jni.JObject { /// Jackson 2.x versions (and removed from Jackson 3.0). ///@param v Current value to assign for the current input context of this parser void setCurrentValue( - jni.JObject v, + _$jni.JObject v, ) { - _setCurrentValue(reference.pointer, _id_setCurrentValue as jni.JMethodIDPtr, - v.reference.pointer) + _setCurrentValue(reference.pointer, + _id_setCurrentValue as _$jni.JMethodIDPtr, v.reference.pointer) .check(); } @@ -1171,16 +1205,16 @@ class JsonParser extends jni.JObject { r'(Ljava/io/OutputStream;)I', ); - static final _releaseBuffered = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _releaseBuffered = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public int releaseBuffered(java.io.OutputStream out)` /// @@ -1196,10 +1230,10 @@ class JsonParser extends jni.JObject { /// otherwise number of bytes released (0 if there was nothing to release) ///@throws IOException if write to stream threw exception int releaseBuffered( - jni.JObject out, + _$jni.JObject out, ) { return _releaseBuffered(reference.pointer, - _id_releaseBuffered as jni.JMethodIDPtr, out.reference.pointer) + _id_releaseBuffered as _$jni.JMethodIDPtr, out.reference.pointer) .integer; } @@ -1208,16 +1242,16 @@ class JsonParser extends jni.JObject { r'(Ljava/io/Writer;)I', ); - static final _releaseBuffered$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _releaseBuffered$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public int releaseBuffered(java.io.Writer w)` /// @@ -1234,10 +1268,10 @@ class JsonParser extends jni.JObject { /// otherwise number of chars released (0 if there was nothing to release) ///@throws IOException if write using Writer threw exception int releaseBuffered$1( - jni.JObject w, + _$jni.JObject w, ) { return _releaseBuffered$1(reference.pointer, - _id_releaseBuffered$1 as jni.JMethodIDPtr, w.reference.pointer) + _id_releaseBuffered$1 as _$jni.JMethodIDPtr, w.reference.pointer) .integer; } @@ -1246,16 +1280,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _enable = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _enable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1267,9 +1301,9 @@ class JsonParser extends jni.JObject { JsonParser enable( JsonParser_Feature f, ) { - return _enable(reference.pointer, _id_enable as jni.JMethodIDPtr, + return _enable(reference.pointer, _id_enable as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonParserType()); + .object(const $JsonParser$Type()); } static final _id_disable = _class.instanceMethodId( @@ -1277,16 +1311,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _disable = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _disable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1298,9 +1332,9 @@ class JsonParser extends jni.JObject { JsonParser disable( JsonParser_Feature f, ) { - return _disable(reference.pointer, _id_disable as jni.JMethodIDPtr, + return _disable(reference.pointer, _id_disable as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const $JsonParserType()); + .object(const $JsonParser$Type()); } static final _id_configure = _class.instanceMethodId( @@ -1308,16 +1342,17 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _configure = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + static final _configure = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -1331,9 +1366,9 @@ class JsonParser extends jni.JObject { JsonParser_Feature f, bool state, ) { - return _configure(reference.pointer, _id_configure as jni.JMethodIDPtr, + return _configure(reference.pointer, _id_configure as _$jni.JMethodIDPtr, f.reference.pointer, state ? 1 : 0) - .object(const $JsonParserType()); + .object(const $JsonParser$Type()); } static final _id_isEnabled = _class.instanceMethodId( @@ -1341,16 +1376,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Z', ); - static final _isEnabled = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)` /// @@ -1360,7 +1395,7 @@ class JsonParser extends jni.JObject { bool isEnabled( JsonParser_Feature f, ) { - return _isEnabled(reference.pointer, _id_isEnabled as jni.JMethodIDPtr, + return _isEnabled(reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -1370,16 +1405,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/StreamReadFeature;)Z', ); - static final _isEnabled$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _isEnabled$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean isEnabled(com.fasterxml.jackson.core.StreamReadFeature f)` /// @@ -1388,10 +1423,10 @@ class JsonParser extends jni.JObject { ///@return {@code True} if feature is enabled; {@code false} otherwise ///@since 2.10 bool isEnabled$1( - jni.JObject f, + _$jni.JObject f, ) { - return _isEnabled$1(reference.pointer, _id_isEnabled$1 as jni.JMethodIDPtr, - f.reference.pointer) + return _isEnabled$1(reference.pointer, + _id_isEnabled$1 as _$jni.JMethodIDPtr, f.reference.pointer) .boolean; } @@ -1400,16 +1435,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getFeatureMask = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFeatureMask = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getFeatureMask()` @@ -1419,7 +1454,7 @@ class JsonParser extends jni.JObject { ///@since 2.3 int getFeatureMask() { return _getFeatureMask( - reference.pointer, _id_getFeatureMask as jni.JMethodIDPtr) + reference.pointer, _id_getFeatureMask as _$jni.JMethodIDPtr) .integer; } @@ -1428,13 +1463,15 @@ class JsonParser extends jni.JObject { r'(I)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _setFeatureMask = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setFeatureMask = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser setFeatureMask(int mask)` /// The returned object must be released after use, by calling the [release] method. @@ -1448,8 +1485,8 @@ class JsonParser extends jni.JObject { int mask, ) { return _setFeatureMask( - reference.pointer, _id_setFeatureMask as jni.JMethodIDPtr, mask) - .object(const $JsonParserType()); + reference.pointer, _id_setFeatureMask as _$jni.JMethodIDPtr, mask) + .object(const $JsonParser$Type()); } static final _id_overrideStdFeatures = _class.instanceMethodId( @@ -1457,13 +1494,16 @@ class JsonParser extends jni.JObject { r'(II)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _overrideStdFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32)>)>>('globalEnv_CallObjectMethod') + static final _overrideStdFeatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser overrideStdFeatures(int values, int mask)` /// The returned object must be released after use, by calling the [release] method. @@ -1485,8 +1525,8 @@ class JsonParser extends jni.JObject { int mask, ) { return _overrideStdFeatures(reference.pointer, - _id_overrideStdFeatures as jni.JMethodIDPtr, values, mask) - .object(const $JsonParserType()); + _id_overrideStdFeatures as _$jni.JMethodIDPtr, values, mask) + .object(const $JsonParser$Type()); } static final _id_getFormatFeatures = _class.instanceMethodId( @@ -1494,16 +1534,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getFormatFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFormatFeatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getFormatFeatures()` @@ -1514,7 +1554,7 @@ class JsonParser extends jni.JObject { ///@since 2.6 int getFormatFeatures() { return _getFormatFeatures( - reference.pointer, _id_getFormatFeatures as jni.JMethodIDPtr) + reference.pointer, _id_getFormatFeatures as _$jni.JMethodIDPtr) .integer; } @@ -1523,13 +1563,16 @@ class JsonParser extends jni.JObject { r'(II)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _overrideFormatFeatures = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32)>)>>('globalEnv_CallObjectMethod') + static final _overrideFormatFeatures = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values, int mask)` /// The returned object must be released after use, by calling the [release] method. @@ -1549,8 +1592,8 @@ class JsonParser extends jni.JObject { int mask, ) { return _overrideFormatFeatures(reference.pointer, - _id_overrideFormatFeatures as jni.JMethodIDPtr, values, mask) - .object(const $JsonParserType()); + _id_overrideFormatFeatures as _$jni.JMethodIDPtr, values, mask) + .object(const $JsonParser$Type()); } static final _id_nextToken = _class.instanceMethodId( @@ -1558,16 +1601,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _nextToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _nextToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken nextToken()` @@ -1582,8 +1625,8 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems jsontoken_.JsonToken nextToken() { - return _nextToken(reference.pointer, _id_nextToken as jni.JMethodIDPtr) - .object(const jsontoken_.$JsonTokenType()); + return _nextToken(reference.pointer, _id_nextToken as _$jni.JMethodIDPtr) + .object(const jsontoken_.$JsonToken$Type()); } static final _id_nextValue = _class.instanceMethodId( @@ -1591,16 +1634,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _nextValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _nextValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken nextValue()` @@ -1623,8 +1666,8 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems jsontoken_.JsonToken nextValue() { - return _nextValue(reference.pointer, _id_nextValue as jni.JMethodIDPtr) - .object(const jsontoken_.$JsonTokenType()); + return _nextValue(reference.pointer, _id_nextValue as _$jni.JMethodIDPtr) + .object(const jsontoken_.$JsonToken$Type()); } static final _id_nextFieldName = _class.instanceMethodId( @@ -1632,16 +1675,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/SerializableString;)Z', ); - static final _nextFieldName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _nextFieldName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString str)` /// @@ -1661,10 +1704,10 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems bool nextFieldName( - jni.JObject str, + _$jni.JObject str, ) { return _nextFieldName(reference.pointer, - _id_nextFieldName as jni.JMethodIDPtr, str.reference.pointer) + _id_nextFieldName as _$jni.JMethodIDPtr, str.reference.pointer) .boolean; } @@ -1673,16 +1716,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/String;', ); - static final _nextFieldName$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _nextFieldName$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String nextFieldName()` @@ -1696,10 +1739,10 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.5 - jni.JString nextFieldName$1() { + _$jni.JString nextFieldName$1() { return _nextFieldName$1( - reference.pointer, _id_nextFieldName$1 as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_nextFieldName$1 as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_nextTextValue = _class.instanceMethodId( @@ -1707,16 +1750,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/String;', ); - static final _nextTextValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _nextTextValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String nextTextValue()` @@ -1735,10 +1778,10 @@ class JsonParser extends jni.JObject { /// to; or {@code null} if next token is of some other type ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JString nextTextValue() { + _$jni.JString nextTextValue() { return _nextTextValue( - reference.pointer, _id_nextTextValue as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_nextTextValue as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_nextIntValue = _class.instanceMethodId( @@ -1746,13 +1789,15 @@ class JsonParser extends jni.JObject { r'(I)I', ); - static final _nextIntValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallIntMethod') + static final _nextIntValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public int nextIntValue(int defaultValue)` /// @@ -1777,7 +1822,7 @@ class JsonParser extends jni.JObject { int defaultValue, ) { return _nextIntValue(reference.pointer, - _id_nextIntValue as jni.JMethodIDPtr, defaultValue) + _id_nextIntValue as _$jni.JMethodIDPtr, defaultValue) .integer; } @@ -1786,13 +1831,15 @@ class JsonParser extends jni.JObject { r'(J)J', ); - static final _nextLongValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64,)>)>>('globalEnv_CallLongMethod') + static final _nextLongValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int64,)>)>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public long nextLongValue(long defaultValue)` /// @@ -1817,7 +1864,7 @@ class JsonParser extends jni.JObject { int defaultValue, ) { return _nextLongValue(reference.pointer, - _id_nextLongValue as jni.JMethodIDPtr, defaultValue) + _id_nextLongValue as _$jni.JMethodIDPtr, defaultValue) .long; } @@ -1826,16 +1873,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Boolean;', ); - static final _nextBooleanValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _nextBooleanValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Boolean nextBooleanValue()` @@ -1857,10 +1904,10 @@ class JsonParser extends jni.JObject { /// token parser advanced to; or {@code null} if next token is of some other type ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JBoolean nextBooleanValue() { + _$jni.JBoolean nextBooleanValue() { return _nextBooleanValue( - reference.pointer, _id_nextBooleanValue as jni.JMethodIDPtr) - .object(const jni.JBooleanType()); + reference.pointer, _id_nextBooleanValue as _$jni.JMethodIDPtr) + .object(const _$jni.JBooleanType()); } static final _id_skipChildren = _class.instanceMethodId( @@ -1868,16 +1915,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _skipChildren = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _skipChildren = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonParser skipChildren()` @@ -1900,8 +1947,8 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems JsonParser skipChildren() { return _skipChildren( - reference.pointer, _id_skipChildren as jni.JMethodIDPtr) - .object(const $JsonParserType()); + reference.pointer, _id_skipChildren as _$jni.JMethodIDPtr) + .object(const $JsonParser$Type()); } static final _id_finishToken = _class.instanceMethodId( @@ -1909,16 +1956,16 @@ class JsonParser extends jni.JObject { r'()V', ); - static final _finishToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _finishToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void finishToken()` @@ -1937,7 +1984,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems ///@since 2.8 void finishToken() { - _finishToken(reference.pointer, _id_finishToken as jni.JMethodIDPtr) + _finishToken(reference.pointer, _id_finishToken as _$jni.JMethodIDPtr) .check(); } @@ -1946,16 +1993,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _currentToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _currentToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonToken currentToken()` @@ -1972,8 +2019,8 @@ class JsonParser extends jni.JObject { ///@since 2.8 jsontoken_.JsonToken currentToken() { return _currentToken( - reference.pointer, _id_currentToken as jni.JMethodIDPtr) - .object(const jsontoken_.$JsonTokenType()); + reference.pointer, _id_currentToken as _$jni.JMethodIDPtr) + .object(const jsontoken_.$JsonToken$Type()); } static final _id_currentTokenId = _class.instanceMethodId( @@ -1981,16 +2028,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _currentTokenId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _currentTokenId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int currentTokenId()` @@ -2006,7 +2053,7 @@ class JsonParser extends jni.JObject { ///@return {@code int} matching one of constants from JsonTokenId. int currentTokenId() { return _currentTokenId( - reference.pointer, _id_currentTokenId as jni.JMethodIDPtr) + reference.pointer, _id_currentTokenId as _$jni.JMethodIDPtr) .integer; } @@ -2015,16 +2062,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _getCurrentToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCurrentToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken getCurrentToken()` @@ -2036,8 +2083,8 @@ class JsonParser extends jni.JObject { /// if any: null before any tokens have been read, and jsontoken_.JsonToken getCurrentToken() { return _getCurrentToken( - reference.pointer, _id_getCurrentToken as jni.JMethodIDPtr) - .object(const jsontoken_.$JsonTokenType()); + reference.pointer, _id_getCurrentToken as _$jni.JMethodIDPtr) + .object(const jsontoken_.$JsonToken$Type()); } static final _id_getCurrentTokenId = _class.instanceMethodId( @@ -2045,16 +2092,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getCurrentTokenId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCurrentTokenId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract int getCurrentTokenId()` @@ -2064,7 +2111,7 @@ class JsonParser extends jni.JObject { ///@deprecated Since 2.12 use \#currentTokenId instead int getCurrentTokenId() { return _getCurrentTokenId( - reference.pointer, _id_getCurrentTokenId as jni.JMethodIDPtr) + reference.pointer, _id_getCurrentTokenId as _$jni.JMethodIDPtr) .integer; } @@ -2073,16 +2120,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _hasCurrentToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _hasCurrentToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract boolean hasCurrentToken()` @@ -2097,7 +2144,7 @@ class JsonParser extends jni.JObject { /// has been consumed) bool hasCurrentToken() { return _hasCurrentToken( - reference.pointer, _id_hasCurrentToken as jni.JMethodIDPtr) + reference.pointer, _id_hasCurrentToken as _$jni.JMethodIDPtr) .boolean; } @@ -2106,13 +2153,16 @@ class JsonParser extends jni.JObject { r'(I)Z', ); - static final _hasTokenId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _hasTokenId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public abstract boolean hasTokenId(int id)` /// @@ -2132,7 +2182,7 @@ class JsonParser extends jni.JObject { int id, ) { return _hasTokenId( - reference.pointer, _id_hasTokenId as jni.JMethodIDPtr, id) + reference.pointer, _id_hasTokenId as _$jni.JMethodIDPtr, id) .boolean; } @@ -2141,16 +2191,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonToken;)Z', ); - static final _hasToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _hasToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract boolean hasToken(com.fasterxml.jackson.core.JsonToken t)` /// @@ -2169,7 +2219,7 @@ class JsonParser extends jni.JObject { bool hasToken( jsontoken_.JsonToken t, ) { - return _hasToken(reference.pointer, _id_hasToken as jni.JMethodIDPtr, + return _hasToken(reference.pointer, _id_hasToken as _$jni.JMethodIDPtr, t.reference.pointer) .boolean; } @@ -2179,16 +2229,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _isExpectedStartArrayToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isExpectedStartArrayToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean isExpectedStartArrayToken()` @@ -2211,7 +2261,7 @@ class JsonParser extends jni.JObject { /// {@code false} if not bool isExpectedStartArrayToken() { return _isExpectedStartArrayToken(reference.pointer, - _id_isExpectedStartArrayToken as jni.JMethodIDPtr) + _id_isExpectedStartArrayToken as _$jni.JMethodIDPtr) .boolean; } @@ -2220,17 +2270,18 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _isExpectedStartObjectToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallBooleanMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _isExpectedStartObjectToken = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); /// from: `public boolean isExpectedStartObjectToken()` /// @@ -2242,7 +2293,7 @@ class JsonParser extends jni.JObject { ///@since 2.5 bool isExpectedStartObjectToken() { return _isExpectedStartObjectToken(reference.pointer, - _id_isExpectedStartObjectToken as jni.JMethodIDPtr) + _id_isExpectedStartObjectToken as _$jni.JMethodIDPtr) .boolean; } @@ -2251,16 +2302,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _isExpectedNumberIntToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isExpectedNumberIntToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean isExpectedNumberIntToken()` @@ -2275,8 +2326,8 @@ class JsonParser extends jni.JObject { /// {@code false} if not ///@since 2.12 bool isExpectedNumberIntToken() { - return _isExpectedNumberIntToken( - reference.pointer, _id_isExpectedNumberIntToken as jni.JMethodIDPtr) + return _isExpectedNumberIntToken(reference.pointer, + _id_isExpectedNumberIntToken as _$jni.JMethodIDPtr) .boolean; } @@ -2285,16 +2336,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _isNaN = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isNaN = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean isNaN()` @@ -2312,7 +2363,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems ///@since 2.9 bool isNaN() { - return _isNaN(reference.pointer, _id_isNaN as jni.JMethodIDPtr).boolean; + return _isNaN(reference.pointer, _id_isNaN as _$jni.JMethodIDPtr).boolean; } static final _id_clearCurrentToken = _class.instanceMethodId( @@ -2320,16 +2371,16 @@ class JsonParser extends jni.JObject { r'()V', ); - static final _clearCurrentToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _clearCurrentToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract void clearCurrentToken()` @@ -2346,7 +2397,7 @@ class JsonParser extends jni.JObject { /// it will not be used again). void clearCurrentToken() { _clearCurrentToken( - reference.pointer, _id_clearCurrentToken as jni.JMethodIDPtr) + reference.pointer, _id_clearCurrentToken as _$jni.JMethodIDPtr) .check(); } @@ -2355,16 +2406,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _getLastClearedToken = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getLastClearedToken = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken getLastClearedToken()` @@ -2378,8 +2429,8 @@ class JsonParser extends jni.JObject { ///@return Last cleared token, if any; {@code null} otherwise jsontoken_.JsonToken getLastClearedToken() { return _getLastClearedToken( - reference.pointer, _id_getLastClearedToken as jni.JMethodIDPtr) - .object(const jsontoken_.$JsonTokenType()); + reference.pointer, _id_getLastClearedToken as _$jni.JMethodIDPtr) + .object(const jsontoken_.$JsonToken$Type()); } static final _id_overrideCurrentName = _class.instanceMethodId( @@ -2387,16 +2438,16 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _overrideCurrentName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _overrideCurrentName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract void overrideCurrentName(java.lang.String name)` /// @@ -2409,10 +2460,12 @@ class JsonParser extends jni.JObject { /// resort, as it is a work-around for regular operation. ///@param name Name to use as the current name; may be null. void overrideCurrentName( - jni.JString name, + _$jni.JString name, ) { - _overrideCurrentName(reference.pointer, - _id_overrideCurrentName as jni.JMethodIDPtr, name.reference.pointer) + _overrideCurrentName( + reference.pointer, + _id_overrideCurrentName as _$jni.JMethodIDPtr, + name.reference.pointer) .check(); } @@ -2421,16 +2474,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getCurrentName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCurrentName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract java.lang.String getCurrentName()` @@ -2440,10 +2493,10 @@ class JsonParser extends jni.JObject { ///@return Name of the current field in the parsing context ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JString getCurrentName() { + _$jni.JString getCurrentName() { return _getCurrentName( - reference.pointer, _id_getCurrentName as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getCurrentName as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_currentName = _class.instanceMethodId( @@ -2451,16 +2504,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/String;', ); - static final _currentName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _currentName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String currentName()` @@ -2475,9 +2528,10 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.10 - jni.JString currentName() { - return _currentName(reference.pointer, _id_currentName as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString currentName() { + return _currentName( + reference.pointer, _id_currentName as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getText = _class.instanceMethodId( @@ -2485,16 +2539,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getText = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getText = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract java.lang.String getText()` @@ -2508,9 +2562,9 @@ class JsonParser extends jni.JObject { /// by \#nextToken() or other iteration methods) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JString getText() { - return _getText(reference.pointer, _id_getText as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getText() { + return _getText(reference.pointer, _id_getText as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getText$1 = _class.instanceMethodId( @@ -2518,16 +2572,16 @@ class JsonParser extends jni.JObject { r'(Ljava/io/Writer;)I', ); - static final _getText$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getText$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public int getText(java.io.Writer writer)` /// @@ -2547,9 +2601,9 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems ///@since 2.8 int getText$1( - jni.JObject writer, + _$jni.JObject writer, ) { - return _getText$1(reference.pointer, _id_getText$1 as jni.JMethodIDPtr, + return _getText$1(reference.pointer, _id_getText$1 as _$jni.JMethodIDPtr, writer.reference.pointer) .integer; } @@ -2559,16 +2613,16 @@ class JsonParser extends jni.JObject { r'()[C', ); - static final _getTextCharacters = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTextCharacters = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract char[] getTextCharacters()` @@ -2601,10 +2655,10 @@ class JsonParser extends jni.JObject { /// at offset 0, and not necessarily until the end of buffer) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JArray getTextCharacters() { + _$jni.JArray<_$jni.jchar> getTextCharacters() { return _getTextCharacters( - reference.pointer, _id_getTextCharacters as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jcharType())); + reference.pointer, _id_getTextCharacters as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jcharType())); } static final _id_getTextLength = _class.instanceMethodId( @@ -2612,16 +2666,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getTextLength = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTextLength = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract int getTextLength()` @@ -2635,7 +2689,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getTextLength() { return _getTextLength( - reference.pointer, _id_getTextLength as jni.JMethodIDPtr) + reference.pointer, _id_getTextLength as _$jni.JMethodIDPtr) .integer; } @@ -2644,16 +2698,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getTextOffset = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTextOffset = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract int getTextOffset()` @@ -2667,7 +2721,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getTextOffset() { return _getTextOffset( - reference.pointer, _id_getTextOffset as jni.JMethodIDPtr) + reference.pointer, _id_getTextOffset as _$jni.JMethodIDPtr) .integer; } @@ -2676,16 +2730,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _hasTextCharacters = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _hasTextCharacters = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract boolean hasTextCharacters()` @@ -2706,7 +2760,7 @@ class JsonParser extends jni.JObject { /// means that it may or may not exist bool hasTextCharacters() { return _hasTextCharacters( - reference.pointer, _id_hasTextCharacters as jni.JMethodIDPtr) + reference.pointer, _id_hasTextCharacters as _$jni.JMethodIDPtr) .boolean; } @@ -2715,16 +2769,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Number;', ); - static final _getNumberValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNumberValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract java.lang.Number getNumberValue()` @@ -2740,10 +2794,10 @@ class JsonParser extends jni.JObject { /// the current token is not numeric, or if decoding of the value fails /// (invalid format for numbers); plain IOException if underlying /// content read fails (possible if values are extracted lazily) - jni.JNumber getNumberValue() { + _$jni.JNumber getNumberValue() { return _getNumberValue( - reference.pointer, _id_getNumberValue as jni.JMethodIDPtr) - .object(const jni.JNumberType()); + reference.pointer, _id_getNumberValue as _$jni.JMethodIDPtr) + .object(const _$jni.JNumberType()); } static final _id_getNumberValueExact = _class.instanceMethodId( @@ -2751,16 +2805,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Number;', ); - static final _getNumberValueExact = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNumberValueExact = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Number getNumberValueExact()` @@ -2780,10 +2834,10 @@ class JsonParser extends jni.JObject { /// (invalid format for numbers); plain IOException if underlying /// content read fails (possible if values are extracted lazily) ///@since 2.12 - jni.JNumber getNumberValueExact() { + _$jni.JNumber getNumberValueExact() { return _getNumberValueExact( - reference.pointer, _id_getNumberValueExact as jni.JMethodIDPtr) - .object(const jni.JNumberType()); + reference.pointer, _id_getNumberValueExact as _$jni.JMethodIDPtr) + .object(const _$jni.JNumberType()); } static final _id_getNumberType = _class.instanceMethodId( @@ -2791,16 +2845,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - static final _getNumberType = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNumberType = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()` @@ -2815,8 +2869,8 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems JsonParser_NumberType getNumberType() { return _getNumberType( - reference.pointer, _id_getNumberType as jni.JMethodIDPtr) - .object(const $JsonParser_NumberTypeType()); + reference.pointer, _id_getNumberType as _$jni.JMethodIDPtr) + .object(const $JsonParser_NumberType$Type()); } static final _id_getByteValue = _class.instanceMethodId( @@ -2824,16 +2878,16 @@ class JsonParser extends jni.JObject { r'()B', ); - static final _getByteValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getByteValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallByteMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public byte getByteValue()` @@ -2861,7 +2915,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getByteValue() { return _getByteValue( - reference.pointer, _id_getByteValue as jni.JMethodIDPtr) + reference.pointer, _id_getByteValue as _$jni.JMethodIDPtr) .byte; } @@ -2870,16 +2924,16 @@ class JsonParser extends jni.JObject { r'()S', ); - static final _getShortValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getShortValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallShortMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public short getShortValue()` @@ -2901,7 +2955,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getShortValue() { return _getShortValue( - reference.pointer, _id_getShortValue as jni.JMethodIDPtr) + reference.pointer, _id_getShortValue as _$jni.JMethodIDPtr) .short; } @@ -2910,16 +2964,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getIntValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getIntValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract int getIntValue()` @@ -2940,7 +2994,8 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems int getIntValue() { - return _getIntValue(reference.pointer, _id_getIntValue as jni.JMethodIDPtr) + return _getIntValue( + reference.pointer, _id_getIntValue as _$jni.JMethodIDPtr) .integer; } @@ -2949,16 +3004,16 @@ class JsonParser extends jni.JObject { r'()J', ); - static final _getLongValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getLongValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract long getLongValue()` @@ -2980,7 +3035,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getLongValue() { return _getLongValue( - reference.pointer, _id_getLongValue as jni.JMethodIDPtr) + reference.pointer, _id_getLongValue as _$jni.JMethodIDPtr) .long; } @@ -2989,16 +3044,16 @@ class JsonParser extends jni.JObject { r'()Ljava/math/BigInteger;', ); - static final _getBigIntegerValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getBigIntegerValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract java.math.BigInteger getBigIntegerValue()` @@ -3015,10 +3070,10 @@ class JsonParser extends jni.JObject { /// otherwise exception thrown ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JObject getBigIntegerValue() { + _$jni.JObject getBigIntegerValue() { return _getBigIntegerValue( - reference.pointer, _id_getBigIntegerValue as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getBigIntegerValue as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getFloatValue = _class.instanceMethodId( @@ -3026,16 +3081,16 @@ class JsonParser extends jni.JObject { r'()F', ); - static final _getFloatValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getFloatValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract float getFloatValue()` @@ -3057,7 +3112,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems double getFloatValue() { return _getFloatValue( - reference.pointer, _id_getFloatValue as jni.JMethodIDPtr) + reference.pointer, _id_getFloatValue as _$jni.JMethodIDPtr) .float; } @@ -3066,16 +3121,16 @@ class JsonParser extends jni.JObject { r'()D', ); - static final _getDoubleValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDoubleValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallDoubleMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract double getDoubleValue()` @@ -3097,7 +3152,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems double getDoubleValue() { return _getDoubleValue( - reference.pointer, _id_getDoubleValue as jni.JMethodIDPtr) + reference.pointer, _id_getDoubleValue as _$jni.JMethodIDPtr) .doubleFloat; } @@ -3106,16 +3161,16 @@ class JsonParser extends jni.JObject { r'()Ljava/math/BigDecimal;', ); - static final _getDecimalValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getDecimalValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract java.math.BigDecimal getDecimalValue()` @@ -3129,10 +3184,10 @@ class JsonParser extends jni.JObject { /// otherwise exception thrown ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JObject getDecimalValue() { + _$jni.JObject getDecimalValue() { return _getDecimalValue( - reference.pointer, _id_getDecimalValue as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getDecimalValue as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getBooleanValue = _class.instanceMethodId( @@ -3140,16 +3195,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _getBooleanValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getBooleanValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getBooleanValue()` @@ -3167,7 +3222,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems bool getBooleanValue() { return _getBooleanValue( - reference.pointer, _id_getBooleanValue as jni.JMethodIDPtr) + reference.pointer, _id_getBooleanValue as _$jni.JMethodIDPtr) .boolean; } @@ -3176,16 +3231,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Object;', ); - static final _getEmbeddedObject = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getEmbeddedObject = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object getEmbeddedObject()` @@ -3205,10 +3260,10 @@ class JsonParser extends jni.JObject { /// for the current token, if any; {@code null otherwise} ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JObject getEmbeddedObject() { + _$jni.JObject getEmbeddedObject() { return _getEmbeddedObject( - reference.pointer, _id_getEmbeddedObject as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + reference.pointer, _id_getEmbeddedObject as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getBinaryValue = _class.instanceMethodId( @@ -3216,16 +3271,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/Base64Variant;)[B', ); - static final _getBinaryValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getBinaryValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant bv)` /// The returned object must be released after use, by calling the [release] method. @@ -3250,12 +3305,12 @@ class JsonParser extends jni.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JArray getBinaryValue( - jni.JObject bv, + _$jni.JArray<_$jni.jbyte> getBinaryValue( + _$jni.JObject bv, ) { return _getBinaryValue(reference.pointer, - _id_getBinaryValue as jni.JMethodIDPtr, bv.reference.pointer) - .object(const jni.JArrayType(jni.jbyteType())); + _id_getBinaryValue as _$jni.JMethodIDPtr, bv.reference.pointer) + .object(const _$jni.JArrayType(_$jni.jbyteType())); } static final _id_getBinaryValue$1 = _class.instanceMethodId( @@ -3263,16 +3318,16 @@ class JsonParser extends jni.JObject { r'()[B', ); - static final _getBinaryValue$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getBinaryValue$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public byte[] getBinaryValue()` @@ -3284,10 +3339,10 @@ class JsonParser extends jni.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni.JArray getBinaryValue$1() { + _$jni.JArray<_$jni.jbyte> getBinaryValue$1() { return _getBinaryValue$1( - reference.pointer, _id_getBinaryValue$1 as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jbyteType())); + reference.pointer, _id_getBinaryValue$1 as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jbyteType())); } static final _id_readBinaryValue = _class.instanceMethodId( @@ -3295,16 +3350,16 @@ class JsonParser extends jni.JObject { r'(Ljava/io/OutputStream;)I', ); - static final _readBinaryValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _readBinaryValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public int readBinaryValue(java.io.OutputStream out)` /// @@ -3320,10 +3375,10 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems ///@since 2.1 int readBinaryValue( - jni.JObject out, + _$jni.JObject out, ) { return _readBinaryValue(reference.pointer, - _id_readBinaryValue as jni.JMethodIDPtr, out.reference.pointer) + _id_readBinaryValue as _$jni.JMethodIDPtr, out.reference.pointer) .integer; } @@ -3332,19 +3387,22 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/Base64Variant;Ljava/io/OutputStream;)I', ); - static final _readBinaryValue$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _readBinaryValue$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public int readBinaryValue(com.fasterxml.jackson.core.Base64Variant bv, java.io.OutputStream out)` /// @@ -3357,12 +3415,12 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems ///@since 2.1 int readBinaryValue$1( - jni.JObject bv, - jni.JObject out, + _$jni.JObject bv, + _$jni.JObject out, ) { return _readBinaryValue$1( reference.pointer, - _id_readBinaryValue$1 as jni.JMethodIDPtr, + _id_readBinaryValue$1 as _$jni.JMethodIDPtr, bv.reference.pointer, out.reference.pointer) .integer; @@ -3373,16 +3431,16 @@ class JsonParser extends jni.JObject { r'()I', ); - static final _getValueAsInt = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValueAsInt = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getValueAsInt()` @@ -3402,7 +3460,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getValueAsInt() { return _getValueAsInt( - reference.pointer, _id_getValueAsInt as jni.JMethodIDPtr) + reference.pointer, _id_getValueAsInt as _$jni.JMethodIDPtr) .integer; } @@ -3411,13 +3469,15 @@ class JsonParser extends jni.JObject { r'(I)I', ); - static final _getValueAsInt$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallIntMethod') + static final _getValueAsInt$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public int getValueAsInt(int def)` /// @@ -3438,7 +3498,7 @@ class JsonParser extends jni.JObject { int def, ) { return _getValueAsInt$1( - reference.pointer, _id_getValueAsInt$1 as jni.JMethodIDPtr, def) + reference.pointer, _id_getValueAsInt$1 as _$jni.JMethodIDPtr, def) .integer; } @@ -3447,16 +3507,16 @@ class JsonParser extends jni.JObject { r'()J', ); - static final _getValueAsLong = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValueAsLong = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public long getValueAsLong()` @@ -3476,7 +3536,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems int getValueAsLong() { return _getValueAsLong( - reference.pointer, _id_getValueAsLong as jni.JMethodIDPtr) + reference.pointer, _id_getValueAsLong as _$jni.JMethodIDPtr) .long; } @@ -3485,13 +3545,15 @@ class JsonParser extends jni.JObject { r'(J)J', ); - static final _getValueAsLong$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64,)>)>>('globalEnv_CallLongMethod') + static final _getValueAsLong$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int64,)>)>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public long getValueAsLong(long def)` /// @@ -3512,7 +3574,7 @@ class JsonParser extends jni.JObject { int def, ) { return _getValueAsLong$1( - reference.pointer, _id_getValueAsLong$1 as jni.JMethodIDPtr, def) + reference.pointer, _id_getValueAsLong$1 as _$jni.JMethodIDPtr, def) .long; } @@ -3521,16 +3583,16 @@ class JsonParser extends jni.JObject { r'()D', ); - static final _getValueAsDouble = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValueAsDouble = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallDoubleMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public double getValueAsDouble()` @@ -3550,7 +3612,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems double getValueAsDouble() { return _getValueAsDouble( - reference.pointer, _id_getValueAsDouble as jni.JMethodIDPtr) + reference.pointer, _id_getValueAsDouble as _$jni.JMethodIDPtr) .doubleFloat; } @@ -3559,13 +3621,16 @@ class JsonParser extends jni.JObject { r'(D)D', ); - static final _getValueAsDouble$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_CallDoubleMethod') + static final _getValueAsDouble$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Double,)>)>>('globalEnv_CallDoubleMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); /// from: `public double getValueAsDouble(double def)` /// @@ -3585,8 +3650,8 @@ class JsonParser extends jni.JObject { double getValueAsDouble$1( double def, ) { - return _getValueAsDouble$1( - reference.pointer, _id_getValueAsDouble$1 as jni.JMethodIDPtr, def) + return _getValueAsDouble$1(reference.pointer, + _id_getValueAsDouble$1 as _$jni.JMethodIDPtr, def) .doubleFloat; } @@ -3595,16 +3660,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _getValueAsBoolean = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValueAsBoolean = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getValueAsBoolean()` @@ -3624,7 +3689,7 @@ class JsonParser extends jni.JObject { /// JsonParseException for decoding problems bool getValueAsBoolean() { return _getValueAsBoolean( - reference.pointer, _id_getValueAsBoolean as jni.JMethodIDPtr) + reference.pointer, _id_getValueAsBoolean as _$jni.JMethodIDPtr) .boolean; } @@ -3633,13 +3698,16 @@ class JsonParser extends jni.JObject { r'(Z)Z', ); - static final _getValueAsBoolean$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _getValueAsBoolean$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public boolean getValueAsBoolean(boolean def)` /// @@ -3660,7 +3728,7 @@ class JsonParser extends jni.JObject { bool def, ) { return _getValueAsBoolean$1(reference.pointer, - _id_getValueAsBoolean$1 as jni.JMethodIDPtr, def ? 1 : 0) + _id_getValueAsBoolean$1 as _$jni.JMethodIDPtr, def ? 1 : 0) .boolean; } @@ -3669,16 +3737,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getValueAsString = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValueAsString = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getValueAsString()` @@ -3695,10 +3763,10 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.1 - jni.JString getValueAsString() { + _$jni.JString getValueAsString() { return _getValueAsString( - reference.pointer, _id_getValueAsString as jni.JMethodIDPtr) - .object(const jni.JStringType()); + reference.pointer, _id_getValueAsString as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getValueAsString$1 = _class.instanceMethodId( @@ -3706,16 +3774,16 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _getValueAsString$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getValueAsString$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public abstract java.lang.String getValueAsString(java.lang.String def)` /// The returned object must be released after use, by calling the [release] method. @@ -3732,12 +3800,12 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.1 - jni.JString getValueAsString$1( - jni.JString def, + _$jni.JString getValueAsString$1( + _$jni.JString def, ) { return _getValueAsString$1(reference.pointer, - _id_getValueAsString$1 as jni.JMethodIDPtr, def.reference.pointer) - .object(const jni.JStringType()); + _id_getValueAsString$1 as _$jni.JMethodIDPtr, def.reference.pointer) + .object(const _$jni.JStringType()); } static final _id_canReadObjectId = _class.instanceMethodId( @@ -3745,16 +3813,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _canReadObjectId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _canReadObjectId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean canReadObjectId()` @@ -3772,7 +3840,7 @@ class JsonParser extends jni.JObject { ///@since 2.3 bool canReadObjectId() { return _canReadObjectId( - reference.pointer, _id_canReadObjectId as jni.JMethodIDPtr) + reference.pointer, _id_canReadObjectId as _$jni.JMethodIDPtr) .boolean; } @@ -3781,16 +3849,16 @@ class JsonParser extends jni.JObject { r'()Z', ); - static final _canReadTypeId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _canReadTypeId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean canReadTypeId()` @@ -3808,7 +3876,7 @@ class JsonParser extends jni.JObject { ///@since 2.3 bool canReadTypeId() { return _canReadTypeId( - reference.pointer, _id_canReadTypeId as jni.JMethodIDPtr) + reference.pointer, _id_canReadTypeId as _$jni.JMethodIDPtr) .boolean; } @@ -3817,16 +3885,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Object;', ); - static final _getObjectId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getObjectId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object getObjectId()` @@ -3845,9 +3913,10 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.3 - jni.JObject getObjectId() { - return _getObjectId(reference.pointer, _id_getObjectId as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getObjectId() { + return _getObjectId( + reference.pointer, _id_getObjectId as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_getTypeId = _class.instanceMethodId( @@ -3855,16 +3924,16 @@ class JsonParser extends jni.JObject { r'()Ljava/lang/Object;', ); - static final _getTypeId = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getTypeId = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.Object getTypeId()` @@ -3883,9 +3952,9 @@ class JsonParser extends jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.3 - jni.JObject getTypeId() { - return _getTypeId(reference.pointer, _id_getTypeId as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getTypeId() { + return _getTypeId(reference.pointer, _id_getTypeId as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_readValueAs = _class.instanceMethodId( @@ -3893,16 +3962,16 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/Class;)Ljava/lang/Object;', ); - static final _readValueAs = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _readValueAs = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public T readValueAs(java.lang.Class valueType)` /// The returned object must be released after use, by calling the [release] method. @@ -3932,12 +4001,12 @@ class JsonParser extends jni.JObject { ///@return Java value read from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T readValueAs<$T extends jni.JObject>( - jni.JObject valueType, { - required jni.JObjType<$T> T, + $T readValueAs<$T extends _$jni.JObject>( + _$jni.JObject valueType, { + required _$jni.JObjType<$T> T, }) { - return _readValueAs(reference.pointer, _id_readValueAs as jni.JMethodIDPtr, - valueType.reference.pointer) + return _readValueAs(reference.pointer, + _id_readValueAs as _$jni.JMethodIDPtr, valueType.reference.pointer) .object(T); } @@ -3946,16 +4015,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/lang/Object;', ); - static final _readValueAs$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _readValueAs$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public T readValueAs(com.fasterxml.jackson.core.type.TypeReference valueTypeRef)` /// The returned object must be released after use, by calling the [release] method. @@ -3982,13 +4051,13 @@ class JsonParser extends jni.JObject { ///@return Java value read from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T readValueAs$1<$T extends jni.JObject>( - jni.JObject valueTypeRef, { - required jni.JObjType<$T> T, + $T readValueAs$1<$T extends _$jni.JObject>( + _$jni.JObject valueTypeRef, { + required _$jni.JObjType<$T> T, }) { return _readValueAs$1( reference.pointer, - _id_readValueAs$1 as jni.JMethodIDPtr, + _id_readValueAs$1 as _$jni.JMethodIDPtr, valueTypeRef.reference.pointer) .object(T); } @@ -3998,16 +4067,16 @@ class JsonParser extends jni.JObject { r'(Ljava/lang/Class;)Ljava/util/Iterator;', ); - static final _readValuesAs = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _readValuesAs = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.util.Iterator readValuesAs(java.lang.Class valueType)` /// The returned object must be released after use, by calling the [release] method. @@ -4020,13 +4089,13 @@ class JsonParser extends jni.JObject { ///@return Iterator for reading multiple Java values from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - jni.JIterator<$T> readValuesAs<$T extends jni.JObject>( - jni.JObject valueType, { - required jni.JObjType<$T> T, + _$jni.JIterator<$T> readValuesAs<$T extends _$jni.JObject>( + _$jni.JObject valueType, { + required _$jni.JObjType<$T> T, }) { return _readValuesAs(reference.pointer, - _id_readValuesAs as jni.JMethodIDPtr, valueType.reference.pointer) - .object(jni.JIteratorType(T)); + _id_readValuesAs as _$jni.JMethodIDPtr, valueType.reference.pointer) + .object(_$jni.JIteratorType(T)); } static final _id_readValuesAs$1 = _class.instanceMethodId( @@ -4034,16 +4103,16 @@ class JsonParser extends jni.JObject { r'(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/util/Iterator;', ); - static final _readValuesAs$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _readValuesAs$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.util.Iterator readValuesAs(com.fasterxml.jackson.core.type.TypeReference valueTypeRef)` /// The returned object must be released after use, by calling the [release] method. @@ -4056,15 +4125,15 @@ class JsonParser extends jni.JObject { ///@return Iterator for reading multiple Java values from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - jni.JIterator<$T> readValuesAs$1<$T extends jni.JObject>( - jni.JObject valueTypeRef, { - required jni.JObjType<$T> T, + _$jni.JIterator<$T> readValuesAs$1<$T extends _$jni.JObject>( + _$jni.JObject valueTypeRef, { + required _$jni.JObjType<$T> T, }) { return _readValuesAs$1( reference.pointer, - _id_readValuesAs$1 as jni.JMethodIDPtr, + _id_readValuesAs$1 as _$jni.JMethodIDPtr, valueTypeRef.reference.pointer) - .object(jni.JIteratorType(T)); + .object(_$jni.JIteratorType(T)); } static final _id_readValueAsTree = _class.instanceMethodId( @@ -4072,16 +4141,16 @@ class JsonParser extends jni.JObject { r'()Lcom/fasterxml/jackson/core/TreeNode;', ); - static final _readValueAsTree = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _readValueAsTree = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public T readValueAsTree()` @@ -4096,36 +4165,41 @@ class JsonParser extends jni.JObject { ///@return root of the document, or null if empty or whitespace. ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T readValueAsTree<$T extends jni.JObject>({ - required jni.JObjType<$T> T, + $T readValueAsTree<$T extends _$jni.JObject>({ + required _$jni.JObjType<$T> T, }) { return _readValueAsTree( - reference.pointer, _id_readValueAsTree as jni.JMethodIDPtr) + reference.pointer, _id_readValueAsTree as _$jni.JMethodIDPtr) .object(T); } } -final class $JsonParserType extends jni.JObjType { - const $JsonParserType(); +final class $JsonParser$Type extends _$jni.JObjType { + @_$jni.internal + const $JsonParser$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser;'; - @override - JsonParser fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + JsonParser fromReference(_$jni.JReference reference) => JsonParser.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonParserType).hashCode; + @_$core.override + int get hashCode => ($JsonParser$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParserType) && other is $JsonParserType; + return other.runtimeType == ($JsonParser$Type) && other is $JsonParser$Type; } } diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart index aebd8dab4..6e075ac07 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart @@ -24,12 +24,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -39,51 +44,54 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; /// from: `com.fasterxml.jackson.core.JsonToken` /// /// Enumeration for basic token types used for returning results /// of parsing JSON content. -class JsonToken extends jni.JObject { - @override - late final jni.JObjType $type = type; +class JsonToken extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal JsonToken.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/fasterxml/jackson/core/JsonToken'); + _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonToken'); /// The type which includes information such as the signature of this class. - static const type = $JsonTokenType(); + static const type = $JsonToken$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonToken[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($JsonTokenType())); + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($JsonToken$Type())); } static final _id_valueOf = _class.staticMethodId( @@ -91,25 +99,25 @@ class JsonToken extends jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonToken valueOf( - jni.JString name, + _$jni.JString name, ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, name.reference.pointer) - .object(const $JsonTokenType()); + .object(const $JsonToken$Type()); } static final _id_id = _class.instanceMethodId( @@ -117,21 +125,21 @@ class JsonToken extends jni.JObject { r'()I', ); - static final _id = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _id = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final int id()` int id() { - return _id(reference.pointer, _id_id as jni.JMethodIDPtr).integer; + return _id(reference.pointer, _id_id as _$jni.JMethodIDPtr).integer; } static final _id_asString = _class.instanceMethodId( @@ -139,23 +147,23 @@ class JsonToken extends jni.JObject { r'()Ljava/lang/String;', ); - static final _asString = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _asString = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final java.lang.String asString()` /// The returned object must be released after use, by calling the [release] method. - jni.JString asString() { - return _asString(reference.pointer, _id_asString as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString asString() { + return _asString(reference.pointer, _id_asString as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_asCharArray = _class.instanceMethodId( @@ -163,23 +171,24 @@ class JsonToken extends jni.JObject { r'()[C', ); - static final _asCharArray = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _asCharArray = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final char[] asCharArray()` /// The returned object must be released after use, by calling the [release] method. - jni.JArray asCharArray() { - return _asCharArray(reference.pointer, _id_asCharArray as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jcharType())); + _$jni.JArray<_$jni.jchar> asCharArray() { + return _asCharArray( + reference.pointer, _id_asCharArray as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jcharType())); } static final _id_asByteArray = _class.instanceMethodId( @@ -187,23 +196,24 @@ class JsonToken extends jni.JObject { r'()[B', ); - static final _asByteArray = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _asByteArray = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final byte[] asByteArray()` /// The returned object must be released after use, by calling the [release] method. - jni.JArray asByteArray() { - return _asByteArray(reference.pointer, _id_asByteArray as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jbyteType())); + _$jni.JArray<_$jni.jbyte> asByteArray() { + return _asByteArray( + reference.pointer, _id_asByteArray as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jbyteType())); } static final _id_isNumeric = _class.instanceMethodId( @@ -211,16 +221,16 @@ class JsonToken extends jni.JObject { r'()Z', ); - static final _isNumeric = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isNumeric = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final boolean isNumeric()` @@ -228,7 +238,7 @@ class JsonToken extends jni.JObject { /// @return {@code True} if this token is {@code VALUE_NUMBER_INT} or {@code VALUE_NUMBER_FLOAT}, /// {@code false} otherwise bool isNumeric() { - return _isNumeric(reference.pointer, _id_isNumeric as jni.JMethodIDPtr) + return _isNumeric(reference.pointer, _id_isNumeric as _$jni.JMethodIDPtr) .boolean; } @@ -237,16 +247,16 @@ class JsonToken extends jni.JObject { r'()Z', ); - static final _isStructStart = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isStructStart = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final boolean isStructStart()` @@ -260,7 +270,7 @@ class JsonToken extends jni.JObject { ///@since 2.3 bool isStructStart() { return _isStructStart( - reference.pointer, _id_isStructStart as jni.JMethodIDPtr) + reference.pointer, _id_isStructStart as _$jni.JMethodIDPtr) .boolean; } @@ -269,16 +279,16 @@ class JsonToken extends jni.JObject { r'()Z', ); - static final _isStructEnd = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isStructEnd = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final boolean isStructEnd()` @@ -291,7 +301,8 @@ class JsonToken extends jni.JObject { /// {@code false} otherwise ///@since 2.3 bool isStructEnd() { - return _isStructEnd(reference.pointer, _id_isStructEnd as jni.JMethodIDPtr) + return _isStructEnd( + reference.pointer, _id_isStructEnd as _$jni.JMethodIDPtr) .boolean; } @@ -300,16 +311,16 @@ class JsonToken extends jni.JObject { r'()Z', ); - static final _isScalarValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isScalarValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final boolean isScalarValue()` @@ -322,7 +333,7 @@ class JsonToken extends jni.JObject { /// {@code VALUE_xxx} tokens), {@code false} otherwise bool isScalarValue() { return _isScalarValue( - reference.pointer, _id_isScalarValue as jni.JMethodIDPtr) + reference.pointer, _id_isScalarValue as _$jni.JMethodIDPtr) .boolean; } @@ -331,16 +342,16 @@ class JsonToken extends jni.JObject { r'()Z', ); - static final _isBoolean = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _isBoolean = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final boolean isBoolean()` @@ -348,32 +359,37 @@ class JsonToken extends jni.JObject { /// @return {@code True} if this token is {@code VALUE_TRUE} or {@code VALUE_FALSE}, /// {@code false} otherwise bool isBoolean() { - return _isBoolean(reference.pointer, _id_isBoolean as jni.JMethodIDPtr) + return _isBoolean(reference.pointer, _id_isBoolean as _$jni.JMethodIDPtr) .boolean; } } -final class $JsonTokenType extends jni.JObjType { - const $JsonTokenType(); +final class $JsonToken$Type extends _$jni.JObjType { + @_$jni.internal + const $JsonToken$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/fasterxml/jackson/core/JsonToken;'; - @override - JsonToken fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + JsonToken fromReference(_$jni.JReference reference) => JsonToken.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonTokenType).hashCode; + @_$core.override + int get hashCode => ($JsonToken$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonTokenType) && other is $JsonTokenType; + return other.runtimeType == ($JsonToken$Type) && other is $JsonToken$Type; } } diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index 1d97721d5..7c9b4f5bc 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -11,12 +11,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -26,32 +31,36 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; /// from: `com.github.dart_lang.jnigen.Measure` -class Measure<$T extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = type(T); +class Measure<$T extends _$jni.JObject> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$T> T; + @_$jni.internal + final _$jni.JObjType<$T> T; + @_$jni.internal Measure.fromReference( this.T, - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type(T), + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/Measure'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Measure'); /// The type which includes information such as the signature of this class. - static $MeasureType<$T> type<$T extends jni.JObject>( - jni.JObjType<$T> T, + static $Measure$Type<$T> type<$T extends _$jni.JObject>( + _$jni.JObjType<$T> T, ) { - return $MeasureType( + return $Measure$Type( T, ); } @@ -61,21 +70,22 @@ class Measure<$T extends jni.JObject> extends jni.JObject { r'()F', ); - static final _getValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getValue()` double getValue() { - return _getValue(reference.pointer, _id_getValue as jni.JMethodIDPtr).float; + return _getValue(reference.pointer, _id_getValue as _$jni.JMethodIDPtr) + .float; } static final _id_getUnit = _class.instanceMethodId( @@ -83,22 +93,22 @@ class Measure<$T extends jni.JObject> extends jni.JObject { r'()Lcom/github/dart_lang/jnigen/MeasureUnit;', ); - static final _getUnit = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getUnit = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public T getUnit()` /// The returned object must be released after use, by calling the [release] method. $T getUnit() { - return _getUnit(reference.pointer, _id_getUnit as jni.JMethodIDPtr) + return _getUnit(reference.pointer, _id_getUnit as _$jni.JMethodIDPtr) .object(T); } @@ -107,95 +117,106 @@ class Measure<$T extends jni.JObject> extends jni.JObject { r'(Lcom/github/dart_lang/jnigen/MeasureUnit;)F', ); - static final _convertValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _convertValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final float convertValue(T measureUnit)` double convertValue( $T measureUnit, ) { - return _convertValue(reference.pointer, - _id_convertValue as jni.JMethodIDPtr, measureUnit.reference.pointer) + return _convertValue( + reference.pointer, + _id_convertValue as _$jni.JMethodIDPtr, + measureUnit.reference.pointer) .float; } } -final class $MeasureType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; +final class $Measure$Type<$T extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - const $MeasureType( + @_$jni.internal + const $Measure$Type( this.T, ); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/Measure;'; - @override - Measure<$T> fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Measure<$T> fromReference(_$jni.JReference reference) => Measure.fromReference(T, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($MeasureType, T); + @_$core.override + int get hashCode => Object.hash($Measure$Type, T); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MeasureType<$T>) && - other is $MeasureType<$T> && + return other.runtimeType == ($Measure$Type<$T>) && + other is $Measure$Type<$T> && T == other.T; } } /// from: `com.github.dart_lang.jnigen.MeasureUnit` -class MeasureUnit extends jni.JObject { - @override - late final jni.JObjType $type = type; +class MeasureUnit extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal MeasureUnit.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/MeasureUnit'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/MeasureUnit'); /// The type which includes information such as the signature of this class. - static const type = $MeasureUnitType(); + static const type = $MeasureUnit$Type(); static final _id_getSign = _class.instanceMethodId( r'getSign', r'()Ljava/lang/String;', ); - static final _getSign = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSign = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - jni.JString getSign() { - return _getSign(reference.pointer, _id_getSign as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getSign() { + return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -203,79 +224,91 @@ class MeasureUnit extends jni.JObject { r'()F', ); - static final _getCoefficient = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCoefficient = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public abstract float getCoefficient()` double getCoefficient() { return _getCoefficient( - reference.pointer, _id_getCoefficient as jni.JMethodIDPtr) + reference.pointer, _id_getCoefficient as _$jni.JMethodIDPtr) .float; } } -final class $MeasureUnitType extends jni.JObjType { - const $MeasureUnitType(); +final class $MeasureUnit$Type extends _$jni.JObjType { + @_$jni.internal + const $MeasureUnit$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; - @override - MeasureUnit fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + MeasureUnit fromReference(_$jni.JReference reference) => MeasureUnit.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($MeasureUnitType).hashCode; + @_$core.override + int get hashCode => ($MeasureUnit$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MeasureUnitType) && other is $MeasureUnitType; + return other.runtimeType == ($MeasureUnit$Type) && + other is $MeasureUnit$Type; } } /// from: `com.github.dart_lang.jnigen.Speed` class Speed extends Measure { - @override - late final jni.JObjType $type = type; + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Speed.fromReference( - jni.JReference reference, - ) : super.fromReference(const $SpeedUnitType(), reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(const $SpeedUnit$Type(), reference); static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/Speed'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Speed'); /// The type which includes information such as the signature of this class. - static const type = $SpeedType(); + static const type = $Speed$Type(); static final _id_new$ = _class.constructorId( r'(FLcom/github/dart_lang/jnigen/SpeedUnit;)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double, ffi.Pointer)>)>>( - 'globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Double, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - double, ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, double, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (float f, com.github.dart_lang.jnigen.SpeedUnit speedUnit)` /// The returned object must be released after use, by calling the [release] method. @@ -284,7 +317,7 @@ class Speed extends Measure { SpeedUnit speedUnit, ) { return Speed.fromReference(_new$(_class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, f, speedUnit.reference.pointer) + _id_new$ as _$jni.JMethodIDPtr, f, speedUnit.reference.pointer) .reference); } @@ -293,21 +326,22 @@ class Speed extends Measure { r'()F', ); - static final _getValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getValue()` double getValue() { - return _getValue(reference.pointer, _id_getValue as jni.JMethodIDPtr).float; + return _getValue(reference.pointer, _id_getValue as _$jni.JMethodIDPtr) + .float; } static final _id_getUnit$1 = _class.instanceMethodId( @@ -315,23 +349,23 @@ class Speed extends Measure { r'()Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _getUnit$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getUnit$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.SpeedUnit getUnit()` /// The returned object must be released after use, by calling the [release] method. SpeedUnit getUnit$1() { - return _getUnit$1(reference.pointer, _id_getUnit$1 as jni.JMethodIDPtr) - .object(const $SpeedUnitType()); + return _getUnit$1(reference.pointer, _id_getUnit$1 as _$jni.JMethodIDPtr) + .object(const $SpeedUnit$Type()); } static final _id_toString$1 = _class.instanceMethodId( @@ -339,23 +373,23 @@ class Speed extends Measure { r'()Ljava/lang/String;', ); - static final _toString$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _toString$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String toString()` /// The returned object must be released after use, by calling the [release] method. - jni.JString toString$1() { - return _toString$1(reference.pointer, _id_toString$1 as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString toString$1() { + return _toString$1(reference.pointer, _id_toString$1 as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_component1 = _class.instanceMethodId( @@ -363,21 +397,21 @@ class Speed extends Measure { r'()F', ); - static final _component1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _component1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final float component1()` double component1() { - return _component1(reference.pointer, _id_component1 as jni.JMethodIDPtr) + return _component1(reference.pointer, _id_component1 as _$jni.JMethodIDPtr) .float; } @@ -386,23 +420,23 @@ class Speed extends Measure { r'()Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _component2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _component2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final com.github.dart_lang.jnigen.SpeedUnit component2()` /// The returned object must be released after use, by calling the [release] method. SpeedUnit component2() { - return _component2(reference.pointer, _id_component2 as jni.JMethodIDPtr) - .object(const $SpeedUnitType()); + return _component2(reference.pointer, _id_component2 as _$jni.JMethodIDPtr) + .object(const $SpeedUnit$Type()); } static final _id_copy = _class.instanceMethodId( @@ -410,16 +444,19 @@ class Speed extends Measure { r'(FLcom/github/dart_lang/jnigen/SpeedUnit;)Lcom/github/dart_lang/jnigen/Speed;', ); - static final _copy = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double, ffi.Pointer)>)>>( - 'globalEnv_CallObjectMethod') + static final _copy = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Double, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - double, ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, double, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final com.github.dart_lang.jnigen.Speed copy(float f, com.github.dart_lang.jnigen.SpeedUnit speedUnit)` /// The returned object must be released after use, by calling the [release] method. @@ -427,9 +464,9 @@ class Speed extends Measure { double f, SpeedUnit speedUnit, ) { - return _copy(reference.pointer, _id_copy as jni.JMethodIDPtr, f, + return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr, f, speedUnit.reference.pointer) - .object(const $SpeedType()); + .object(const $Speed$Type()); } static final _id_hashCode$1 = _class.instanceMethodId( @@ -437,21 +474,21 @@ class Speed extends Measure { r'()I', ); - static final _hashCode$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _hashCode$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int hashCode()` int hashCode$1() { - return _hashCode$1(reference.pointer, _id_hashCode$1 as jni.JMethodIDPtr) + return _hashCode$1(reference.pointer, _id_hashCode$1 as _$jni.JMethodIDPtr) .integer; } @@ -460,66 +497,74 @@ class Speed extends Measure { r'(Ljava/lang/Object;)Z', ); - static final _equals = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _equals = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public boolean equals(java.lang.Object object)` bool equals( - jni.JObject object, + _$jni.JObject object, ) { - return _equals(reference.pointer, _id_equals as jni.JMethodIDPtr, + return _equals(reference.pointer, _id_equals as _$jni.JMethodIDPtr, object.reference.pointer) .boolean; } } -final class $SpeedType extends jni.JObjType { - const $SpeedType(); +final class $Speed$Type extends _$jni.JObjType { + @_$jni.internal + const $Speed$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/Speed;'; - @override - Speed fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Speed fromReference(_$jni.JReference reference) => Speed.fromReference(reference); - @override - jni.JObjType get superType => const $MeasureType($SpeedUnitType()); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const $Measure$Type($SpeedUnit$Type()); - @override + @_$jni.internal + @_$core.override final superCount = 2; - @override - int get hashCode => ($SpeedType).hashCode; + @_$core.override + int get hashCode => ($Speed$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($SpeedType) && other is $SpeedType; + return other.runtimeType == ($Speed$Type) && other is $Speed$Type; } } /// from: `com.github.dart_lang.jnigen.SpeedUnit` -class SpeedUnit extends jni.JObject { - @override - late final jni.JObjType $type = type; +class SpeedUnit extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal SpeedUnit.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/SpeedUnit'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/SpeedUnit'); /// The type which includes information such as the signature of this class. - static const type = $SpeedUnitType(); + static const type = $SpeedUnit$Type(); static final _id_KmPerHour = _class.staticFieldId( r'KmPerHour', r'Lcom/github/dart_lang/jnigen/SpeedUnit;', @@ -528,7 +573,7 @@ class SpeedUnit extends jni.JObject { /// from: `static public final com.github.dart_lang.jnigen.SpeedUnit KmPerHour` /// The returned object must be released after use, by calling the [release] method. static SpeedUnit get KmPerHour => - _id_KmPerHour.get(_class, const $SpeedUnitType()); + _id_KmPerHour.get(_class, const $SpeedUnit$Type()); static final _id_MetrePerSec = _class.staticFieldId( r'MetrePerSec', @@ -538,30 +583,30 @@ class SpeedUnit extends jni.JObject { /// from: `static public final com.github.dart_lang.jnigen.SpeedUnit MetrePerSec` /// The returned object must be released after use, by calling the [release] method. static SpeedUnit get MetrePerSec => - _id_MetrePerSec.get(_class, const $SpeedUnitType()); + _id_MetrePerSec.get(_class, const $SpeedUnit$Type()); static final _id_getSign = _class.instanceMethodId( r'getSign', r'()Ljava/lang/String;', ); - static final _getSign = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSign = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - jni.JString getSign() { - return _getSign(reference.pointer, _id_getSign as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getSign() { + return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -569,22 +614,22 @@ class SpeedUnit extends jni.JObject { r'()F', ); - static final _getCoefficient = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCoefficient = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public float getCoefficient()` double getCoefficient() { return _getCoefficient( - reference.pointer, _id_getCoefficient as jni.JMethodIDPtr) + reference.pointer, _id_getCoefficient as _$jni.JMethodIDPtr) .float; } @@ -593,23 +638,23 @@ class SpeedUnit extends jni.JObject { r'()[Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.SpeedUnit[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($SpeedUnitType())); + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($SpeedUnit$Type())); } static final _id_valueOf = _class.staticMethodId( @@ -617,88 +662,96 @@ class SpeedUnit extends jni.JObject { r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public com.github.dart_lang.jnigen.SpeedUnit valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. static SpeedUnit valueOf( - jni.JString string, + _$jni.JString string, ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, string.reference.pointer) - .object(const $SpeedUnitType()); + .object(const $SpeedUnit$Type()); } } -final class $SpeedUnitType extends jni.JObjType { - const $SpeedUnitType(); +final class $SpeedUnit$Type extends _$jni.JObjType { + @_$jni.internal + const $SpeedUnit$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/SpeedUnit;'; - @override - SpeedUnit fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + SpeedUnit fromReference(_$jni.JReference reference) => SpeedUnit.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($SpeedUnitType).hashCode; + @_$core.override + int get hashCode => ($SpeedUnit$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($SpeedUnitType) && other is $SpeedUnitType; + return other.runtimeType == ($SpeedUnit$Type) && other is $SpeedUnit$Type; } } /// from: `com.github.dart_lang.jnigen.SuspendFun` -class SuspendFun extends jni.JObject { - @override - late final jni.JObjType $type = type; +class SuspendFun extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal SuspendFun.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/SuspendFun'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/SuspendFun'); /// The type which includes information such as the signature of this class. - static const type = $SuspendFunType(); + static const type = $SuspendFun$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory SuspendFun() { return SuspendFun.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -707,32 +760,33 @@ class SuspendFun extends jni.JObject { r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;', ); - static final _sayHello = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _sayHello = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - Future sayHello() async { - final $p = ReceivePort(); - final $c = jni.JObject.fromReference( - ProtectedJniExtensions.newPortContinuation($p)); - _sayHello(reference.pointer, _id_sayHello as jni.JMethodIDPtr, + _$core.Future<_$jni.JString> sayHello() async { + final $p = _$jni.ReceivePort(); + final $c = _$jni.JObject.fromReference( + _$jni.ProtectedJniExtensions.newPortContinuation($p)); + _sayHello(reference.pointer, _id_sayHello as _$jni.JMethodIDPtr, $c.reference.pointer) - .object(const jni.JObjectType()); - final $o = jni.JGlobalReference(jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const jni.JStringType().jClass.reference.pointer; - if (!jni.Jni.env.IsInstanceOf($o.pointer, $k)) { + .object(const _$jni.JObjectType()); + final $o = + _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); + final $k = const _$jni.JStringType().jClass.reference.pointer; + if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k)) { throw 'Failed'; } - return const jni.JStringType().fromReference($o); + return const _$jni.JStringType().fromReference($o); } static final _id_sayHello$1 = _class.instanceMethodId( @@ -740,89 +794,98 @@ class SuspendFun extends jni.JObject { r'(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;', ); - static final _sayHello$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _sayHello$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - Future sayHello$1( - jni.JString string, + _$core.Future<_$jni.JString> sayHello$1( + _$jni.JString string, ) async { - final $p = ReceivePort(); - final $c = jni.JObject.fromReference( - ProtectedJniExtensions.newPortContinuation($p)); - _sayHello$1(reference.pointer, _id_sayHello$1 as jni.JMethodIDPtr, + final $p = _$jni.ReceivePort(); + final $c = _$jni.JObject.fromReference( + _$jni.ProtectedJniExtensions.newPortContinuation($p)); + _sayHello$1(reference.pointer, _id_sayHello$1 as _$jni.JMethodIDPtr, string.reference.pointer, $c.reference.pointer) - .object(const jni.JObjectType()); - final $o = jni.JGlobalReference(jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const jni.JStringType().jClass.reference.pointer; - if (!jni.Jni.env.IsInstanceOf($o.pointer, $k)) { + .object(const _$jni.JObjectType()); + final $o = + _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); + final $k = const _$jni.JStringType().jClass.reference.pointer; + if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k)) { throw 'Failed'; } - return const jni.JStringType().fromReference($o); + return const _$jni.JStringType().fromReference($o); } } -final class $SuspendFunType extends jni.JObjType { - const $SuspendFunType(); +final class $SuspendFun$Type extends _$jni.JObjType { + @_$jni.internal + const $SuspendFun$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/SuspendFun;'; - @override - SuspendFun fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + SuspendFun fromReference(_$jni.JReference reference) => SuspendFun.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($SuspendFunType).hashCode; + @_$core.override + int get hashCode => ($SuspendFun$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($SuspendFunType) && other is $SuspendFunType; + return other.runtimeType == ($SuspendFun$Type) && other is $SuspendFun$Type; } } final _TopLevelKtClass = - jni.JClass.forName(r'com/github/dart_lang/jnigen/TopLevelKt'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/TopLevelKt'); final _id_getTopLevelField = _TopLevelKtClass.staticMethodId( r'getTopLevelField', r'()I', ); -final _getTopLevelField = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, +final _getTopLevelField = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public final int getTopLevelField()` int getTopLevelField() { return _getTopLevelField(_TopLevelKtClass.reference.pointer, - _id_getTopLevelField as jni.JMethodIDPtr) + _id_getTopLevelField as _$jni.JMethodIDPtr) .integer; } @@ -831,20 +894,21 @@ final _id_setTopLevelField = _TopLevelKtClass.staticMethodId( r'(I)V', ); -final _setTopLevelField = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallStaticVoidMethod') +final _setTopLevelField = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `static public final void setTopLevelField(int i)` void setTopLevelField( int i, ) { _setTopLevelField(_TopLevelKtClass.reference.pointer, - _id_setTopLevelField as jni.JMethodIDPtr, i) + _id_setTopLevelField as _$jni.JMethodIDPtr, i) .check(); } @@ -853,22 +917,22 @@ final _id_topLevel = _TopLevelKtClass.staticMethodId( r'()I', ); -final _topLevel = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, +final _topLevel = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public final int topLevel()` int topLevel() { - return _topLevel( - _TopLevelKtClass.reference.pointer, _id_topLevel as jni.JMethodIDPtr) + return _topLevel(_TopLevelKtClass.reference.pointer, + _id_topLevel as _$jni.JMethodIDPtr) .integer; } @@ -877,14 +941,16 @@ final _id_topLevelSum = _TopLevelKtClass.staticMethodId( r'(II)I', ); -final _topLevelSum = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32)>)>>( +final _topLevelSum = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( 'globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); /// from: `static public final int topLevelSum(int i, int i1)` int topLevelSum( @@ -892,6 +958,6 @@ int topLevelSum( int i1, ) { return _topLevelSum(_TopLevelKtClass.reference.pointer, - _id_topLevelSum as jni.JMethodIDPtr, i, i1) + _id_topLevelSum as _$jni.JMethodIDPtr, i, i1) .integer; } diff --git a/pkgs/jnigen/test/renamer_test.dart b/pkgs/jnigen/test/renamer_test.dart index a8bf9e15a..5fea38fc6 100644 --- a/pkgs/jnigen/test/renamer_test.dart +++ b/pkgs/jnigen/test/renamer_test.dart @@ -265,4 +265,34 @@ void main() { final renamedFields = classes.decls[r'_Foo$']!.fields.finalNames; expect(renamedFields, [r'$_foo$$']); }); + + test('Interface implementation methods', () async { + final classes = Classes({ + 'MyInterface': ClassDecl( + binaryName: 'MyInterface', + declKind: DeclKind.interfaceKind, + superclass: TypeUsage.object, + methods: [ + Method(name: 'implement', returnType: TypeUsage.object), + Method(name: 'implementIn', returnType: TypeUsage.object), + ], + ), + 'MyClass': ClassDecl( + binaryName: 'MyClass', + declKind: DeclKind.classKind, + superclass: TypeUsage.object, + methods: [ + Method(name: 'implement', returnType: TypeUsage.object), + Method(name: 'implementIn', returnType: TypeUsage.object), + ], + ), + }); + await rename(classes); + + final interfaceRenamedMethods = + classes.decls['MyInterface']!.methods.finalNames; + expect(interfaceRenamedMethods, [r'implement$1', r'implementIn$1']); + final classRenamedMethods = classes.decls['MyClass']!.methods.finalNames; + expect(classRenamedMethods, [r'implement', r'implementIn']); + }); } diff --git a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart index 016bf0402..08303ee91 100644 --- a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart @@ -11,12 +11,17 @@ // ignore_for_file: constant_identifier_names // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes // ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names // ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields // ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element @@ -26,116 +31,227 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import 'dart:ffi' as ffi; -import 'dart:isolate' show ReceivePort; +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as _$core; -import 'package:jni/internal_helpers_for_jnigen.dart'; -import 'package:jni/jni.dart' as jni; +import 'package:jni/_internal.dart' as _$jni; +import 'package:jni/jni.dart' as _$jni; + +/// from: `com.github.dart_lang.jnigen.simple_package.Color` +class Color extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + Color.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/simple_package/Color'); + + /// The type which includes information such as the signature of this class. + static const type = $Color$Type(); + static final _id_values = _class.staticMethodId( + r'values', + r'()[Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `static public com.github.dart_lang.jnigen.simple_package.Color[] values()` + /// The returned object must be released after use, by calling the [release] method. + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($Color$Type())); + } + + static final _id_valueOf = _class.staticMethodId( + r'valueOf', + r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name)` + /// The returned object must be released after use, by calling the [release] method. + static Color valueOf( + _$jni.JString name, + ) { + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + name.reference.pointer) + .object(const $Color$Type()); + } +} + +final class $Color$Type extends _$jni.JObjType { + @_$jni.internal + const $Color$Type(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Color;'; + + @_$jni.internal + @_$core.override + Color fromReference(_$jni.JReference reference) => + Color.fromReference(reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Color$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Color$Type) && other is $Color$Type; + } +} /// 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; +class Example_Nested_NestedTwice extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Example_Nested_NestedTwice.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( 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 = $Example_Nested_NestedTwiceType(); + static const type = $Example_Nested_NestedTwice$Type(); static final _id_ZERO = _class.staticFieldId( r'ZERO', r'I', ); /// from: `static public int ZERO` - static int get ZERO => _id_ZERO.get(_class, const jni.jintType()); + static int get ZERO => _id_ZERO.get(_class, const _$jni.jintType()); /// from: `static public int ZERO` static set ZERO(int value) => - _id_ZERO.set(_class, const jni.jintType(), value); + _id_ZERO.set(_class, const _$jni.jintType(), value); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example_Nested_NestedTwice() { return Example_Nested_NestedTwice.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $Example_Nested_NestedTwiceType - extends jni.JObjType { - const $Example_Nested_NestedTwiceType(); +final class $Example_Nested_NestedTwice$Type + extends _$jni.JObjType { + @_$jni.internal + const $Example_Nested_NestedTwice$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;'; - @override - Example_Nested_NestedTwice fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Example_Nested_NestedTwice fromReference(_$jni.JReference reference) => Example_Nested_NestedTwice.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Example_Nested_NestedTwiceType).hashCode; + @_$core.override + int get hashCode => ($Example_Nested_NestedTwice$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested_NestedTwiceType) && - other is $Example_Nested_NestedTwiceType; + return other.runtimeType == ($Example_Nested_NestedTwice$Type) && + other is $Example_Nested_NestedTwice$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Example$Nested` -class Example_Nested extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Example_Nested extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Example_Nested.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( 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 const type = $Example_Nested$Type(); static final _id_new$ = _class.constructorId( r'(Z)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void (boolean value)` /// The returned object must be released after use, by calling the [release] method. @@ -143,7 +259,7 @@ class Example_Nested extends jni.JObject { bool value, ) { return Example_Nested.fromReference(_new$(_class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, value ? 1 : 0) + _id_new$ as _$jni.JMethodIDPtr, value ? 1 : 0) .reference); } @@ -152,22 +268,22 @@ class Example_Nested extends jni.JObject { r'()V', ); - static final _usesAnonymousInnerClass = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _usesAnonymousInnerClass = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void usesAnonymousInnerClass()` void usesAnonymousInnerClass() { - _usesAnonymousInnerClass( - reference.pointer, _id_usesAnonymousInnerClass as jni.JMethodIDPtr) + _usesAnonymousInnerClass(reference.pointer, + _id_usesAnonymousInnerClass as _$jni.JMethodIDPtr) .check(); } @@ -176,21 +292,21 @@ class Example_Nested extends jni.JObject { r'()Z', ); - static final _getValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getValue()` bool getValue() { - return _getValue(reference.pointer, _id_getValue as jni.JMethodIDPtr) + return _getValue(reference.pointer, _id_getValue as _$jni.JMethodIDPtr) .boolean; } @@ -199,92 +315,100 @@ class Example_Nested extends jni.JObject { r'(Z)V', ); - static final _setValue = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setValue = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setValue(boolean value)` void setValue( bool value, ) { - _setValue( - reference.pointer, _id_setValue as jni.JMethodIDPtr, value ? 1 : 0) + _setValue(reference.pointer, _id_setValue as _$jni.JMethodIDPtr, + value ? 1 : 0) .check(); } } -final class $Example_NestedType extends jni.JObjType { - const $Example_NestedType(); +final class $Example_Nested$Type extends _$jni.JObjType { + @_$jni.internal + const $Example_Nested$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;'; - @override - Example_Nested fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Example_Nested fromReference(_$jni.JReference reference) => Example_Nested.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Example_NestedType).hashCode; + @_$core.override + int get hashCode => ($Example_Nested$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Example_NestedType) && - other is $Example_NestedType; + return other.runtimeType == ($Example_Nested$Type) && + other is $Example_Nested$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested` -class Example_NonStaticNested extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Example_NonStaticNested extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Example_NonStaticNested.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( + static final _class = _$jni.JClass.forName( 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 const type = $Example_NonStaticNested$Type(); static final _id_ok = _class.instanceFieldId( r'ok', r'Z', ); /// from: `public boolean ok` - bool get ok => _id_ok.get(this, const jni.jbooleanType()); + bool get ok => _id_ok.get(this, const _$jni.jbooleanType()); /// from: `public boolean ok` - set ok(bool value) => _id_ok.set(this, const jni.jbooleanType(), value); + set ok(bool value) => _id_ok.set(this, const _$jni.jbooleanType(), value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/simple_package/Example;)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// 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. @@ -292,53 +416,61 @@ class Example_NonStaticNested extends jni.JObject { Example $parent, ) { return Example_NonStaticNested.fromReference(_new$(_class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, $parent.reference.pointer) + _id_new$ as _$jni.JMethodIDPtr, $parent.reference.pointer) .reference); } } -final class $Example_NonStaticNestedType - extends jni.JObjType { - const $Example_NonStaticNestedType(); +final class $Example_NonStaticNested$Type + extends _$jni.JObjType { + @_$jni.internal + const $Example_NonStaticNested$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;'; - @override - Example_NonStaticNested fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Example_NonStaticNested fromReference(_$jni.JReference reference) => Example_NonStaticNested.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Example_NonStaticNestedType).hashCode; + @_$core.override + int get hashCode => ($Example_NonStaticNested$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Example_NonStaticNestedType) && - other is $Example_NonStaticNestedType; + return other.runtimeType == ($Example_NonStaticNested$Type) && + other is $Example_NonStaticNested$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Example` -class Example extends jni.JObject { - @override - late final jni.JObjType $type = type; +class Example extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + @_$jni.internal Example.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/simple_package/Example'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/simple_package/Example'); /// The type which includes information such as the signature of this class. - static const type = $ExampleType(); + static const type = $Example$Type(); /// from: `static public final int ON` static const ON = 1; @@ -358,8 +490,8 @@ class Example extends jni.JObject { /// from: `static public final java.lang.String SEMICOLON_STRING` /// The returned object must be released after use, by calling the [release] method. - static jni.JString get SEMICOLON_STRING => - _id_SEMICOLON_STRING.get(_class, const jni.JStringType()); + static _$jni.JString get SEMICOLON_STRING => + _id_SEMICOLON_STRING.get(_class, const _$jni.JStringType()); static final _id_unusedRandom = _class.staticFieldId( r'unusedRandom', @@ -368,30 +500,30 @@ class Example extends jni.JObject { /// from: `static public final java.util.Random unusedRandom` /// The returned object must be released after use, by calling the [release] method. - static jni.JObject get unusedRandom => - _id_unusedRandom.get(_class, const jni.JObjectType()); + static _$jni.JObject get unusedRandom => + _id_unusedRandom.get(_class, const _$jni.JObjectType()); static final _id_getAmount = _class.staticMethodId( r'getAmount', r'()I', ); - static final _getAmount = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getAmount = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public int getAmount()` static int getAmount() { return _getAmount( - _class.reference.pointer, _id_getAmount as jni.JMethodIDPtr) + _class.reference.pointer, _id_getAmount as _$jni.JMethodIDPtr) .integer; } @@ -400,21 +532,21 @@ class Example extends jni.JObject { r'()D', ); - static final _getPi = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getPi = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticDoubleMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public double getPi()` static double getPi() { - return _getPi(_class.reference.pointer, _id_getPi as jni.JMethodIDPtr) + return _getPi(_class.reference.pointer, _id_getPi as _$jni.JMethodIDPtr) .doubleFloat; } @@ -423,22 +555,22 @@ class Example extends jni.JObject { r'()C', ); - static final _getAsterisk = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getAsterisk = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticCharMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public char getAsterisk()` static int getAsterisk() { return _getAsterisk( - _class.reference.pointer, _id_getAsterisk as jni.JMethodIDPtr) + _class.reference.pointer, _id_getAsterisk as _$jni.JMethodIDPtr) .char; } @@ -447,23 +579,23 @@ class Example extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public java.lang.String getName()` /// The returned object must be released after use, by calling the [release] method. - static jni.JString getName() { - return _getName(_class.reference.pointer, _id_getName as jni.JMethodIDPtr) - .object(const jni.JStringType()); + static _$jni.JString getName() { + return _getName(_class.reference.pointer, _id_getName as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_getNestedInstance = _class.staticMethodId( @@ -471,24 +603,24 @@ class Example extends jni.JObject { r'()Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;', ); - static final _getNestedInstance = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNestedInstance = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.simple_package.Example.Nested getNestedInstance()` /// The returned object must be released after use, by calling the [release] method. static Example_Nested getNestedInstance() { - return _getNestedInstance( - _class.reference.pointer, _id_getNestedInstance as jni.JMethodIDPtr) - .object(const $Example_NestedType()); + return _getNestedInstance(_class.reference.pointer, + _id_getNestedInstance as _$jni.JMethodIDPtr) + .object(const $Example_Nested$Type()); } static final _id_setAmount = _class.staticMethodId( @@ -496,21 +628,20 @@ class Example extends jni.JObject { r'(I)V', ); - static final _setAmount = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallStaticVoidMethod') + static final _setAmount = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `static public void setAmount(int newAmount)` static void setAmount( int newAmount, ) { - _setAmount(_class.reference.pointer, _id_setAmount as jni.JMethodIDPtr, + _setAmount(_class.reference.pointer, _id_setAmount as _$jni.JMethodIDPtr, newAmount) .check(); } @@ -520,22 +651,22 @@ class Example extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setName = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setName = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public void setName(java.lang.String newName)` static void setName( - jni.JString newName, + _$jni.JString newName, ) { - _setName(_class.reference.pointer, _id_setName as jni.JMethodIDPtr, + _setName(_class.reference.pointer, _id_setName as _$jni.JMethodIDPtr, newName.reference.pointer) .check(); } @@ -545,16 +676,16 @@ class Example extends jni.JObject { r'(Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;)V', ); - static final _setNestedInstance = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setNestedInstance = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public void setNestedInstance(com.github.dart_lang.jnigen.simple_package.Example.Nested newNested)` static void setNestedInstance( @@ -562,7 +693,7 @@ class Example extends jni.JObject { ) { _setNestedInstance( _class.reference.pointer, - _id_setNestedInstance as jni.JMethodIDPtr, + _id_setNestedInstance as _$jni.JMethodIDPtr, newNested.reference.pointer) .check(); } @@ -572,16 +703,21 @@ class Example extends jni.JObject { r'(IIII)I', ); - static final _max4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32, $Int32, $Int32)>)>>( - 'globalEnv_CallStaticIntMethod') + static final _max4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, int)>(); /// from: `static public int max4(int a, int b, int c, int d)` static int max4( @@ -590,8 +726,8 @@ class Example extends jni.JObject { int c, int d, ) { - return _max4( - _class.reference.pointer, _id_max4 as jni.JMethodIDPtr, a, b, c, d) + return _max4(_class.reference.pointer, _id_max4 as _$jni.JMethodIDPtr, a, b, + c, d) .integer; } @@ -600,25 +736,25 @@ class Example extends jni.JObject { r'(IIIIIIII)I', ); - static final _max8 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _max8 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32 + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 )>)>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - int, int, int, int, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); /// from: `static public int max8(int a, int b, int c, int d, int e, int f, int g, int h)` static int max8( @@ -631,7 +767,7 @@ class Example extends jni.JObject { int g, int h, ) { - return _max8(_class.reference.pointer, _id_max8 as jni.JMethodIDPtr, a, b, + return _max8(_class.reference.pointer, _id_max8 as _$jni.JMethodIDPtr, a, b, c, d, e, f, g, h) .integer; } @@ -641,21 +777,21 @@ class Example extends jni.JObject { r'()I', ); - static final _getNumber = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getNumber = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int getNumber()` int getNumber() { - return _getNumber(reference.pointer, _id_getNumber as jni.JMethodIDPtr) + return _getNumber(reference.pointer, _id_getNumber as _$jni.JMethodIDPtr) .integer; } @@ -664,21 +800,21 @@ class Example extends jni.JObject { r'(I)V', ); - static final _setNumber = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setNumber = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setNumber(int number)` void setNumber( int number, ) { - _setNumber(reference.pointer, _id_setNumber as jni.JMethodIDPtr, number) + _setNumber(reference.pointer, _id_setNumber as _$jni.JMethodIDPtr, number) .check(); } @@ -687,21 +823,22 @@ class Example extends jni.JObject { r'()Z', ); - static final _getIsUp = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getIsUp = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public boolean getIsUp()` bool getIsUp() { - return _getIsUp(reference.pointer, _id_getIsUp as jni.JMethodIDPtr).boolean; + return _getIsUp(reference.pointer, _id_getIsUp as _$jni.JMethodIDPtr) + .boolean; } static final _id_setUp = _class.instanceMethodId( @@ -709,21 +846,21 @@ class Example extends jni.JObject { r'(Z)V', ); - static final _setUp = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setUp = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void setUp(boolean isUp)` void setUp( bool isUp, ) { - _setUp(reference.pointer, _id_setUp as jni.JMethodIDPtr, isUp ? 1 : 0) + _setUp(reference.pointer, _id_setUp as _$jni.JMethodIDPtr, isUp ? 1 : 0) .check(); } @@ -732,23 +869,24 @@ class Example extends jni.JObject { r'()Ljava/lang/String;', ); - static final _getCodename = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getCodename = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.lang.String getCodename()` /// The returned object must be released after use, by calling the [release] method. - jni.JString getCodename() { - return _getCodename(reference.pointer, _id_getCodename as jni.JMethodIDPtr) - .object(const jni.JStringType()); + _$jni.JString getCodename() { + return _getCodename( + reference.pointer, _id_getCodename as _$jni.JMethodIDPtr) + .object(const _$jni.JStringType()); } static final _id_setCodename = _class.instanceMethodId( @@ -756,22 +894,22 @@ class Example extends jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setCodename = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setCodename = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setCodename(java.lang.String codename)` void setCodename( - jni.JString codename, + _$jni.JString codename, ) { - _setCodename(reference.pointer, _id_setCodename as jni.JMethodIDPtr, + _setCodename(reference.pointer, _id_setCodename as _$jni.JMethodIDPtr, codename.reference.pointer) .check(); } @@ -781,23 +919,23 @@ class Example extends jni.JObject { r'()Ljava/util/Random;', ); - static final _getRandom = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getRandom = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.Random getRandom()` /// The returned object must be released after use, by calling the [release] method. - jni.JObject getRandom() { - return _getRandom(reference.pointer, _id_getRandom as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + _$jni.JObject getRandom() { + return _getRandom(reference.pointer, _id_getRandom as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } static final _id_setRandom = _class.instanceMethodId( @@ -805,22 +943,22 @@ class Example extends jni.JObject { r'(Ljava/util/Random;)V', ); - static final _setRandom = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _setRandom = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void setRandom(java.util.Random random)` void setRandom( - jni.JObject random, + _$jni.JObject random, ) { - _setRandom(reference.pointer, _id_setRandom as jni.JMethodIDPtr, + _setRandom(reference.pointer, _id_setRandom as _$jni.JMethodIDPtr, random.reference.pointer) .check(); } @@ -830,22 +968,22 @@ class Example extends jni.JObject { r'()J', ); - static final _getRandomLong = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getRandomLong = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public long getRandomLong()` int getRandomLong() { return _getRandomLong( - reference.pointer, _id_getRandomLong as jni.JMethodIDPtr) + reference.pointer, _id_getRandomLong as _$jni.JMethodIDPtr) .long; } @@ -854,21 +992,21 @@ class Example extends jni.JObject { r'(JJJJ)J', ); - static final _add4Longs = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _add4Longs = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64 + _$jni.Int64, + _$jni.Int64, + _$jni.Int64, + _$jni.Int64 )>)>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, int)>(); /// from: `public long add4Longs(long a, long b, long c, long d)` int add4Longs( @@ -878,7 +1016,7 @@ class Example extends jni.JObject { int d, ) { return _add4Longs( - reference.pointer, _id_add4Longs as jni.JMethodIDPtr, a, b, c, d) + reference.pointer, _id_add4Longs as _$jni.JMethodIDPtr, a, b, c, d) .long; } @@ -887,25 +1025,25 @@ class Example extends jni.JObject { r'(JJJJJJJJ)J', ); - static final _add8Longs = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _add8Longs = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ffi.Int64 + _$jni.Int64, + _$jni.Int64, + _$jni.Int64, + _$jni.Int64, + _$jni.Int64, + _$jni.Int64, + _$jni.Int64, + _$jni.Int64 )>)>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - int, int, int, int, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); /// from: `public long add8Longs(long a, long b, long c, long d, long e, long f, long g, long h)` int add8Longs( @@ -918,7 +1056,7 @@ class Example extends jni.JObject { int g, int h, ) { - return _add8Longs(reference.pointer, _id_add8Longs as jni.JMethodIDPtr, a, + return _add8Longs(reference.pointer, _id_add8Longs as _$jni.JMethodIDPtr, a, b, c, d, e, f, g, h) .long; } @@ -928,27 +1066,27 @@ class Example extends jni.JObject { r'(Ljava/util/Random;)Ljava/lang/String;', ); - static final _getRandomNumericString = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _getRandomNumericString = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.lang.String getRandomNumericString(java.util.Random random)` /// The returned object must be released after use, by calling the [release] method. - jni.JString getRandomNumericString( - jni.JObject random, + _$jni.JString getRandomNumericString( + _$jni.JObject random, ) { return _getRandomNumericString( reference.pointer, - _id_getRandomNumericString as jni.JMethodIDPtr, + _id_getRandomNumericString as _$jni.JMethodIDPtr, random.reference.pointer) - .object(const jni.JStringType()); + .object(const _$jni.JStringType()); } static final _id_finalMethod = _class.instanceMethodId( @@ -956,21 +1094,21 @@ class Example extends jni.JObject { r'()V', ); - static final _finalMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _finalMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public final void finalMethod()` void finalMethod() { - _finalMethod(reference.pointer, _id_finalMethod as jni.JMethodIDPtr) + _finalMethod(reference.pointer, _id_finalMethod as _$jni.JMethodIDPtr) .check(); } @@ -979,23 +1117,23 @@ class Example extends jni.JObject { r'()Ljava/util/List;', ); - static final _getList = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public java.util.List getList()` /// The returned object must be released after use, by calling the [release] method. - jni.JList getList() { - return _getList(reference.pointer, _id_getList as jni.JMethodIDPtr) - .object(const jni.JListType(jni.JStringType())); + _$jni.JList<_$jni.JString> getList() { + return _getList(reference.pointer, _id_getList as _$jni.JMethodIDPtr) + .object(const _$jni.JListType(_$jni.JStringType())); } static final _id_joinStrings = _class.instanceMethodId( @@ -1003,31 +1141,37 @@ class Example extends jni.JObject { r'(Ljava/util/List;Ljava/lang/String;)Ljava/lang/String;', ); - static final _joinStrings = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _joinStrings = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public java.lang.String joinStrings(java.util.List values, java.lang.String delim)` /// The returned object must be released after use, by calling the [release] method. /// /// Joins the strings in the list using the given delimiter. - jni.JString joinStrings( - jni.JList values, - jni.JString delim, + _$jni.JString joinStrings( + _$jni.JList<_$jni.JString> values, + _$jni.JString delim, ) { - return _joinStrings(reference.pointer, _id_joinStrings as jni.JMethodIDPtr, - values.reference.pointer, delim.reference.pointer) - .object(const jni.JStringType()); + return _joinStrings( + reference.pointer, + _id_joinStrings as _$jni.JMethodIDPtr, + values.reference.pointer, + delim.reference.pointer) + .object(const _$jni.JStringType()); } static final _id_methodWithSeveralParams = _class.instanceMethodId( @@ -1035,48 +1179,48 @@ class Example extends jni.JObject { r'(CLjava/lang/String;[ILjava/lang/CharSequence;Ljava/util/List;Ljava/util/Map;)V', ); - static final _methodWithSeveralParams = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _methodWithSeveralParams = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - $Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer + _$jni.Int32, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void methodWithSeveralParams(char ch, java.lang.String s, int[] a, T t, java.util.List lt, java.util.Map wm)` - void methodWithSeveralParams<$T extends jni.JObject>( + void methodWithSeveralParams<$T extends _$jni.JObject>( int ch, - jni.JString s, - jni.JArray a, + _$jni.JString s, + _$jni.JArray<_$jni.jint> a, $T t, - jni.JList<$T> lt, - jni.JMap wm, { - jni.JObjType<$T>? T, + _$jni.JList<$T> lt, + _$jni.JMap<_$jni.JString, _$jni.JObject> wm, { + _$jni.JObjType<$T>? T, }) { - T ??= jni.lowestCommonSuperType([ - (lt.$type as jni.JListType).E, + T ??= _$jni.lowestCommonSuperType([ + (lt.$type as _$jni.JListType).E, t.$type, - ]) as jni.JObjType<$T>; + ]) as _$jni.JObjType<$T>; _methodWithSeveralParams( reference.pointer, - _id_methodWithSeveralParams as jni.JMethodIDPtr, + _id_methodWithSeveralParams as _$jni.JMethodIDPtr, ch, s.reference.pointer, a.reference.pointer, @@ -1090,23 +1234,23 @@ class Example extends jni.JObject { r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } @@ -1114,35 +1258,40 @@ class Example extends jni.JObject { r'(I)V', ); - static final _new$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_NewObject') + static final _new$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void (int number)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$1( int number, ) { - return Example.fromReference( - _new$1(_class.reference.pointer, _id_new$1 as jni.JMethodIDPtr, number) - .reference); + return Example.fromReference(_new$1( + _class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, number) + .reference); } static final _id_new$2 = _class.constructorId( r'(IZ)V', ); - static final _new$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32)>)>>('globalEnv_NewObject') + static final _new$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + 'globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); /// from: `public void (int number, boolean isUp)` /// The returned object must be released after use, by calling the [release] method. @@ -1151,7 +1300,7 @@ class Example extends jni.JObject { bool isUp, ) { return Example.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as jni.JMethodIDPtr, number, isUp ? 1 : 0) + _id_new$2 as _$jni.JMethodIDPtr, number, isUp ? 1 : 0) .reference); } @@ -1159,27 +1308,31 @@ class Example extends jni.JObject { r'(IZLjava/lang/String;)V', ); - static final _new$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32, ffi.Pointer)>)>>( - 'globalEnv_NewObject') + static final _new$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Int32, + _$jni.Int32, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - int, ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void (int number, boolean isUp, java.lang.String codename)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$3( int number, bool isUp, - jni.JString codename, + _$jni.JString codename, ) { return Example.fromReference(_new$3( _class.reference.pointer, - _id_new$3 as jni.JMethodIDPtr, + _id_new$3 as _$jni.JMethodIDPtr, number, isUp ? 1 : 0, codename.reference.pointer) @@ -1190,25 +1343,25 @@ class Example extends jni.JObject { r'(IIIIIIII)V', ); - static final _new$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _new$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32 + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - int, int, int, int, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); /// from: `public void (int a, int b, int c, int d, int e, int f, int g, int h)` /// The returned object must be released after use, by calling the [release] method. @@ -1223,7 +1376,7 @@ class Example extends jni.JObject { int h, ) { return Example.fromReference(_new$4(_class.reference.pointer, - _id_new$4 as jni.JMethodIDPtr, a, b, c, d, e, f, g, h) + _id_new$4 as _$jni.JMethodIDPtr, a, b, c, d, e, f, g, h) .reference); } @@ -1232,22 +1385,22 @@ class Example extends jni.JObject { r'()I', ); - static final _whichExample = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _whichExample = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public int whichExample()` int whichExample() { return _whichExample( - reference.pointer, _id_whichExample as jni.JMethodIDPtr) + reference.pointer, _id_whichExample as _$jni.JMethodIDPtr) .integer; } @@ -1256,14 +1409,16 @@ class Example extends jni.JObject { r'(II)I', ); - static final _addInts = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, - jni.JMethodIDPtr, ffi.VarArgs<($Int32, $Int32)>)>>( + static final _addInts = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( 'globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, int, int)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); /// from: `static public int addInts(int a, int b)` static int addInts( @@ -1271,7 +1426,7 @@ class Example extends jni.JObject { int b, ) { return _addInts( - _class.reference.pointer, _id_addInts as jni.JMethodIDPtr, a, b) + _class.reference.pointer, _id_addInts as _$jni.JMethodIDPtr, a, b) .integer; } @@ -1280,23 +1435,23 @@ class Example extends jni.JObject { r'()[I', ); - static final _getArr = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getArr = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public int[] getArr()` /// The returned object must be released after use, by calling the [release] method. - static jni.JArray getArr() { - return _getArr(_class.reference.pointer, _id_getArr as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jintType())); + static _$jni.JArray<_$jni.jint> getArr() { + return _getArr(_class.reference.pointer, _id_getArr as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jintType())); } static final _id_addAll = _class.staticMethodId( @@ -1304,22 +1459,22 @@ class Example extends jni.JObject { r'([I)I', ); - static final _addAll = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _addAll = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `static public int addAll(int[] arr)` static int addAll( - jni.JArray arr, + _$jni.JArray<_$jni.jint> arr, ) { - return _addAll(_class.reference.pointer, _id_addAll as jni.JMethodIDPtr, + return _addAll(_class.reference.pointer, _id_addAll as _$jni.JMethodIDPtr, arr.reference.pointer) .integer; } @@ -1329,23 +1484,23 @@ class Example extends jni.JObject { r'()Lcom/github/dart_lang/jnigen/simple_package/Example;', ); - static final _getSelf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _getSelf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.simple_package.Example getSelf()` /// The returned object must be released after use, by calling the [release] method. Example getSelf() { - return _getSelf(reference.pointer, _id_getSelf as jni.JMethodIDPtr) - .object(const $ExampleType()); + return _getSelf(reference.pointer, _id_getSelf as _$jni.JMethodIDPtr) + .object(const $Example$Type()); } static final _id_throwException = _class.staticMethodId( @@ -1353,22 +1508,22 @@ class Example extends jni.JObject { r'()V', ); - static final _throwException = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _throwException = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallStaticVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `static public void throwException()` static void throwException() { _throwException( - _class.reference.pointer, _id_throwException as jni.JMethodIDPtr) + _class.reference.pointer, _id_throwException as _$jni.JMethodIDPtr) .check(); } @@ -1377,21 +1532,22 @@ class Example extends jni.JObject { r'()V', ); - static final _overloaded = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _overloaded = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void overloaded()` void overloaded() { - _overloaded(reference.pointer, _id_overloaded as jni.JMethodIDPtr).check(); + _overloaded(reference.pointer, _id_overloaded as _$jni.JMethodIDPtr) + .check(); } static final _id_overloaded$1 = _class.instanceMethodId( @@ -1399,23 +1555,24 @@ class Example extends jni.JObject { r'(ILjava/lang/String;)V', ); - static final _overloaded$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32, ffi.Pointer)>)>>( + static final _overloaded$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Int32, _$jni.Pointer<_$jni.Void>)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - int, ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void overloaded(int a, java.lang.String b)` void overloaded$1( int a, - jni.JString b, + _$jni.JString b, ) { - _overloaded$1(reference.pointer, _id_overloaded$1 as jni.JMethodIDPtr, a, + _overloaded$1(reference.pointer, _id_overloaded$1 as _$jni.JMethodIDPtr, a, b.reference.pointer) .check(); } @@ -1425,21 +1582,21 @@ class Example extends jni.JObject { r'(I)V', ); - static final _overloaded$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') + static final _overloaded$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, jni.JMethodIDPtr, int)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); /// from: `public void overloaded(int a)` void overloaded$2( int a, ) { - _overloaded$2(reference.pointer, _id_overloaded$2 as jni.JMethodIDPtr, a) + _overloaded$2(reference.pointer, _id_overloaded$2 as _$jni.JMethodIDPtr, a) .check(); } @@ -1448,26 +1605,29 @@ class Example extends jni.JObject { r'(Ljava/util/List;Ljava/lang/String;)V', ); - static final _overloaded$3 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _overloaded$3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> )>)>>('globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); /// from: `public void overloaded(java.util.List a, java.lang.String b)` void overloaded$3( - jni.JList a, - jni.JString b, + _$jni.JList<_$jni.JInteger> a, + _$jni.JString b, ) { - _overloaded$3(reference.pointer, _id_overloaded$3 as jni.JMethodIDPtr, + _overloaded$3(reference.pointer, _id_overloaded$3 as _$jni.JMethodIDPtr, a.reference.pointer, b.reference.pointer) .check(); } @@ -1477,2772 +1637,3148 @@ class Example extends jni.JObject { r'(Ljava/util/List;)V', ); - static final _overloaded$4 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( + static final _overloaded$4 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); /// from: `public void overloaded(java.util.List a)` void overloaded$4( - jni.JList a, + _$jni.JList<_$jni.JInteger> a, ) { - _overloaded$4(reference.pointer, _id_overloaded$4 as jni.JMethodIDPtr, + _overloaded$4(reference.pointer, _id_overloaded$4 as _$jni.JMethodIDPtr, a.reference.pointer) .check(); } } -final class $ExampleType extends jni.JObjType { - const $ExampleType(); +final class $Example$Type extends _$jni.JObjType { + @_$jni.internal + const $Example$Type(); - @override + @_$jni.internal + @_$core.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example;'; - @override - Example fromReference(jni.JReference reference) => + @_$jni.internal + @_$core.override + Example fromReference(_$jni.JReference reference) => Example.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($ExampleType).hashCode; + @_$core.override + int get hashCode => ($Example$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($ExampleType) && other is $ExampleType; + return other.runtimeType == ($Example$Type) && other is $Example$Type; } } -/// from: `com.github.dart_lang.jnigen.pkg2.C2` -class C2 extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.simple_package.Exceptions` +class Exceptions extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - C2.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + Exceptions.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/C2'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/simple_package/Exceptions'); /// The type which includes information such as the signature of this class. - static const type = $C2Type(); - static final _id_CONSTANT = _class.staticFieldId( - r'CONSTANT', - r'I', - ); - - /// from: `static public int CONSTANT` - static int get CONSTANT => _id_CONSTANT.get(_class, const jni.jintType()); - - /// from: `static public int CONSTANT` - static set CONSTANT(int value) => - _id_CONSTANT.set(_class, const jni.jintType(), value); - + static const type = $Exceptions$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory C2() { - return C2.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + factory Exceptions() { + return Exceptions.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } -} - -final class $C2Type extends jni.JObjType { - const $C2Type(); - - @override - String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/C2;'; - @override - C2 fromReference(jni.JReference reference) => C2.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; + static final _id_new$1 = _class.constructorId( + r'(F)V', + ); - @override - int get hashCode => ($C2Type).hashCode; + static final _new$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($C2Type) && other is $C2Type; + /// from: `public void (float x)` + /// The returned object must be released after use, by calling the [release] method. + factory Exceptions.new$1( + double x, + ) { + return Exceptions.fromReference( + _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, x) + .reference); } -} -/// from: `com.github.dart_lang.jnigen.pkg2.Example` -class Example$1 extends jni.JObject { - @override - late final jni.JObjType $type = type; + static final _id_new$2 = _class.constructorId( + r'(IIIIII)V', + ); - Example$1.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + static final _new$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32 + )>)>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, int, int, int)>(); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/Example'); + /// 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.new$2( + int a, + int b, + int c, + int d, + int e, + int f, + ) { + return Exceptions.fromReference(_new$2(_class.reference.pointer, + _id_new$2 as _$jni.JMethodIDPtr, a, b, c, d, e, f) + .reference); + } - /// The type which includes information such as the signature of this class. - static const type = $Example$1Type(); - static final _id_new$ = _class.constructorId( - r'()V', + static final _id_staticObjectMethod = _class.staticMethodId( + r'staticObjectMethod', + r'()Ljava/lang/Object;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') + static final _staticObjectMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public void ()` + /// from: `static public java.lang.Object staticObjectMethod()` /// The returned object must be released after use, by calling the [release] method. - factory Example$1() { - return Example$1.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); + static _$jni.JObject staticObjectMethod() { + return _staticObjectMethod(_class.reference.pointer, + _id_staticObjectMethod as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } - static final _id_whichExample = _class.instanceMethodId( - r'whichExample', + static final _id_staticIntMethod = _class.staticMethodId( + r'staticIntMethod', r'()I', ); - static final _whichExample = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') + static final _staticIntMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public int whichExample()` - int whichExample() { - return _whichExample( - reference.pointer, _id_whichExample as jni.JMethodIDPtr) + /// from: `static public int staticIntMethod()` + static int staticIntMethod() { + return _staticIntMethod( + _class.reference.pointer, _id_staticIntMethod as _$jni.JMethodIDPtr) .integer; } -} - -final class $Example$1Type extends jni.JObjType { - const $Example$1Type(); - @override - String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/Example;'; + static final _id_staticObjectArrayMethod = _class.staticMethodId( + r'staticObjectArrayMethod', + r'()[Ljava/lang/Object;', + ); - @override - Example$1 fromReference(jni.JReference reference) => - Example$1.fromReference(reference); + static final _staticObjectArrayMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - @override - jni.JObjType get superType => const jni.JObjectType(); + /// from: `static public java.lang.Object[] staticObjectArrayMethod()` + /// The returned object must be released after use, by calling the [release] method. + static _$jni.JArray<_$jni.JObject> staticObjectArrayMethod() { + return _staticObjectArrayMethod(_class.reference.pointer, + _id_staticObjectArrayMethod as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.JObjectType())); + } - @override - final superCount = 1; + static final _id_staticIntArrayMethod = _class.staticMethodId( + r'staticIntArrayMethod', + r'()[I', + ); - @override - int get hashCode => ($Example$1Type).hashCode; + static final _staticIntArrayMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($Example$1Type) && other is $Example$1Type; + /// from: `static public int[] staticIntArrayMethod()` + /// The returned object must be released after use, by calling the [release] method. + static _$jni.JArray<_$jni.jint> staticIntArrayMethod() { + return _staticIntArrayMethod(_class.reference.pointer, + _id_staticIntArrayMethod as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jintType())); } -} -/// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child` -class GrandParent_Parent_Child<$T extends jni.JObject, $S extends jni.JObject, - $U extends jni.JObject> extends jni.JObject { - @override - late final jni.JObjType> $type = - type(T, S, U); + static final _id_objectMethod = _class.instanceMethodId( + r'objectMethod', + r'()Ljava/lang/Object;', + ); - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; + static final _objectMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - GrandParent_Parent_Child.fromReference( - this.T, - this.S, - this.U, - jni.JReference reference, - ) : super.fromReference(reference); + /// from: `public java.lang.Object objectMethod()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JObject objectMethod() { + return _objectMethod( + reference.pointer, _id_objectMethod as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); + } - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child'); + static final _id_intMethod = _class.instanceMethodId( + r'intMethod', + r'()I', + ); - /// The type which includes information such as the signature of this class. - static $GrandParent_Parent_ChildType<$T, $S, $U> type<$T extends jni.JObject, - $S extends jni.JObject, $U extends jni.JObject>( - jni.JObjType<$T> T, - jni.JObjType<$S> S, - jni.JObjType<$U> U, - ) { - return $GrandParent_Parent_ChildType( - T, - S, - U, - ); + static final _intMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public int intMethod()` + int intMethod() { + return _intMethod(reference.pointer, _id_intMethod as _$jni.JMethodIDPtr) + .integer; } - static final _id_grandParentValue = _class.instanceFieldId( - r'grandParentValue', - r'Ljava/lang/Object;', + static final _id_objectArrayMethod = _class.instanceMethodId( + r'objectArrayMethod', + r'()[Ljava/lang/Object;', ); - /// from: `public T grandParentValue` - /// The returned object must be released after use, by calling the [release] method. - $T get grandParentValue => _id_grandParentValue.get(this, T); + static final _objectArrayMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public T grandParentValue` + /// from: `public java.lang.Object[] objectArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - set grandParentValue($T value) => _id_grandParentValue.set(this, T, value); + _$jni.JArray<_$jni.JObject> objectArrayMethod() { + return _objectArrayMethod( + reference.pointer, _id_objectArrayMethod as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.JObjectType())); + } - static final _id_parentValue = _class.instanceFieldId( - r'parentValue', - r'Ljava/lang/Object;', + static final _id_intArrayMethod = _class.instanceMethodId( + r'intArrayMethod', + r'()[I', ); - /// from: `public S parentValue` - /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => _id_parentValue.get(this, S); + static final _intArrayMethod = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public S parentValue` + /// from: `public int[] intArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => _id_parentValue.set(this, S, value); + _$jni.JArray<_$jni.jint> intArrayMethod() { + return _intArrayMethod( + reference.pointer, _id_intArrayMethod as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType(_$jni.jintType())); + } - static final _id_value = _class.instanceFieldId( - r'value', - r'Ljava/lang/Object;', + static final _id_throwNullPointerException = _class.instanceMethodId( + r'throwNullPointerException', + r'()I', ); - /// from: `public U value` - /// The returned object must be released after use, by calling the [release] method. - $U get value => _id_value.get(this, U); - - /// from: `public U value` - /// The returned object must be released after use, by calling the [release] method. - set value($U value) => _id_value.set(this, U, value); - - static final _id_new$ = _class.constructorId( - r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V', - ); - - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_NewObject') + static final _throwNullPointerException = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $parent, U newValue)` - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_Parent_Child( - GrandParent_Parent<$T, $S> $parent, - $U newValue, { - jni.JObjType<$T>? T, - jni.JObjType<$S>? S, - jni.JObjType<$U>? U, - }) { - T ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParent_ParentType).T, - ]) as jni.JObjType<$T>; - S ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParent_ParentType).S, - ]) as jni.JObjType<$S>; - U ??= jni.lowestCommonSuperType([ - newValue.$type, - ]) as jni.JObjType<$U>; - return GrandParent_Parent_Child.fromReference( - T, - S, - U, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr, - $parent.reference.pointer, newValue.reference.pointer) - .reference); + /// from: `public int throwNullPointerException()` + int throwNullPointerException() { + return _throwNullPointerException(reference.pointer, + _id_throwNullPointerException as _$jni.JMethodIDPtr) + .integer; } -} -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, + static final _id_throwFileNotFoundException = _class.instanceMethodId( + r'throwFileNotFoundException', + r'()Ljava/io/InputStream;', ); - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;'; - - @override - GrandParent_Parent_Child<$T, $S, $U> fromReference( - jni.JReference reference) => - GrandParent_Parent_Child.fromReference(T, S, U, reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => Object.hash($GrandParent_Parent_ChildType, T, S, U); + static final _throwFileNotFoundException = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - @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: `public java.io.InputStream throwFileNotFoundException()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JObject throwFileNotFoundException() { + return _throwFileNotFoundException(reference.pointer, + _id_throwFileNotFoundException as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } -} -/// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent` -class GrandParent_Parent<$T extends jni.JObject, $S extends jni.JObject> - extends jni.JObject { - @override - late final jni.JObjType> $type = type(T, S); - - final jni.JObjType<$T> T; - final jni.JObjType<$S> S; - - GrandParent_Parent.fromReference( - this.T, - this.S, - jni.JReference reference, - ) : super.fromReference(reference); + static final _id_throwClassCastException = _class.instanceMethodId( + r'throwClassCastException', + r'()Ljava/io/FileInputStream;', + ); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/GrandParent$Parent'); + static final _throwClassCastException = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// 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, - ); + /// from: `public java.io.FileInputStream throwClassCastException()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JObject throwClassCastException() { + return _throwClassCastException(reference.pointer, + _id_throwClassCastException as _$jni.JMethodIDPtr) + .object(const _$jni.JObjectType()); } - static final _id_parentValue = _class.instanceFieldId( - r'parentValue', - r'Ljava/lang/Object;', + static final _id_throwArrayIndexException = _class.instanceMethodId( + r'throwArrayIndexException', + r'()I', ); - /// from: `public T parentValue` - /// The returned object must be released after use, by calling the [release] method. - $T get parentValue => _id_parentValue.get(this, T); + static final _throwArrayIndexException = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public T parentValue` - /// The returned object must be released after use, by calling the [release] method. - set parentValue($T value) => _id_parentValue.set(this, T, value); + /// from: `public int throwArrayIndexException()` + int throwArrayIndexException() { + return _throwArrayIndexException(reference.pointer, + _id_throwArrayIndexException as _$jni.JMethodIDPtr) + .integer; + } - static final _id_value = _class.instanceFieldId( - r'value', - r'Ljava/lang/Object;', + static final _id_throwArithmeticException = _class.instanceMethodId( + r'throwArithmeticException', + r'()I', ); - /// from: `public S value` - /// The returned object must be released after use, by calling the [release] method. - $S get value => _id_value.get(this, S); + static final _throwArithmeticException = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public S value` - /// The returned object must be released after use, by calling the [release] method. - set value($S value) => _id_value.set(this, S, value); + /// from: `public int throwArithmeticException()` + int throwArithmeticException() { + return _throwArithmeticException(reference.pointer, + _id_throwArithmeticException as _$jni.JMethodIDPtr) + .integer; + } - static final _id_new$ = _class.constructorId( - r'(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V', + static final _id_throwLoremIpsum = _class.staticMethodId( + r'throwLoremIpsum', + r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_NewObject') + static final _throwLoremIpsum = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticVoidMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue)` - /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_Parent( - GrandParent<$T> $parent, - $S newValue, { - jni.JObjType<$T>? T, - jni.JObjType<$S>? S, - }) { - T ??= jni.lowestCommonSuperType([ - ($parent.$type as $GrandParentType).T, - ]) as jni.JObjType<$T>; - S ??= jni.lowestCommonSuperType([ - newValue.$type, - ]) as jni.JObjType<$S>; - return GrandParent_Parent.fromReference( - T, - S, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr, - $parent.reference.pointer, newValue.reference.pointer) - .reference); + /// from: `static public void throwLoremIpsum()` + static void throwLoremIpsum() { + _throwLoremIpsum( + _class.reference.pointer, _id_throwLoremIpsum as _$jni.JMethodIDPtr) + .check(); } } -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, - ); +final class $Exceptions$Type extends _$jni.JObjType { + @_$jni.internal + const $Exceptions$Type(); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;'; + r'Lcom/github/dart_lang/jnigen/simple_package/Exceptions;'; - @override - GrandParent_Parent<$T, $S> fromReference(jni.JReference reference) => - GrandParent_Parent.fromReference(T, S, reference); + @_$jni.internal + @_$core.override + Exceptions fromReference(_$jni.JReference reference) => + Exceptions.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($GrandParent_ParentType, T, S); + @_$core.override + int get hashCode => ($Exceptions$Type).hashCode; - @override + @_$core.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 == ($Exceptions$Type) && other is $Exceptions$Type; } } -/// 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; +/// from: `com.github.dart_lang.jnigen.simple_package.Fields$Nested` +class Fields_Nested extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - GrandParent_StaticParent_Child.fromReference( - this.S, - this.U, - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + Fields_Nested.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/simple_package/Fields$Nested'); /// 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 = _class.instanceFieldId( - r'parentValue', - r'Ljava/lang/Object;', + static const type = $Fields_Nested$Type(); + static final _id_hundred = _class.instanceFieldId( + r'hundred', + r'J', ); - /// from: `public S parentValue` - /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => _id_parentValue.get(this, S); + /// from: `public long hundred` + int get hundred => _id_hundred.get(this, const _$jni.jlongType()); - /// from: `public S parentValue` - /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => _id_parentValue.set(this, S, value); + /// from: `public long hundred` + set hundred(int value) => + _id_hundred.set(this, const _$jni.jlongType(), value); - static final _id_value = _class.instanceFieldId( - r'value', - r'Ljava/lang/Object;', + static final _id_BEST_GOD = _class.staticFieldId( + r'BEST_GOD', + r'Ljava/lang/String;', ); - /// from: `public U value` + /// from: `static public java.lang.String BEST_GOD` /// The returned object must be released after use, by calling the [release] method. - $U get value => _id_value.get(this, U); + static _$jni.JString get BEST_GOD => + _id_BEST_GOD.get(_class, const _$jni.JStringType()); - /// from: `public U value` + /// from: `static public java.lang.String BEST_GOD` /// The returned object must be released after use, by calling the [release] method. - set value($U value) => _id_value.set(this, U, value); + static set BEST_GOD(_$jni.JString value) => + _id_BEST_GOD.set(_class, const _$jni.JStringType(), value); static final _id_new$ = _class.constructorId( - r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V', + r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $parent, S parentValue, U value)` + /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_StaticParent_Child( - GrandParent_StaticParent<$S> $parent, - $S parentValue, - $U value, { - jni.JObjType<$S>? S, - jni.JObjType<$U>? U, - }) { - S ??= jni.lowestCommonSuperType([ - parentValue.$type, - ($parent.$type as $GrandParent_StaticParentType).S, - ]) as jni.JObjType<$S>; - U ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$U>; - return GrandParent_StaticParent_Child.fromReference( - S, - U, - _new$( - _class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, - $parent.reference.pointer, - parentValue.reference.pointer, - value.reference.pointer) + factory Fields_Nested() { + return Fields_Nested.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $GrandParent_StaticParent_ChildType<$S extends jni.JObject, - $U extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$S> S; - final jni.JObjType<$U> U; +final class $Fields_Nested$Type extends _$jni.JObjType { + @_$jni.internal + const $Fields_Nested$Type(); - const $GrandParent_StaticParent_ChildType( - this.S, - this.U, - ); - - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;'; + r'Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;'; - @override - GrandParent_StaticParent_Child<$S, $U> fromReference( - jni.JReference reference) => - GrandParent_StaticParent_Child.fromReference(S, U, reference); + @_$jni.internal + @_$core.override + Fields_Nested fromReference(_$jni.JReference reference) => + Fields_Nested.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($GrandParent_StaticParent_ChildType, S, U); + @_$core.override + int get hashCode => ($Fields_Nested$Type).hashCode; - @override + @_$core.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 == ($Fields_Nested$Type) && + other is $Fields_Nested$Type; } } -/// 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; +/// from: `com.github.dart_lang.jnigen.simple_package.Fields` +class Fields extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - GrandParent_StaticParent.fromReference( - this.S, - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + Fields.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/simple_package/Fields'); /// 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 = _class.instanceFieldId( - r'value', - r'Ljava/lang/Object;', + static const type = $Fields$Type(); + static final _id_amount = _class.staticFieldId( + r'amount', + r'I', ); - /// from: `public S value` - /// The returned object must be released after use, by calling the [release] method. - $S get value => _id_value.get(this, S); + /// from: `static public int amount` + static int get amount => _id_amount.get(_class, const _$jni.jintType()); - /// from: `public S value` - /// The returned object must be released after use, by calling the [release] method. - set value($S value) => _id_value.set(this, S, value); + /// from: `static public int amount` + static set amount(int value) => + _id_amount.set(_class, const _$jni.jintType(), value); - static final _id_new$ = _class.constructorId( - r'(Ljava/lang/Object;)V', + static final _id_pi = _class.staticFieldId( + r'pi', + r'D', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_NewObject') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + /// from: `static public double pi` + static double get pi => _id_pi.get(_class, const _$jni.jdoubleType()); - /// from: `public void (S value)` + /// from: `static public double pi` + static set pi(double value) => + _id_pi.set(_class, const _$jni.jdoubleType(), value); + + static final _id_asterisk = _class.staticFieldId( + r'asterisk', + r'C', + ); + + /// from: `static public char asterisk` + static int get asterisk => _id_asterisk.get(_class, const _$jni.jcharType()); + + /// from: `static public char asterisk` + static set asterisk(int value) => + _id_asterisk.set(_class, const _$jni.jcharType(), value); + + static final _id_name = _class.staticFieldId( + 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. - factory GrandParent_StaticParent( - $S value, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$S>; - return GrandParent_StaticParent.fromReference( - S, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr, - value.reference.pointer) - .reference); - } -} + static _$jni.JString get name => + _id_name.get(_class, const _$jni.JStringType()); -final class $GrandParent_StaticParentType<$S extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$S> S; + /// 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) => + _id_name.set(_class, const _$jni.JStringType(), value); - const $GrandParent_StaticParentType( - this.S, + static final _id_i = _class.instanceFieldId( + r'i', + r'Ljava/lang/Integer;', ); - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;'; + /// from: `public java.lang.Integer i` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JInteger get i => _id_i.get(this, const _$jni.JIntegerType()); - @override - GrandParent_StaticParent<$S> fromReference(jni.JReference reference) => - GrandParent_StaticParent.fromReference(S, reference); + /// from: `public java.lang.Integer i` + /// The returned object must be released after use, by calling the [release] method. + set i(_$jni.JInteger value) => + _id_i.set(this, const _$jni.JIntegerType(), value); - @override - jni.JObjType get superType => const jni.JObjectType(); + static final _id_trillion = _class.instanceFieldId( + r'trillion', + r'J', + ); - @override - final superCount = 1; + /// from: `public long trillion` + int get trillion => _id_trillion.get(this, const _$jni.jlongType()); - @override - int get hashCode => Object.hash($GrandParent_StaticParentType, S); + /// from: `public long trillion` + set trillion(int value) => + _id_trillion.set(this, const _$jni.jlongType(), value); - @override - bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_StaticParentType<$S>) && - other is $GrandParent_StaticParentType<$S> && - S == other.S; - } -} + static final _id_isAchillesDead = _class.instanceFieldId( + r'isAchillesDead', + r'Z', + ); -/// 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); + /// from: `public boolean isAchillesDead` + bool get isAchillesDead => + _id_isAchillesDead.get(this, const _$jni.jbooleanType()); - final jni.JObjType<$T> T; + /// from: `public boolean isAchillesDead` + set isAchillesDead(bool value) => + _id_isAchillesDead.set(this, const _$jni.jbooleanType(), value); - GrandParent.fromReference( - this.T, - jni.JReference reference, - ) : super.fromReference(reference); + static final _id_bestFighterInGreece = _class.instanceFieldId( + r'bestFighterInGreece', + r'Ljava/lang/String;', + ); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/GrandParent'); + /// from: `public java.lang.String bestFighterInGreece` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString get bestFighterInGreece => + _id_bestFighterInGreece.get(this, const _$jni.JStringType()); - /// 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: `public java.lang.String bestFighterInGreece` + /// The returned object must be released after use, by calling the [release] method. + set bestFighterInGreece(_$jni.JString value) => + _id_bestFighterInGreece.set(this, const _$jni.JStringType(), value); - static final _id_value = _class.instanceFieldId( - r'value', - r'Ljava/lang/Object;', + static final _id_random = _class.instanceFieldId( + r'random', + r'Ljava/util/Random;', ); - /// from: `public T value` + /// from: `public java.util.Random random` /// The returned object must be released after use, by calling the [release] method. - $T get value => _id_value.get(this, T); + _$jni.JObject get random => _id_random.get(this, const _$jni.JObjectType()); - /// from: `public T value` + /// from: `public java.util.Random random` /// The returned object must be released after use, by calling the [release] method. - set value($T value) => _id_value.set(this, T, value); + set random(_$jni.JObject value) => + _id_random.set(this, const _$jni.JObjectType(), value); + + static final _id_euroSymbol = _class.staticFieldId( + r'euroSymbol', + r'C', + ); + + /// from: `static public char euroSymbol` + static int get euroSymbol => + _id_euroSymbol.get(_class, const _$jni.jcharType()); + + /// from: `static public char euroSymbol` + static set euroSymbol(int value) => + _id_euroSymbol.set(_class, const _$jni.jcharType(), value); static final _id_new$ = _class.constructorId( - r'(Ljava/lang/Object;)V', + r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public void (T value)` + /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory GrandParent( - $T value, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$T>; - return GrandParent.fromReference( - T, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr, - value.reference.pointer) + factory Fields() { + return Fields.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } +} - static final _id_stringParent = _class.instanceMethodId( - r'stringParent', - r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;', - ); +final class $Fields$Type extends _$jni.JObjType { + @_$jni.internal + const $Fields$Type(); - static final _stringParent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Fields;'; - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` - /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent stringParent() { - return _stringParent( - reference.pointer, _id_stringParent as jni.JMethodIDPtr) - .object(const $GrandParent_ParentType( - jni.JObjectType(), jni.JStringType())); + @_$jni.internal + @_$core.override + Fields fromReference(_$jni.JReference reference) => + Fields.fromReference(reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Fields$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Fields$Type) && other is $Fields$Type; } +} - static final _id_varParent = _class.instanceMethodId( - r'varParent', - r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;', +/// from: `com.github.dart_lang.jnigen.pkg2.C2` +class C2 extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + C2.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/C2'); + + /// The type which includes information such as the signature of this class. + static const type = $C2$Type(); + static final _id_CONSTANT = _class.staticFieldId( + r'CONSTANT', + r'I', ); - static final _varParent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + /// from: `static public int CONSTANT` + static int get CONSTANT => _id_CONSTANT.get(_class, const _$jni.jintType()); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S nestedValue)` - /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent varParent<$S extends jni.JObject>( - $S nestedValue, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - nestedValue.$type, - ]) as jni.JObjType<$S>; - return _varParent(reference.pointer, _id_varParent as jni.JMethodIDPtr, - nestedValue.reference.pointer) - .object($GrandParent_ParentType(const jni.JObjectType(), S)); - } + /// from: `static public int CONSTANT` + static set CONSTANT(int value) => + _id_CONSTANT.set(_class, const _$jni.jintType(), value); - static final _id_stringStaticParent = _class.staticMethodId( - r'stringStaticParent', - r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', + static final _id_new$ = _class.constructorId( + r'()V', ); - static final _stringStaticParent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent stringStaticParent()` + /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent stringStaticParent() { - return _stringStaticParent(_class.reference.pointer, - _id_stringStaticParent as jni.JMethodIDPtr) - .object(const $GrandParent_StaticParentType(jni.JStringType())); + factory C2() { + return C2.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); } +} - static final _id_varStaticParent = _class.staticMethodId( - r'varStaticParent', - r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', +final class $C2$Type extends _$jni.JObjType { + @_$jni.internal + const $C2$Type(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/C2;'; + + @_$jni.internal + @_$core.override + C2 fromReference(_$jni.JReference reference) => C2.fromReference(reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($C2$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($C2$Type) && other is $C2$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.pkg2.Example` +class Example$1 extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + Example$1.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/Example'); + + /// The type which includes information such as the signature of this class. + static const type = $Example$1$Type(); + static final _id_new$ = _class.constructorId( + r'()V', ); - static final _varStaticParent = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent varStaticParent(S value)` + /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent<$S> varStaticParent<$S extends jni.JObject>( - $S value, { - jni.JObjType<$S>? S, - }) { - S ??= jni.lowestCommonSuperType([ - value.$type, - ]) as jni.JObjType<$S>; - return _varStaticParent(_class.reference.pointer, - _id_varStaticParent as jni.JMethodIDPtr, value.reference.pointer) - .object($GrandParent_StaticParentType(S)); + factory Example$1() { + return Example$1.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); } - static final _id_staticParentWithSameType = _class.instanceMethodId( - r'staticParentWithSameType', - r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', + static final _id_whichExample = _class.instanceMethodId( + r'whichExample', + r'()I', ); - static final _staticParentWithSameType = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + static final _whichExample = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent staticParentWithSameType()` - /// The returned object must be released after use, by calling the [release] method. - GrandParent_StaticParent<$T> staticParentWithSameType() { - return _staticParentWithSameType( - reference.pointer, _id_staticParentWithSameType as jni.JMethodIDPtr) - .object($GrandParent_StaticParentType(T)); + /// from: `public int whichExample()` + int whichExample() { + return _whichExample( + reference.pointer, _id_whichExample as _$jni.JMethodIDPtr) + .integer; } } -final class $GrandParentType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; +final class $Example$1$Type extends _$jni.JObjType { + @_$jni.internal + const $Example$1$Type(); - const $GrandParentType( - this.T, - ); - - @override - String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent;'; + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/Example;'; - @override - GrandParent<$T> fromReference(jni.JReference reference) => - GrandParent.fromReference(T, reference); + @_$jni.internal + @_$core.override + Example$1 fromReference(_$jni.JReference reference) => + Example$1.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($GrandParentType, T); + @_$core.override + int get hashCode => ($Example$1$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($GrandParentType<$T>) && - other is $GrandParentType<$T> && - T == other.T; + return other.runtimeType == ($Example$1$Type) && other is $Example$1$Type; } } -/// 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); +/// from: `com.github.dart_lang.jnigen.generics.GenericTypeParams` +class GenericTypeParams<$S extends _$jni.JObject, $K extends _$jni.JObject> + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; + @_$jni.internal + final _$jni.JObjType<$S> S; - MyMap_MyEntry.fromReference( + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + GenericTypeParams.fromReference( + this.S, this.K, - this.V, - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type(S, K), + super.fromReference(reference); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyMap$MyEntry'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/GenericTypeParams'); /// 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 $GenericTypeParams$Type<$S, $K> + type<$S extends _$jni.JObject, $K extends _$jni.JObject>( + _$jni.JObjType<$S> S, + _$jni.JObjType<$K> K, ) { - return $MyMap_MyEntryType( + return $GenericTypeParams$Type( + S, K, - V, ); } - static final _id_key = _class.instanceFieldId( - r'key', - r'Ljava/lang/Object;', - ); - - /// from: `public K key` - /// The returned object must be released after use, by calling the [release] method. - $K get key => _id_key.get(this, K); - - /// from: `public K key` - /// The returned object must be released after use, by calling the [release] method. - set key($K value) => _id_key.set(this, K, value); - - static final _id_value = _class.instanceFieldId( - r'value', - r'Ljava/lang/Object;', - ); - - /// from: `public V value` - /// The returned object must be released after use, by calling the [release] method. - $V get value => _id_value.get(this, V); - - /// from: `public V value` - /// The returned object must be released after use, by calling the [release] method. - set value($V value) => _id_value.set(this, V, value); - static final _id_new$ = _class.constructorId( - r'(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V', + r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $parent, K key, V value)` + /// from: `public void ()` /// 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, + factory GenericTypeParams({ + required _$jni.JObjType<$S> S, + required _$jni.JObjType<$K> K, }) { - K ??= jni.lowestCommonSuperType([ - key.$type, - ($parent.$type as $MyMapType).K, - ]) as jni.JObjType<$K>; - V ??= jni.lowestCommonSuperType([ - value.$type, - ($parent.$type as $MyMapType).V, - ]) as jni.JObjType<$V>; - return MyMap_MyEntry.fromReference( + return GenericTypeParams.fromReference( + S, K, - V, - _new$( - _class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, - $parent.reference.pointer, - key.reference.pointer, - value.reference.pointer) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $MyMap_MyEntryType<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; +final class $GenericTypeParams$Type<$S extends _$jni.JObject, + $K extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + final _$jni.JObjType<$K> K; - const $MyMap_MyEntryType( + @_$jni.internal + const $GenericTypeParams$Type( + this.S, this.K, - this.V, ); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;'; + r'Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;'; - @override - MyMap_MyEntry<$K, $V> fromReference(jni.JReference reference) => - MyMap_MyEntry.fromReference(K, V, reference); + @_$jni.internal + @_$core.override + GenericTypeParams<$S, $K> fromReference(_$jni.JReference reference) => + GenericTypeParams.fromReference(S, K, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($MyMap_MyEntryType, K, V); + @_$core.override + int get hashCode => Object.hash($GenericTypeParams$Type, S, K); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyMap_MyEntryType<$K, $V>) && - other is $MyMap_MyEntryType<$K, $V> && - K == other.K && - V == other.V; + return other.runtimeType == ($GenericTypeParams$Type<$S, $K>) && + other is $GenericTypeParams$Type<$S, $K> && + S == other.S && + K == other.K; } } -/// 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); +/// 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 { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; + @_$jni.internal + final _$jni.JObjType<$T> T; - MyMap.fromReference( - this.K, - this.V, - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + final _$jni.JObjType<$S> S; - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyMap'); + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + GrandParent_Parent_Child.fromReference( + this.T, + this.S, + this.U, + _$jni.JReference reference, + ) : $type = type(T, S, U), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child'); /// 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, + static $GrandParent_Parent_Child$Type<$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 $MyMapType( - K, - V, + return $GrandParent_Parent_Child$Type( + T, + S, + U, ); } - static final _id_new$ = _class.constructorId( - r'()V', + static final _id_grandParentValue = _class.instanceFieldId( + r'grandParentValue', + r'Ljava/lang/Object;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + /// from: `public T grandParentValue` + /// The returned object must be released after use, by calling the [release] method. + $T get grandParentValue => _id_grandParentValue.get(this, T); - /// from: `public void ()` + /// from: `public T grandParentValue` /// The returned object must be released after use, by calling the [release] method. - factory MyMap({ - required jni.JObjType<$K> K, - required jni.JObjType<$V> V, - }) { - return MyMap.fromReference( - K, - V, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); - } + set grandParentValue($T value) => _id_grandParentValue.set(this, T, value); - static final _id_get$ = _class.instanceMethodId( - r'get', - r'(Ljava/lang/Object;)Ljava/lang/Object;', + static final _id_parentValue = _class.instanceFieldId( + r'parentValue', + r'Ljava/lang/Object;', ); - static final _get$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + /// from: `public S parentValue` + /// The returned object must be released after use, by calling the [release] method. + $S get parentValue => _id_parentValue.get(this, S); - /// from: `public V get(K key)` + /// from: `public S parentValue` /// The returned object must be released after use, by calling the [release] method. - $V get$( - $K key, - ) { - return _get$(reference.pointer, _id_get$ as jni.JMethodIDPtr, - key.reference.pointer) - .object(V); - } + set parentValue($S value) => _id_parentValue.set(this, S, value); - static final _id_put = _class.instanceMethodId( - r'put', - r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', + static final _id_value = _class.instanceFieldId( + r'value', + r'Ljava/lang/Object;', ); - static final _put = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + /// from: `public U value` + /// The returned object must be released after use, by calling the [release] method. + $U get value => _id_value.get(this, U); - /// from: `public V put(K key, V value)` + /// from: `public U value` /// The returned object must be released after use, by calling the [release] method. - $V put( - $K key, - $V value, - ) { - return _put(reference.pointer, _id_put as jni.JMethodIDPtr, - key.reference.pointer, value.reference.pointer) - .object(V); - } + set value($U value) => _id_value.set(this, U, value); - static final _id_entryStack = _class.instanceMethodId( - r'entryStack', - r'()Lcom/github/dart_lang/jnigen/generics/MyStack;', + static final _id_new$ = _class.constructorId( + r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V', ); - static final _entryStack = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// from: `public com.github.dart_lang.jnigen.generics.MyStack.MyEntry> entryStack()` + /// 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. - MyStack> entryStack() { - return _entryStack(reference.pointer, _id_entryStack as jni.JMethodIDPtr) - .object(const $MyStackType( - $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType()))); + 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_Parent$Type).T, + ]) as _$jni.JObjType<$T>; + S ??= _$jni.lowestCommonSuperType([ + ($parent.$type as $GrandParent_Parent$Type).S, + ]) as _$jni.JObjType<$S>; + U ??= _$jni.lowestCommonSuperType([ + newValue.$type, + ]) as _$jni.JObjType<$U>; + return GrandParent_Parent_Child.fromReference( + T, + S, + U, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + $parent.reference.pointer, newValue.reference.pointer) + .reference); } } -final class $MyMapType<$K extends jni.JObject, $V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; - final jni.JObjType<$V> V; +final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject, + $S extends _$jni.JObject, $U extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - const $MyMapType( - this.K, - this.V, + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + const $GrandParent_Parent_Child$Type( + this.T, + this.S, + this.U, ); - @override - String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap;'; + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;'; - @override - MyMap<$K, $V> fromReference(jni.JReference reference) => - MyMap.fromReference(K, V, reference); + @_$jni.internal + @_$core.override + GrandParent_Parent_Child<$T, $S, $U> fromReference( + _$jni.JReference reference) => + GrandParent_Parent_Child.fromReference(T, S, U, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($MyMapType, K, V); + @_$core.override + int get hashCode => Object.hash($GrandParent_Parent_Child$Type, T, S, U); - @override + @_$core.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 == ($GrandParent_Parent_Child$Type<$T, $S, $U>) && + other is $GrandParent_Parent_Child$Type<$T, $S, $U> && + T == other.T && + S == other.S && + U == other.U; } } -/// 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); +/// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent` +class GrandParent_Parent<$T extends _$jni.JObject, $S extends _$jni.JObject> + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$T> T; + @_$jni.internal + final _$jni.JObjType<$T> T; - MyStack.fromReference( + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + GrandParent_Parent.fromReference( this.T, - jni.JReference reference, - ) : super.fromReference(reference); + this.S, + _$jni.JReference reference, + ) : $type = type(T, S), + super.fromReference(reference); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyStack'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/GrandParent$Parent'); /// 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 $GrandParent_Parent$Type<$T, $S> + type<$T extends _$jni.JObject, $S extends _$jni.JObject>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$S> S, ) { - return $MyStackType( + return $GrandParent_Parent$Type( T, + S, ); } - static final _id_new$ = _class.constructorId( - r'()V', + static final _id_parentValue = _class.instanceFieldId( + r'parentValue', + r'Ljava/lang/Object;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + /// from: `public T parentValue` + /// The returned object must be released after use, by calling the [release] method. + $T get parentValue => _id_parentValue.get(this, T); - /// from: `public void ()` + /// from: `public T parentValue` /// The returned object must be released after use, by calling the [release] method. - factory MyStack({ - required jni.JObjType<$T> T, - }) { - return MyStack.fromReference( - T, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); - } + set parentValue($T value) => _id_parentValue.set(this, T, value); - static final _id_fromArray = _class.staticMethodId( - r'fromArray', - r'([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', + static final _id_value = _class.instanceFieldId( + r'value', + r'Ljava/lang/Object;', ); - static final _fromArray = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + /// from: `public S value` + /// The returned object must be released after use, by calling the [release] method. + $S get value => _id_value.get(this, S); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(T[] arr)` + /// from: `public S value` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> fromArray<$T extends jni.JObject>( - jni.JArray<$T> arr, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - ((arr.$type as jni.JArrayType).elementType as jni.JObjType), - ]) as jni.JObjType<$T>; - return _fromArray(_class.reference.pointer, - _id_fromArray as jni.JMethodIDPtr, arr.reference.pointer) - .object($MyStackType(T)); - } + set value($S value) => _id_value.set(this, S, value); - static final _id_fromArrayOfArrayOfGrandParents = _class.staticMethodId( - r'fromArrayOfArrayOfGrandParents', - r'([[Lcom/github/dart_lang/jnigen/generics/GrandParent;)Lcom/github/dart_lang/jnigen/generics/MyStack;', + static final _id_new$ = _class.constructorId( + r'(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V', ); - static final _fromArrayOfArrayOfGrandParents = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(com.github.dart_lang.jnigen.generics.GrandParent[][] arr)` + /// 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 MyStack<$S> fromArrayOfArrayOfGrandParents<$S extends jni.JObject>( - jni.JArray>> arr, { - jni.JObjType<$S>? S, + factory GrandParent_Parent( + GrandParent<$T> $parent, + $S newValue, { + _$jni.JObjType<$T>? T, + _$jni.JObjType<$S>? S, }) { - S ??= jni.lowestCommonSuperType([ - (((((arr.$type as jni.JArrayType).elementType as jni.JObjType) - as jni.JArrayType) - .elementType as jni.JObjType) as $GrandParentType) - .T, - ]) as jni.JObjType<$S>; - return _fromArrayOfArrayOfGrandParents( - _class.reference.pointer, - _id_fromArrayOfArrayOfGrandParents as jni.JMethodIDPtr, - arr.reference.pointer) - .object($MyStackType(S)); + T ??= _$jni.lowestCommonSuperType([ + ($parent.$type as $GrandParent$Type).T, + ]) as _$jni.JObjType<$T>; + S ??= _$jni.lowestCommonSuperType([ + newValue.$type, + ]) as _$jni.JObjType<$S>; + return GrandParent_Parent.fromReference( + T, + S, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + $parent.reference.pointer, newValue.reference.pointer) + .reference); } +} - static final _id_of = _class.staticMethodId( - r'of', - r'()Lcom/github/dart_lang/jnigen/generics/MyStack;', - ); +final class $GrandParent_Parent$Type<$T extends _$jni.JObject, + $S extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - static final _of = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + final _$jni.JObjType<$S> S; - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` - /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of<$T extends jni.JObject>({ - required jni.JObjType<$T> T, - }) { - return _of(_class.reference.pointer, _id_of as jni.JMethodIDPtr) - .object($MyStackType(T)); - } - - static final _id_of$1 = _class.staticMethodId( - r'of', - r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', - ); - - static final _of$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); - - /// from: `static public 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> of$1<$T extends jni.JObject>( - $T obj, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - obj.$type, - ]) as jni.JObjType<$T>; - return _of$1(_class.reference.pointer, _id_of$1 as jni.JMethodIDPtr, - obj.reference.pointer) - .object($MyStackType(T)); - } - - static final _id_of$2 = _class.staticMethodId( - r'of', - r'(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', - ); - - static final _of$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); - - /// from: `static 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> of$2<$T extends jni.JObject>( - $T obj, - $T obj2, { - jni.JObjType<$T>? T, - }) { - T ??= jni.lowestCommonSuperType([ - obj2.$type, - obj.$type, - ]) as jni.JObjType<$T>; - return _of$2(_class.reference.pointer, _id_of$2 as jni.JMethodIDPtr, - obj.reference.pointer, obj2.reference.pointer) - .object($MyStackType(T)); - } - - static final _id_push = _class.instanceMethodId( - r'push', - r'(Ljava/lang/Object;)V', - ); - - static final _push = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallVoidMethod') - .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); - - /// from: `public void push(T item)` - void push( - $T item, - ) { - _push(reference.pointer, _id_push as jni.JMethodIDPtr, - item.reference.pointer) - .check(); - } - - static final _id_pop = _class.instanceMethodId( - r'pop', - r'()Ljava/lang/Object;', - ); - - static final _pop = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `public T pop()` - /// The returned object must be released after use, by calling the [release] method. - $T pop() { - return _pop(reference.pointer, _id_pop as jni.JMethodIDPtr).object(T); - } - - static final _id_size = _class.instanceMethodId( - r'size', - r'()I', - ); - - static final _size = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `public int size()` - int size() { - return _size(reference.pointer, _id_size as jni.JMethodIDPtr).integer; - } -} - -final class $MyStackType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; - - const $MyStackType( + @_$jni.internal + const $GrandParent_Parent$Type( this.T, + this.S, ); - @override - String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyStack;'; + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;'; - @override - MyStack<$T> fromReference(jni.JReference reference) => - MyStack.fromReference(T, reference); + @_$jni.internal + @_$core.override + GrandParent_Parent<$T, $S> fromReference(_$jni.JReference reference) => + GrandParent_Parent.fromReference(T, S, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($MyStackType, T); + @_$core.override + int get hashCode => Object.hash($GrandParent_Parent$Type, T, S); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyStackType<$T>) && - other is $MyStackType<$T> && - T == other.T; + return other.runtimeType == ($GrandParent_Parent$Type<$T, $S>) && + other is $GrandParent_Parent$Type<$T, $S> && + T == other.T && + S == other.S; } } -/// from: `com.github.dart_lang.jnigen.generics.StringKeyedMap` -class StringKeyedMap<$V extends jni.JObject> extends MyMap { - @override - late final jni.JObjType> $type = type(V); +/// 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 { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$V> V; + @_$jni.internal + final _$jni.JObjType<$S> S; - StringKeyedMap.fromReference( - this.V, - jni.JReference reference, - ) : super.fromReference(const jni.JStringType(), V, reference); + @_$jni.internal + final _$jni.JObjType<$U> U; - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/StringKeyedMap'); + @_$jni.internal + GrandParent_StaticParent_Child.fromReference( + this.S, + this.U, + _$jni.JReference reference, + ) : $type = type(S, U), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child'); /// The type which includes information such as the signature of this class. - static $StringKeyedMapType<$V> type<$V extends jni.JObject>( - jni.JObjType<$V> V, + static $GrandParent_StaticParent_Child$Type<$S, $U> + type<$S extends _$jni.JObject, $U extends _$jni.JObject>( + _$jni.JObjType<$S> S, + _$jni.JObjType<$U> U, ) { - return $StringKeyedMapType( - V, + return $GrandParent_StaticParent_Child$Type( + S, + U, ); } - static final _id_new$ = _class.constructorId( - r'()V', + static final _id_parentValue = _class.instanceFieldId( + r'parentValue', + r'Ljava/lang/Object;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `public void ()` + /// from: `public S parentValue` /// The returned object must be released after use, by calling the [release] method. - factory StringKeyedMap({ - required jni.JObjType<$V> V, - }) { - return StringKeyedMap.fromReference( - V, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); - } -} + $S get parentValue => _id_parentValue.get(this, S); -final class $StringKeyedMapType<$V extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$V> V; + /// from: `public S parentValue` + /// The returned object must be released after use, by calling the [release] method. + set parentValue($S value) => _id_parentValue.set(this, S, value); - const $StringKeyedMapType( - this.V, + static final _id_value = _class.instanceFieldId( + r'value', + r'Ljava/lang/Object;', ); - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;'; - - @override - StringKeyedMap<$V> fromReference(jni.JReference reference) => - StringKeyedMap.fromReference(V, reference); - - @override - jni.JObjType get superType => $MyMapType(const jni.JStringType(), V); - - @override - final superCount = 2; - - @override - int get hashCode => Object.hash($StringKeyedMapType, V); - - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringKeyedMapType<$V>) && - other is $StringKeyedMapType<$V> && - V == other.V; - } -} - -/// from: `com.github.dart_lang.jnigen.generics.StringStack` -class StringStack extends MyStack { - @override - late final jni.JObjType $type = type; - - StringStack.fromReference( - jni.JReference reference, - ) : super.fromReference(const jni.JStringType(), reference); + /// from: `public U value` + /// The returned object must be released after use, by calling the [release] method. + $U get value => _id_value.get(this, U); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringStack'); + /// from: `public U value` + /// The returned object must be released after use, by calling the [release] method. + set value($U value) => _id_value.set(this, U, value); - /// The type which includes information such as the signature of this class. - static const type = $StringStackType(); static final _id_new$ = _class.constructorId( - r'()V', + r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// 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 StringStack() { - return StringStack.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + 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_StaticParent$Type).S, + ]) as _$jni.JObjType<$S>; + U ??= _$jni.lowestCommonSuperType([ + value.$type, + ]) as _$jni.JObjType<$U>; + return GrandParent_StaticParent_Child.fromReference( + S, + U, + _new$( + _class.reference.pointer, + _id_new$ as _$jni.JMethodIDPtr, + $parent.reference.pointer, + parentValue.reference.pointer, + value.reference.pointer) .reference); } } -final class $StringStackType extends jni.JObjType { - const $StringStackType(); +final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject, + $U extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$S> S; - @override - String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringStack;'; + @_$jni.internal + final _$jni.JObjType<$U> U; - @override - StringStack fromReference(jni.JReference reference) => - StringStack.fromReference(reference); + @_$jni.internal + const $GrandParent_StaticParent_Child$Type( + this.S, + this.U, + ); - @override - jni.JObjType get superType => const $MyStackType(jni.JStringType()); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;'; - @override - final superCount = 2; + @_$jni.internal + @_$core.override + GrandParent_StaticParent_Child<$S, $U> fromReference( + _$jni.JReference reference) => + GrandParent_StaticParent_Child.fromReference(S, U, reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + final superCount = 1; - @override - int get hashCode => ($StringStackType).hashCode; + @_$core.override + int get hashCode => Object.hash($GrandParent_StaticParent_Child$Type, S, U); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($StringStackType) && other is $StringStackType; + return other.runtimeType == + ($GrandParent_StaticParent_Child$Type<$S, $U>) && + other is $GrandParent_StaticParent_Child$Type<$S, $U> && + S == other.S && + U == other.U; } } -/// 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); +/// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent` +class GrandParent_StaticParent<$S extends _$jni.JObject> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$K> K; + @_$jni.internal + final _$jni.JObjType<$S> S; - StringValuedMap.fromReference( - this.K, - jni.JReference reference, - ) : super.fromReference(K, const jni.JStringType(), reference); + @_$jni.internal + GrandParent_StaticParent.fromReference( + this.S, + _$jni.JReference reference, + ) : $type = type(S), + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/StringValuedMap'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent'); /// The type which includes information such as the signature of this class. - static $StringValuedMapType<$K> type<$K extends jni.JObject>( - jni.JObjType<$K> K, + static $GrandParent_StaticParent$Type<$S> type<$S extends _$jni.JObject>( + _$jni.JObjType<$S> S, ) { - return $StringValuedMapType( - K, + return $GrandParent_StaticParent$Type( + S, ); } + static final _id_value = _class.instanceFieldId( + 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 => _id_value.get(this, S); + + /// from: `public S value` + /// The returned object must be released after use, by calling the [release] method. + set value($S value) => _id_value.set(this, S, value); + static final _id_new$ = _class.constructorId( - r'()V', + r'(Ljava/lang/Object;)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void ()` + /// from: `public void (S value)` /// The returned object must be released after use, by calling the [release] method. - factory StringValuedMap({ - required jni.JObjType<$K> K, + factory GrandParent_StaticParent( + $S value, { + _$jni.JObjType<$S>? S, }) { - return StringValuedMap.fromReference( - K, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + S ??= _$jni.lowestCommonSuperType([ + value.$type, + ]) as _$jni.JObjType<$S>; + return GrandParent_StaticParent.fromReference( + S, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + value.reference.pointer) .reference); } } -final class $StringValuedMapType<$K extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$K> K; +final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$S> S; - const $StringValuedMapType( - this.K, + @_$jni.internal + const $GrandParent_StaticParent$Type( + this.S, ); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/generics/StringValuedMap;'; + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;'; - @override - StringValuedMap<$K> fromReference(jni.JReference reference) => - StringValuedMap.fromReference(K, reference); + @_$jni.internal + @_$core.override + GrandParent_StaticParent<$S> fromReference(_$jni.JReference reference) => + GrandParent_StaticParent.fromReference(S, reference); - @override - jni.JObjType get superType => $MyMapType(K, const jni.JStringType()); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override - final superCount = 2; + @_$jni.internal + @_$core.override + final superCount = 1; - @override - int get hashCode => Object.hash($StringValuedMapType, K); + @_$core.override + int get hashCode => Object.hash($GrandParent_StaticParent$Type, S); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($StringValuedMapType<$K>) && - other is $StringValuedMapType<$K> && - K == other.K; + return other.runtimeType == ($GrandParent_StaticParent$Type<$S>) && + other is $GrandParent_StaticParent$Type<$S> && + S == other.S; } } -/// 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); +/// from: `com.github.dart_lang.jnigen.generics.GrandParent` +class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - final jni.JObjType<$T> T; + @_$jni.internal + final _$jni.JObjType<$T> T; - MyInterface.fromReference( + @_$jni.internal + GrandParent.fromReference( this.T, - jni.JReference reference, - ) : super.fromReference(reference); + _$jni.JReference reference, + ) : $type = type(T), + super.fromReference(reference); static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/interfaces/MyInterface'); + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/GrandParent'); /// The type which includes information such as the signature of this class. - static $MyInterfaceType<$T> type<$T extends jni.JObject>( - jni.JObjType<$T> T, + static $GrandParent$Type<$T> type<$T extends _$jni.JObject>( + _$jni.JObjType<$T> T, ) { - return $MyInterfaceType( + return $GrandParent$Type( T, ); } - static final _id_voidCallback = _class.instanceMethodId( - r'voidCallback', - r'(Ljava/lang/String;)V', - ); - - static final _voidCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallVoidMethod') - .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + static final _id_value = _class.instanceFieldId( + r'value', + r'Ljava/lang/Object;', + ); - /// from: `public abstract void voidCallback(java.lang.String s)` - void voidCallback( - jni.JString s, - ) { - _voidCallback(reference.pointer, _id_voidCallback as jni.JMethodIDPtr, - s.reference.pointer) - .check(); - } + /// from: `public T value` + /// The returned object must be released after use, by calling the [release] method. + $T get value => _id_value.get(this, T); - static final _id_stringCallback = _class.instanceMethodId( - r'stringCallback', - r'(Ljava/lang/String;)Ljava/lang/String;', + /// from: `public T value` + /// The returned object must be released after use, by calling the [release] method. + set value($T value) => _id_value.set(this, T, value); + + static final _id_new$ = _class.constructorId( + r'(Ljava/lang/Object;)V', ); - static final _stringCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallObjectMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract java.lang.String stringCallback(java.lang.String s)` + /// from: `public void (T value)` /// The returned object must be released after use, by calling the [release] method. - jni.JString stringCallback( - jni.JString s, - ) { - return _stringCallback(reference.pointer, - _id_stringCallback as jni.JMethodIDPtr, s.reference.pointer) - .object(const jni.JStringType()); + factory GrandParent( + $T value, { + _$jni.JObjType<$T>? T, + }) { + T ??= _$jni.lowestCommonSuperType([ + value.$type, + ]) as _$jni.JObjType<$T>; + return GrandParent.fromReference( + T, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + value.reference.pointer) + .reference); } - static final _id_varCallback = _class.instanceMethodId( - r'varCallback', - r'(Ljava/lang/Object;)Ljava/lang/Object;', + static final _id_stringParent = _class.instanceMethodId( + r'stringParent', + r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;', ); - static final _varCallback = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallObjectMethod') + static final _stringParent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public abstract T varCallback(T t)` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` /// The returned object must be released after use, by calling the [release] method. - $T varCallback( - $T t, - ) { - return _varCallback(reference.pointer, _id_varCallback as jni.JMethodIDPtr, - t.reference.pointer) - .object(T); + GrandParent_Parent<_$jni.JObject, _$jni.JString> stringParent() { + return _stringParent( + reference.pointer, _id_stringParent as _$jni.JMethodIDPtr) + .object(const $GrandParent_Parent$Type( + _$jni.JObjectType(), _$jni.JStringType())); } - static final _id_manyPrimitives = _class.instanceMethodId( - r'manyPrimitives', - r'(IZCD)J', + static final _id_varParent = _class.instanceMethodId( + r'varParent', + r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;', ); - static final _manyPrimitives = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32, $Int32, ffi.Double)>)>>( - 'globalEnv_CallLongMethod') + static final _varParent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - int, int, double)>(); - - /// from: `public abstract long manyPrimitives(int a, boolean b, char c, double d)` - int manyPrimitives( - int a, - bool b, - int c, - double d, - ) { - return _manyPrimitives(reference.pointer, - _id_manyPrimitives as jni.JMethodIDPtr, a, b ? 1 : 0, c, d) - .long; - } - - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); + /// 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<_$jni.JObject, $S> varParent<$S extends _$jni.JObject>( + $S nestedValue, { + _$jni.JObjType<$S>? S, + }) { + S ??= _$jni.lowestCommonSuperType([ + nestedValue.$type, + ]) as _$jni.JObjType<$S>; + return _varParent(reference.pointer, _id_varParent as _$jni.JMethodIDPtr, + nestedValue.reference.pointer) + .object($GrandParent_Parent$Type(const _$jni.JObjectType(), S)); } - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + static final _id_stringStaticParent = _class.staticMethodId( + r'stringStaticParent', + r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', + ); - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, - ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == r'voidCallback(Ljava/lang/String;)V') { - _$impls[$p]!.voidCallback( - $a[0].castTo(const jni.JStringType(), releaseOriginal: true), - ); - return jni.nullptr; - } - if ($d == r'stringCallback(Ljava/lang/String;)Ljava/lang/String;') { - final $r = _$impls[$p]!.stringCallback( - $a[0].castTo(const jni.JStringType(), releaseOriginal: true), - ); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); - } - if ($d == r'varCallback(Ljava/lang/Object;)Ljava/lang/Object;') { - final $r = _$impls[$p]!.varCallback( - $a[0].castTo(_$impls[$p]!.T, releaseOriginal: true), - ); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); - } - if ($d == r'manyPrimitives(IZCD)J') { - final $r = _$impls[$p]!.manyPrimitives( - $a[0] - .castTo(const jni.JIntegerType(), releaseOriginal: true) - .intValue(releaseOriginal: true), - $a[1] - .castTo(const jni.JBooleanType(), releaseOriginal: true) - .booleanValue(releaseOriginal: true), - $a[2] - .castTo(const jni.JCharacterType(), releaseOriginal: true) - .charValue(releaseOriginal: true), - $a[3] - .castTo(const jni.JDoubleType(), releaseOriginal: true) - .doubleValue(releaseOriginal: true), - ); - return jni.JLong($r).reference.toPointer(); - } - } catch (e) { - return ProtectedJniExtensions.newDartException(e); - } - return jni.nullptr; - } + static final _stringStaticParent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - factory MyInterface.implement( - $MyInterfaceImpl<$T> $impl, - ) { - final $p = ReceivePort(); - final $x = MyInterface.fromReference( - $impl.T, - ProtectedJniExtensions.newPortProxy( - r'com.github.dart_lang.jnigen.interfaces.MyInterface', - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; + /// 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<_$jni.JString> stringStaticParent() { + return _stringStaticParent(_class.reference.pointer, + _id_stringStaticParent as _$jni.JMethodIDPtr) + .object(const $GrandParent_StaticParent$Type(_$jni.JStringType())); } - static Map get $impls => _$impls; -} - -abstract interface class $MyInterfaceImpl<$T extends jni.JObject> { - factory $MyInterfaceImpl({ - required jni.JObjType<$T> T, - required void Function(jni.JString s) voidCallback, - required jni.JString Function(jni.JString s) stringCallback, - required $T Function($T t) varCallback, - required int Function(int a, bool b, int c, double d) manyPrimitives, - }) = _$MyInterfaceImpl; - - jni.JObjType<$T> get T; - - void voidCallback(jni.JString s); - jni.JString stringCallback(jni.JString s); - $T varCallback($T t); - int manyPrimitives(int a, bool b, int c, double d); -} - -class _$MyInterfaceImpl<$T extends jni.JObject> - implements $MyInterfaceImpl<$T> { - _$MyInterfaceImpl({ - required this.T, - required void Function(jni.JString s) voidCallback, - required jni.JString Function(jni.JString s) stringCallback, - required $T Function($T t) varCallback, - required int Function(int a, bool b, int c, double d) manyPrimitives, - }) : _voidCallback = voidCallback, - _stringCallback = stringCallback, - _varCallback = varCallback, - _manyPrimitives = manyPrimitives; - @override - final jni.JObjType<$T> T; + static final _id_varStaticParent = _class.staticMethodId( + r'varStaticParent', + r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', + ); - 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; + static final _varStaticParent = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - void voidCallback(jni.JString s) { - return _voidCallback(s); + /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent varStaticParent(S value)` + /// The returned object must be released after use, by calling the [release] method. + static GrandParent_StaticParent<$S> varStaticParent<$S extends _$jni.JObject>( + $S value, { + _$jni.JObjType<$S>? S, + }) { + S ??= _$jni.lowestCommonSuperType([ + value.$type, + ]) as _$jni.JObjType<$S>; + return _varStaticParent(_class.reference.pointer, + _id_varStaticParent as _$jni.JMethodIDPtr, value.reference.pointer) + .object($GrandParent_StaticParent$Type(S)); } - jni.JString stringCallback(jni.JString s) { - return _stringCallback(s); - } + static final _id_staticParentWithSameType = _class.instanceMethodId( + r'staticParentWithSameType', + r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', + ); - $T varCallback($T t) { - return _varCallback(t); - } + static final _staticParentWithSameType = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - int manyPrimitives(int a, bool b, int c, double d) { - return _manyPrimitives(a, b, c, d); + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent staticParentWithSameType()` + /// The returned object must be released after use, by calling the [release] method. + GrandParent_StaticParent<$T> staticParentWithSameType() { + return _staticParentWithSameType(reference.pointer, + _id_staticParentWithSameType as _$jni.JMethodIDPtr) + .object($GrandParent_StaticParent$Type(T)); } } -final class $MyInterfaceType<$T extends jni.JObject> - extends jni.JObjType> { - final jni.JObjType<$T> T; +final class $GrandParent$Type<$T extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - const $MyInterfaceType( + @_$jni.internal + const $GrandParent$Type( this.T, ); - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/MyInterface;'; + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent;'; - @override - MyInterface<$T> fromReference(jni.JReference reference) => - MyInterface.fromReference(T, reference); + @_$jni.internal + @_$core.override + GrandParent<$T> fromReference(_$jni.JReference reference) => + GrandParent.fromReference(T, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($MyInterfaceType, T); + @_$core.override + int get hashCode => Object.hash($GrandParent$Type, T); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceType<$T>) && - other is $MyInterfaceType<$T> && + return other.runtimeType == ($GrandParent$Type<$T>) && + other is $GrandParent$Type<$T> && T == other.T; } } -/// from: `com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer` -class MyInterfaceConsumer extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.generics.MyMap$MyEntry` +class MyMap_MyEntry<$K extends _$jni.JObject, $V extends _$jni.JObject> + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - MyInterfaceConsumer.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + final _$jni.JObjType<$K> K; - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer'); + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + MyMap_MyEntry.fromReference( + this.K, + this.V, + _$jni.JReference reference, + ) : $type = type(K, V), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/MyMap$MyEntry'); /// The type which includes information such as the signature of this class. - static const type = $MyInterfaceConsumerType(); - static final _id_new$ = _class.constructorId( - r'()V', + static $MyMap_MyEntry$Type<$K, $V> + type<$K extends _$jni.JObject, $V extends _$jni.JObject>( + _$jni.JObjType<$K> K, + _$jni.JObjType<$V> V, + ) { + return $MyMap_MyEntry$Type( + K, + V, + ); + } + + static final _id_key = _class.instanceFieldId( + r'key', + r'Ljava/lang/Object;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + /// from: `public K key` + /// The returned object must be released after use, by calling the [release] method. + $K get key => _id_key.get(this, K); - /// from: `public void ()` + /// from: `public K key` /// The returned object must be released after use, by calling the [release] method. - factory MyInterfaceConsumer() { - return MyInterfaceConsumer.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); - } + set key($K value) => _id_key.set(this, K, value); - static final _id_consumeOnAnotherThread = _class.staticMethodId( - r'consumeOnAnotherThread', - r'(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V', + static final _id_value = _class.instanceFieldId( + r'value', + r'Ljava/lang/Object;', + ); + + /// from: `public V value` + /// The returned object must be released after use, by calling the [release] method. + $V get value => _id_value.get(this, V); + + /// from: `public V value` + /// The returned object must be released after use, by calling the [release] method. + set value($V value) => _id_value.set(this, V, value); + + static final _id_new$ = _class.constructorId( + r'(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _consumeOnAnotherThread = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - $Int32, - $Int32, - $Int32, - ffi.Double, - ffi.Pointer - )>)>>('globalEnv_CallStaticVoidMethod') + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - double, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// 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, + /// 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, }) { - T ??= jni.lowestCommonSuperType([ - t.$type, - (myInterface.$type as $MyInterfaceType).T, - ]) as jni.JObjType<$T>; - _consumeOnAnotherThread( - _class.reference.pointer, - _id_consumeOnAnotherThread as jni.JMethodIDPtr, - myInterface.reference.pointer, - s.reference.pointer, - a, - b ? 1 : 0, - c, - d, - t.reference.pointer) - .check(); + K ??= _$jni.lowestCommonSuperType([ + key.$type, + ($parent.$type as $MyMap$Type).K, + ]) as _$jni.JObjType<$K>; + V ??= _$jni.lowestCommonSuperType([ + value.$type, + ($parent.$type as $MyMap$Type).V, + ]) as _$jni.JObjType<$V>; + return MyMap_MyEntry.fromReference( + K, + V, + _new$( + _class.reference.pointer, + _id_new$ as _$jni.JMethodIDPtr, + $parent.reference.pointer, + key.reference.pointer, + value.reference.pointer) + .reference); + } +} + +final class $MyMap_MyEntry$Type<$K extends _$jni.JObject, + $V extends _$jni.JObject> extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $MyMap_MyEntry$Type( + this.K, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;'; + + @_$jni.internal + @_$core.override + MyMap_MyEntry<$K, $V> fromReference(_$jni.JReference reference) => + MyMap_MyEntry.fromReference(K, V, reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($MyMap_MyEntry$Type, K, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyMap_MyEntry$Type<$K, $V>) && + other is $MyMap_MyEntry$Type<$K, $V> && + K == other.K && + V == other.V; } +} - static final _id_consumeOnSameThread = _class.staticMethodId( - r'consumeOnSameThread', - r'(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V', +/// from: `com.github.dart_lang.jnigen.generics.MyMap` +class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + MyMap.fromReference( + this.K, + this.V, + _$jni.JReference reference, + ) : $type = type(K, V), + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyMap'); + + /// The type which includes information such as the signature of this class. + static $MyMap$Type<$K, $V> + type<$K extends _$jni.JObject, $V extends _$jni.JObject>( + _$jni.JObjType<$K> K, + _$jni.JObjType<$V> V, + ) { + return $MyMap$Type( + K, + V, + ); + } + + static final _id_new$ = _class.constructorId( + r'()V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory MyMap({ + required _$jni.JObjType<$K> K, + required _$jni.JObjType<$V> V, + }) { + return MyMap.fromReference( + K, + V, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); + } + + static final _id_get = _class.instanceMethodId( + r'get', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _get = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V get(K key)` + /// The returned object must be released after use, by calling the [release] method. + $V get( + $K key, + ) { + return _get(reference.pointer, _id_get as _$jni.JMethodIDPtr, + key.reference.pointer) + .object(V); + } + + static final _id_put = _class.instanceMethodId( + r'put', + r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _consumeOnSameThread = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _put = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer, - $Int32, - $Int32, - $Int32, - ffi.Double, - ffi.Pointer - )>)>>('globalEnv_CallStaticVoidMethod') + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallObjectMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - double, - ffi.Pointer)>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// 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, + /// from: `public V put(K key, V value)` + /// The returned object must be released after use, by calling the [release] method. + $V put( + $K key, + $V value, + ) { + return _put(reference.pointer, _id_put as _$jni.JMethodIDPtr, + key.reference.pointer, value.reference.pointer) + .object(V); + } + + static final _id_entryStack = _class.instanceMethodId( + r'entryStack', + r'()Lcom/github/dart_lang/jnigen/generics/MyStack;', + ); + + static final _entryStack = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public com.github.dart_lang.jnigen.generics.MyStack.MyEntry> entryStack()` + /// The returned object must be released after use, by calling the [release] method. + MyStack> entryStack() { + return _entryStack(reference.pointer, _id_entryStack as _$jni.JMethodIDPtr) + .object(const $MyStack$Type( + $MyMap_MyEntry$Type(_$jni.JObjectType(), _$jni.JObjectType()))); + } +} + +final class $MyMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $MyMap$Type( + this.K, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap;'; + + @_$jni.internal + @_$core.override + MyMap<$K, $V> fromReference(_$jni.JReference reference) => + MyMap.fromReference(K, V, reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($MyMap$Type, K, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyMap$Type<$K, $V>) && + other is $MyMap$Type<$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 { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + MyStack.fromReference( + this.T, + _$jni.JReference reference, + ) : $type = type(T), + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyStack'); + + /// The type which includes information such as the signature of this class. + static $MyStack$Type<$T> type<$T extends _$jni.JObject>( + _$jni.JObjType<$T> T, + ) { + return $MyStack$Type( + T, + ); + } + + static final _id_new$ = _class.constructorId( + r'()V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory MyStack({ + required _$jni.JObjType<$T> T, }) { - T ??= jni.lowestCommonSuperType([ - t.$type, - (myInterface.$type as $MyInterfaceType).T, - ]) as jni.JObjType<$T>; - _consumeOnSameThread( + return MyStack.fromReference( + T, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); + } + + static final _id_fromArray = _class.staticMethodId( + r'fromArray', + r'([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', + ); + + static final _fromArray = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(T[] arr)` + /// The returned object must be released after use, by calling the [release] method. + static MyStack<$T> fromArray<$T extends _$jni.JObject>( + _$jni.JArray<$T> arr, { + _$jni.JObjType<$T>? T, + }) { + T ??= _$jni.lowestCommonSuperType([ + ((arr.$type as _$jni.JArrayType).elementType as _$jni.JObjType), + ]) as _$jni.JObjType<$T>; + return _fromArray(_class.reference.pointer, + _id_fromArray as _$jni.JMethodIDPtr, arr.reference.pointer) + .object($MyStack$Type(T)); + } + + static final _id_fromArrayOfArrayOfGrandParents = _class.staticMethodId( + r'fromArrayOfArrayOfGrandParents', + r'([[Lcom/github/dart_lang/jnigen/generics/GrandParent;)Lcom/github/dart_lang/jnigen/generics/MyStack;', + ); + + static final _fromArrayOfArrayOfGrandParents = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// 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<_$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 $GrandParent$Type) + .T, + ]) as _$jni.JObjType<$S>; + return _fromArrayOfArrayOfGrandParents( _class.reference.pointer, - _id_consumeOnSameThread as jni.JMethodIDPtr, - myInterface.reference.pointer, - s.reference.pointer, - a, - b ? 1 : 0, - c, - d, - t.reference.pointer) + _id_fromArrayOfArrayOfGrandParents as _$jni.JMethodIDPtr, + arr.reference.pointer) + .object($MyStack$Type(S)); + } + + static final _id_of = _class.staticMethodId( + r'of', + r'()Lcom/github/dart_lang/jnigen/generics/MyStack;', + ); + + static final _of = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` + /// The returned object must be released after use, by calling the [release] method. + static MyStack<$T> of<$T extends _$jni.JObject>({ + required _$jni.JObjType<$T> T, + }) { + return _of(_class.reference.pointer, _id_of as _$jni.JMethodIDPtr) + .object($MyStack$Type(T)); + } + + static final _id_of$1 = _class.staticMethodId( + r'of', + r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', + ); + + static final _of$1 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// 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> of$1<$T extends _$jni.JObject>( + $T obj, { + _$jni.JObjType<$T>? T, + }) { + T ??= _$jni.lowestCommonSuperType([ + obj.$type, + ]) as _$jni.JObjType<$T>; + return _of$1(_class.reference.pointer, _id_of$1 as _$jni.JMethodIDPtr, + obj.reference.pointer) + .object($MyStack$Type(T)); + } + + static final _id_of$2 = _class.staticMethodId( + r'of', + r'(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', + ); + + static final _of$2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); + + /// 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> of$2<$T extends _$jni.JObject>( + $T obj, + $T obj2, { + _$jni.JObjType<$T>? T, + }) { + T ??= _$jni.lowestCommonSuperType([ + obj2.$type, + obj.$type, + ]) as _$jni.JObjType<$T>; + return _of$2(_class.reference.pointer, _id_of$2 as _$jni.JMethodIDPtr, + obj.reference.pointer, obj2.reference.pointer) + .object($MyStack$Type(T)); + } + + static final _id_push = _class.instanceMethodId( + r'push', + r'(Ljava/lang/Object;)V', + ); + + static final _push = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public void push(T item)` + void push( + $T item, + ) { + _push(reference.pointer, _id_push as _$jni.JMethodIDPtr, + item.reference.pointer) .check(); } + + static final _id_pop = _class.instanceMethodId( + r'pop', + r'()Ljava/lang/Object;', + ); + + static final _pop = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public T pop()` + /// The returned object must be released after use, by calling the [release] method. + $T pop() { + return _pop(reference.pointer, _id_pop as _$jni.JMethodIDPtr).object(T); + } + + static final _id_size = _class.instanceMethodId( + r'size', + r'()I', + ); + + static final _size = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public int size()` + int size() { + return _size(reference.pointer, _id_size as _$jni.JMethodIDPtr).integer; + } } -final class $MyInterfaceConsumerType extends jni.JObjType { - const $MyInterfaceConsumerType(); +final class $MyStack$Type<$T extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;'; + @_$jni.internal + const $MyStack$Type( + this.T, + ); - @override - MyInterfaceConsumer fromReference(jni.JReference reference) => - MyInterfaceConsumer.fromReference(reference); + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyStack;'; + + @_$jni.internal + @_$core.override + MyStack<$T> fromReference(_$jni.JReference reference) => + MyStack.fromReference(T, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($MyInterfaceConsumerType).hashCode; + @_$core.override + int get hashCode => Object.hash($MyStack$Type, T); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyInterfaceConsumerType) && - other is $MyInterfaceConsumerType; + return other.runtimeType == ($MyStack$Type<$T>) && + other is $MyStack$Type<$T> && + T == other.T; } } -/// from: `com.github.dart_lang.jnigen.interfaces.MyRunnable` -class MyRunnable extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.generics.StringKeyedMap` +class StringKeyedMap<$V extends _$jni.JObject> + extends MyMap<_$jni.JString, $V> { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - MyRunnable.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + final _$jni.JObjType<$V> V; - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/interfaces/MyRunnable'); + @_$jni.internal + StringKeyedMap.fromReference( + this.V, + _$jni.JReference reference, + ) : $type = type(V), + super.fromReference(const _$jni.JStringType(), V, reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/StringKeyedMap'); /// The type which includes information such as the signature of this class. - static const type = $MyRunnableType(); - static final _id_run = _class.instanceMethodId( - r'run', + static $StringKeyedMap$Type<$V> type<$V extends _$jni.JObject>( + _$jni.JObjType<$V> V, + ) { + return $StringKeyedMap$Type( + V, + ); + } + + static final _id_new$ = _class.constructorId( r'()V', ); - static final _run = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallVoidMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public abstract void run()` - void run() { - _run(reference.pointer, _id_run as jni.JMethodIDPtr).check(); + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory StringKeyedMap({ + required _$jni.JObjType<$V> V, + }) { + return StringKeyedMap.fromReference( + V, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); } +} - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; +final class $StringKeyedMap$Type<$V extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$V> V; - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } + @_$jni.internal + const $StringKeyedMap$Type( + this.V, + ); - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;'; - 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); - } - return jni.nullptr; - } + @_$jni.internal + @_$core.override + StringKeyedMap<$V> fromReference(_$jni.JReference reference) => + StringKeyedMap.fromReference(V, reference); - factory MyRunnable.implement( - $MyRunnableImpl $impl, - ) { - final $p = ReceivePort(); - final $x = MyRunnable.fromReference( - ProtectedJniExtensions.newPortProxy( - r'com.github.dart_lang.jnigen.interfaces.MyRunnable', - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $MyMap$Type(const _$jni.JStringType(), V); + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => Object.hash($StringKeyedMap$Type, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringKeyedMap$Type<$V>) && + other is $StringKeyedMap$Type<$V> && + V == other.V; } } -abstract interface class $MyRunnableImpl { - factory $MyRunnableImpl({ - required void Function() run, - }) = _$MyRunnableImpl; +/// from: `com.github.dart_lang.jnigen.generics.StringMap` +class StringMap extends StringKeyedMap<_$jni.JString> { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - void run(); -} + @_$jni.internal + StringMap.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(const _$jni.JStringType(), reference); -class _$MyRunnableImpl implements $MyRunnableImpl { - _$MyRunnableImpl({ - required void Function() run, - }) : _run = run; + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringMap'); - final void Function() _run; + /// The type which includes information such as the signature of this class. + static const type = $StringMap$Type(); + static final _id_new$ = _class.constructorId( + r'()V', + ); - void run() { - return _run(); + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory StringMap() { + return StringMap.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); } } -final class $MyRunnableType extends jni.JObjType { - const $MyRunnableType(); +final class $StringMap$Type extends _$jni.JObjType { + @_$jni.internal + const $StringMap$Type(); - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;'; + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringMap;'; - @override - MyRunnable fromReference(jni.JReference reference) => - MyRunnable.fromReference(reference); + @_$jni.internal + @_$core.override + StringMap fromReference(_$jni.JReference reference) => + StringMap.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $StringKeyedMap$Type(_$jni.JStringType()); - @override - final superCount = 1; + @_$jni.internal + @_$core.override + final superCount = 3; - @override - int get hashCode => ($MyRunnableType).hashCode; + @_$core.override + int get hashCode => ($StringMap$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableType) && other is $MyRunnableType; + return other.runtimeType == ($StringMap$Type) && other is $StringMap$Type; } } -/// from: `com.github.dart_lang.jnigen.interfaces.MyRunnableRunner` -class MyRunnableRunner extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.generics.StringStack` +class StringStack extends MyStack<_$jni.JString> { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - MyRunnableRunner.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + StringStack.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(const _$jni.JStringType(), reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/interfaces/MyRunnableRunner'); + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringStack'); /// The type which includes information such as the signature of this class. - static const type = $MyRunnableRunnerType(); - static final _id_error = _class.instanceFieldId( - r'error', - r'Ljava/lang/Throwable;', + static const type = $StringStack$Type(); + static final _id_new$ = _class.constructorId( + r'()V', ); - /// from: `public java.lang.Throwable error` - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get error => _id_error.get(this, const jni.JObjectType()); + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public java.lang.Throwable error` + /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - set error(jni.JObject value) => - _id_error.set(this, const jni.JObjectType(), value); + factory StringStack() { + return StringStack.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); + } +} - static final _id_new$ = _class.constructorId( - r'(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V', - ); +final class $StringStack$Type extends _$jni.JObjType { + @_$jni.internal + const $StringStack$Type(); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_NewObject') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringStack;'; - /// from: `public void (com.github.dart_lang.jnigen.interfaces.MyRunnable runnable)` - /// The returned object must be released after use, by calling the [release] method. - factory MyRunnableRunner( - MyRunnable runnable, - ) { - return MyRunnableRunner.fromReference(_new$(_class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, runnable.reference.pointer) - .reference); + @_$jni.internal + @_$core.override + StringStack fromReference(_$jni.JReference reference) => + StringStack.fromReference(reference); + + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const $MyStack$Type(_$jni.JStringType()); + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => ($StringStack$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringStack$Type) && + other is $StringStack$Type; } +} - static final _id_runOnSameThread = _class.instanceMethodId( - r'runOnSameThread', - r'()V', - ); +/// from: `com.github.dart_lang.jnigen.generics.StringValuedMap` +class StringValuedMap<$K extends _$jni.JObject> + extends MyMap<$K, _$jni.JString> { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - static final _runOnSameThread = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallVoidMethod') - .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + final _$jni.JObjType<$K> K; - /// from: `public void runOnSameThread()` - void runOnSameThread() { - _runOnSameThread(reference.pointer, _id_runOnSameThread as jni.JMethodIDPtr) - .check(); + @_$jni.internal + StringValuedMap.fromReference( + this.K, + _$jni.JReference reference, + ) : $type = type(K), + super.fromReference(K, const _$jni.JStringType(), reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/generics/StringValuedMap'); + + /// The type which includes information such as the signature of this class. + static $StringValuedMap$Type<$K> type<$K extends _$jni.JObject>( + _$jni.JObjType<$K> K, + ) { + return $StringValuedMap$Type( + K, + ); } - static final _id_runOnAnotherThread = _class.instanceMethodId( - r'runOnAnotherThread', + static final _id_new$ = _class.constructorId( r'()V', ); - static final _runOnAnotherThread = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallVoidMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public void runOnAnotherThread()` - void runOnAnotherThread() { - _runOnAnotherThread( - reference.pointer, _id_runOnAnotherThread as jni.JMethodIDPtr) - .check(); + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory StringValuedMap({ + required _$jni.JObjType<$K> K, + }) { + return StringValuedMap.fromReference( + K, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); } } -final class $MyRunnableRunnerType extends jni.JObjType { - const $MyRunnableRunnerType(); +final class $StringValuedMap$Type<$K extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$K> K; - @override + @_$jni.internal + const $StringValuedMap$Type( + this.K, + ); + + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;'; + r'Lcom/github/dart_lang/jnigen/generics/StringValuedMap;'; - @override - MyRunnableRunner fromReference(jni.JReference reference) => - MyRunnableRunner.fromReference(reference); + @_$jni.internal + @_$core.override + StringValuedMap<$K> fromReference(_$jni.JReference reference) => + StringValuedMap.fromReference(K, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $MyMap$Type(K, const _$jni.JStringType()); - @override - final superCount = 1; + @_$jni.internal + @_$core.override + final superCount = 2; - @override - int get hashCode => ($MyRunnableRunnerType).hashCode; + @_$core.override + int get hashCode => Object.hash($StringValuedMap$Type, K); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyRunnableRunnerType) && - other is $MyRunnableRunnerType; + return other.runtimeType == ($StringValuedMap$Type<$K>) && + other is $StringValuedMap$Type<$K> && + K == other.K; } } -/// from: `com.github.dart_lang.jnigen.interfaces.StringConversionException` -class StringConversionException extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.interfaces.MyInterface` +class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - StringConversionException.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + final _$jni.JObjType<$T> T; - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/interfaces/StringConversionException'); + @_$jni.internal + MyInterface.fromReference( + this.T, + _$jni.JReference reference, + ) : $type = type(T), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/MyInterface'); /// The type which includes information such as the signature of this class. - static const type = $StringConversionExceptionType(); - static final _id_new$ = _class.constructorId( + static $MyInterface$Type<$T> type<$T extends _$jni.JObject>( + _$jni.JObjType<$T> T, + ) { + return $MyInterface$Type( + T, + ); + } + + static final _id_voidCallback = _class.instanceMethodId( + r'voidCallback', r'(Ljava/lang/String;)V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_NewObject') + static final _voidCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallVoidMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (java.lang.String message)` - /// The returned object must be released after use, by calling the [release] method. - factory StringConversionException( - jni.JString message, + /// from: `public abstract void voidCallback(java.lang.String s)` + void voidCallback( + _$jni.JString s, ) { - return StringConversionException.fromReference(_new$( - _class.reference.pointer, - _id_new$ as jni.JMethodIDPtr, - message.reference.pointer) - .reference); + _voidCallback(reference.pointer, _id_voidCallback as _$jni.JMethodIDPtr, + s.reference.pointer) + .check(); } -} - -final class $StringConversionExceptionType - extends jni.JObjType { - const $StringConversionExceptionType(); - - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/StringConversionException;'; - - @override - StringConversionException fromReference(jni.JReference reference) => - StringConversionException.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - @override - final superCount = 1; + static final _id_stringCallback = _class.instanceMethodId( + r'stringCallback', + r'(Ljava/lang/String;)Ljava/lang/String;', + ); - @override - int get hashCode => ($StringConversionExceptionType).hashCode; + static final _stringCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringConversionExceptionType) && - other is $StringConversionExceptionType; + /// from: `public abstract java.lang.String stringCallback(java.lang.String s)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString stringCallback( + _$jni.JString s, + ) { + return _stringCallback(reference.pointer, + _id_stringCallback as _$jni.JMethodIDPtr, s.reference.pointer) + .object(const _$jni.JStringType()); } -} -/// from: `com.github.dart_lang.jnigen.interfaces.StringConverter` -class StringConverter extends jni.JObject { - @override - late final jni.JObjType $type = type; + static final _id_varCallback = _class.instanceMethodId( + r'varCallback', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); - StringConverter.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + static final _varCallback = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/interfaces/StringConverter'); + /// from: `public abstract T varCallback(T t)` + /// The returned object must be released after use, by calling the [release] method. + $T varCallback( + $T t, + ) { + return _varCallback(reference.pointer, + _id_varCallback as _$jni.JMethodIDPtr, t.reference.pointer) + .object(T); + } - /// The type which includes information such as the signature of this class. - static const type = $StringConverterType(); - static final _id_parseToInt = _class.instanceMethodId( - r'parseToInt', - r'(Ljava/lang/String;)I', + static final _id_manyPrimitives = _class.instanceMethodId( + r'manyPrimitives', + r'(IZCD)J', ); - static final _parseToInt = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallIntMethod') + static final _manyPrimitives = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Double + )>)>>('globalEnv_CallLongMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, int, int, int, double)>(); - /// from: `public abstract int parseToInt(java.lang.String s)` - int parseToInt( - jni.JString s, + /// from: `public abstract long manyPrimitives(int a, boolean b, char c, double d)` + int manyPrimitives( + int a, + bool b, + int c, + double d, ) { - return _parseToInt(reference.pointer, _id_parseToInt as jni.JMethodIDPtr, - s.reference.pointer) - .integer; + return _manyPrimitives(reference.pointer, + _id_manyPrimitives as _$jni.JMethodIDPtr, a, b ? 1 : 0, c, d) + .long; } /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, ) { return _$invokeMethod( port, - $MethodInvocation.fromAddresses( + _$jni.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -4250,381 +4786,440 @@ class StringConverter extends jni.JObject { ); } - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + static final _$jni.Pointer< + _$jni.NativeFunction< + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); - static ffi.Pointer _$invokeMethod( + static _$jni.Pointer<_$jni.Void> _$invokeMethod( int $p, - $MethodInvocation $i, + _$jni.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r'parseToInt(Ljava/lang/String;)I') { - final $r = _$impls[$p]!.parseToInt( - $a[0].castTo(const jni.JStringType(), releaseOriginal: true), + if ($d == r'voidCallback(Ljava/lang/String;)V') { + _$impls[$p]!.voidCallback( + $a[0].as(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].as(const _$jni.JStringType(), releaseOriginal: true), + ); + return ($r as _$jni.JObject) + .as(const _$jni.JObjectType()) + .reference + .toPointer(); + } + if ($d == r'varCallback(Ljava/lang/Object;)Ljava/lang/Object;') { + final $r = _$impls[$p]!.varCallback( + $a[0].as(_$impls[$p]!.T, releaseOriginal: true), + ); + return ($r as _$jni.JObject) + .as(const _$jni.JObjectType()) + .reference + .toPointer(); + } + if ($d == r'manyPrimitives(IZCD)J') { + final $r = _$impls[$p]!.manyPrimitives( + $a[0] + .as(const _$jni.JIntegerType(), releaseOriginal: true) + .intValue(releaseOriginal: true), + $a[1] + .as(const _$jni.JBooleanType(), releaseOriginal: true) + .booleanValue(releaseOriginal: true), + $a[2] + .as(const _$jni.JCharacterType(), releaseOriginal: true) + .charValue(releaseOriginal: true), + $a[3] + .as(const _$jni.JDoubleType(), releaseOriginal: true) + .doubleValue(releaseOriginal: true), ); - return jni.JInteger($r).reference.toPointer(); + return _$jni.JLong($r).reference.toPointer(); } } catch (e) { - return ProtectedJniExtensions.newDartException(e); + return _$jni.ProtectedJniExtensions.newDartException(e); } - return jni.nullptr; + return _$jni.nullptr; } - factory StringConverter.implement( - $StringConverterImpl $impl, + static void implementIn<$T extends _$jni.JObject>( + _$jni.JImplementer implementer, + $MyInterface<$T> $impl, ) { - final $p = ReceivePort(); - final $x = StringConverter.fromReference( - ProtectedJniExtensions.newPortProxy( - r'com.github.dart_lang.jnigen.interfaces.StringConverter', - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = $MethodInvocation.fromMessage($m as List); + final $i = _$jni.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); }); - return $x; + implementer.add( + r'com.github.dart_lang.jnigen.interfaces.MyInterface', + $p, + _$invokePointer, + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } + + factory MyInterface.implement( + $MyInterface<$T> $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return MyInterface.fromReference( + $impl.T, + $i.implementReference(), + ); } + static _$core.Map get $impls => _$impls; } -abstract interface class $StringConverterImpl { - factory $StringConverterImpl({ - required int Function(jni.JString s) parseToInt, - }) = _$StringConverterImpl; +abstract interface class $MyInterface<$T extends _$jni.JObject> { + factory $MyInterface({ + 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, + }) = _$MyInterface; + + _$jni.JObjType<$T> get T; - int parseToInt(jni.JString s); + 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 _$StringConverterImpl implements $StringConverterImpl { - _$StringConverterImpl({ - required int Function(jni.JString s) parseToInt, - }) : _parseToInt = parseToInt; +class _$MyInterface<$T extends _$jni.JObject> implements $MyInterface<$T> { + _$MyInterface({ + 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 int Function(jni.JString s) _parseToInt; + @_$core.override + final _$jni.JObjType<$T> T; - int parseToInt(jni.JString s) { - return _parseToInt(s); + final void Function(_$jni.JString s) _voidCallback; + final _$jni.JString Function(_$jni.JString s) _stringCallback; + final $T Function($T t) _varCallback; + final int Function(int a, bool b, int c, double d) _manyPrimitives; + + void voidCallback(_$jni.JString s) { + return _voidCallback(s); + } + + _$jni.JString stringCallback(_$jni.JString s) { + return _stringCallback(s); + } + + $T varCallback($T t) { + return _varCallback(t); + } + + int manyPrimitives(int a, bool b, int c, double d) { + return _manyPrimitives(a, b, c, d); } } -final class $StringConverterType extends jni.JObjType { - const $StringConverterType(); +final class $MyInterface$Type<$T extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - @override + @_$jni.internal + const $MyInterface$Type( + this.T, + ); + + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/StringConverter;'; + r'Lcom/github/dart_lang/jnigen/interfaces/MyInterface;'; - @override - StringConverter fromReference(jni.JReference reference) => - StringConverter.fromReference(reference); + @_$jni.internal + @_$core.override + MyInterface<$T> fromReference(_$jni.JReference reference) => + MyInterface.fromReference(T, reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($StringConverterType).hashCode; + @_$core.override + int get hashCode => Object.hash($MyInterface$Type, T); - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($StringConverterType) && - other is $StringConverterType; + return other.runtimeType == ($MyInterface$Type<$T>) && + other is $MyInterface$Type<$T> && + T == other.T; } } -/// from: `com.github.dart_lang.jnigen.interfaces.StringConverterConsumer` -class StringConverterConsumer extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer` +class MyInterfaceConsumer extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - StringConverterConsumer.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + MyInterfaceConsumer.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/interfaces/StringConverterConsumer'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer'); /// The type which includes information such as the signature of this class. - static const type = $StringConverterConsumerType(); + static const type = $MyInterfaceConsumer$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory StringConverterConsumer() { - return StringConverterConsumer.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + factory MyInterfaceConsumer() { + return MyInterfaceConsumer.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } - static final _id_consumeOnSameThread = _class.staticMethodId( - r'consumeOnSameThread', - r'(Lcom/github/dart_lang/jnigen/interfaces/StringConverter;Ljava/lang/String;)Ljava/lang/Integer;', - ); - - static final _consumeOnSameThread = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); - - /// from: `static public java.lang.Integer consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String s)` - /// The returned object must be released after use, by calling the [release] method. - static jni.JInteger consumeOnSameThread( - StringConverter stringConverter, - jni.JString s, - ) { - return _consumeOnSameThread( - _class.reference.pointer, - _id_consumeOnSameThread as jni.JMethodIDPtr, - stringConverter.reference.pointer, - s.reference.pointer) - .object(const jni.JIntegerType()); - } - static final _id_consumeOnAnotherThread = _class.staticMethodId( r'consumeOnAnotherThread', - r'(Lcom/github/dart_lang/jnigen/interfaces/StringConverter;Ljava/lang/String;)Ljava/util/concurrent/Future;', + r'(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V', ); - static final _consumeOnAnotherThread = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< + static final _consumeOnAnotherThread = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< ( - ffi.Pointer, - ffi.Pointer - )>)>>('globalEnv_CallStaticObjectMethod') + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Double, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + int, + int, + int, + double, + _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String s)` - /// The returned object must be released after use, by calling the [release] method. - static jni.JObject consumeOnAnotherThread( - StringConverter stringConverter, - jni.JString s, - ) { - return _consumeOnAnotherThread( + /// 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 $MyInterface$Type).T, + ]) as _$jni.JObjType<$T>; + _consumeOnAnotherThread( _class.reference.pointer, - _id_consumeOnAnotherThread as jni.JMethodIDPtr, - stringConverter.reference.pointer, - s.reference.pointer) - .object(const jni.JObjectType()); - } -} - -final class $StringConverterConsumerType - extends jni.JObjType { - const $StringConverterConsumerType(); - - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/interfaces/StringConverterConsumer;'; - - @override - StringConverterConsumer fromReference(jni.JReference reference) => - StringConverterConsumer.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($StringConverterConsumerType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($StringConverterConsumerType) && - other is $StringConverterConsumerType; - } -} - -/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable$Case` -class JsonSerializable_Case extends jni.JObject { - @override - late final jni.JObjType $type = type; - - JsonSerializable_Case.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/annotations/JsonSerializable$Case'); - - /// The type which includes information such as the signature of this class. - static const type = $JsonSerializable_CaseType(); - static final _id_values = _class.staticMethodId( - r'values', - r'()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', - ); - - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case[] values()` - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($JsonSerializable_CaseType())); + _id_consumeOnAnotherThread as _$jni.JMethodIDPtr, + myInterface.reference.pointer, + s.reference.pointer, + a, + b ? 1 : 0, + c, + d, + t.reference.pointer) + .check(); } - static final _id_valueOf = _class.staticMethodId( - r'valueOf', - r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + static final _id_consumeOnSameThread = _class.staticMethodId( + r'consumeOnSameThread', + r'(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') + static final _consumeOnSameThread = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Int32, + _$jni.Int32, + _$jni.Int32, + _$jni.Double, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + int, + int, + int, + double, + _$jni.Pointer<_$jni.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. - static JsonSerializable_Case valueOf( - jni.JString name, - ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, - name.reference.pointer) - .object(const $JsonSerializable_CaseType()); + /// 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 $MyInterface$Type).T, + ]) as _$jni.JObjType<$T>; + _consumeOnSameThread( + _class.reference.pointer, + _id_consumeOnSameThread as _$jni.JMethodIDPtr, + myInterface.reference.pointer, + s.reference.pointer, + a, + b ? 1 : 0, + c, + d, + t.reference.pointer) + .check(); } } -final class $JsonSerializable_CaseType - extends jni.JObjType { - const $JsonSerializable_CaseType(); +final class $MyInterfaceConsumer$Type + extends _$jni.JObjType { + @_$jni.internal + const $MyInterfaceConsumer$Type(); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; + r'Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;'; - @override - JsonSerializable_Case fromReference(jni.JReference reference) => - JsonSerializable_Case.fromReference(reference); + @_$jni.internal + @_$core.override + MyInterfaceConsumer fromReference(_$jni.JReference reference) => + MyInterfaceConsumer.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonSerializable_CaseType).hashCode; + @_$core.override + int get hashCode => ($MyInterfaceConsumer$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_CaseType) && - other is $JsonSerializable_CaseType; + return other.runtimeType == ($MyInterfaceConsumer$Type) && + other is $MyInterfaceConsumer$Type; } } -/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable` -class JsonSerializable extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.interfaces.MyRunnable` +class MyRunnable extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - JsonSerializable.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + MyRunnable.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/annotations/JsonSerializable'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/MyRunnable'); /// The type which includes information such as the signature of this class. - static const type = $JsonSerializableType(); - static final _id_value = _class.instanceMethodId( - r'value', - r'()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + static const type = $MyRunnable$Type(); + static final _id_run = _class.instanceMethodId( + r'run', + r'()V', ); - static final _value = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + static final _run = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public abstract com.github.dart_lang.jnigen.annotations.JsonSerializable$Case value()` - /// The returned object must be released after use, by calling the [release] method. - JsonSerializable_Case value() { - return _value(reference.pointer, _id_value as jni.JMethodIDPtr) - .object(const $JsonSerializable_CaseType()); + /// from: `public abstract void run()` + void run() { + _run(reference.pointer, _id_run as _$jni.JMethodIDPtr).check(); } /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, ) { return _$invokeMethod( port, - $MethodInvocation.fromAddresses( + _$jni.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -4632,1172 +5227,1257 @@ class JsonSerializable extends jni.JObject { ); } - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + static final _$jni.Pointer< + _$jni.NativeFunction< + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); - static ffi.Pointer _$invokeMethod( + static _$jni.Pointer<_$jni.Void> _$invokeMethod( int $p, - $MethodInvocation $i, + _$jni.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == - r'value()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;') { - final $r = _$impls[$p]!.value(); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); + if ($d == r'run()V') { + _$impls[$p]!.run(); + return _$jni.nullptr; } } catch (e) { - return ProtectedJniExtensions.newDartException(e); + return _$jni.ProtectedJniExtensions.newDartException(e); } - return jni.nullptr; + return _$jni.nullptr; } - factory JsonSerializable.implement( - $JsonSerializableImpl $impl, + static void implementIn( + _$jni.JImplementer implementer, + $MyRunnable $impl, ) { - final $p = ReceivePort(); - final $x = JsonSerializable.fromReference( - ProtectedJniExtensions.newPortProxy( - r'com.github.dart_lang.jnigen.annotations.JsonSerializable', - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = $MethodInvocation.fromMessage($m as List); + final $i = _$jni.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); }); - return $x; + implementer.add( + r'com.github.dart_lang.jnigen.interfaces.MyRunnable', + $p, + _$invokePointer, + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } + + factory MyRunnable.implement( + $MyRunnable $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return MyRunnable.fromReference( + $i.implementReference(), + ); } + static _$core.Map get $impls => _$impls; } -abstract interface class $JsonSerializableImpl { - factory $JsonSerializableImpl({ - required JsonSerializable_Case Function() value, - }) = _$JsonSerializableImpl; +abstract interface class $MyRunnable { + factory $MyRunnable({ + required void Function() run, + }) = _$MyRunnable; - JsonSerializable_Case value(); + void run(); } -class _$JsonSerializableImpl implements $JsonSerializableImpl { - _$JsonSerializableImpl({ - required JsonSerializable_Case Function() value, - }) : _value = value; +class _$MyRunnable implements $MyRunnable { + _$MyRunnable({ + required void Function() run, + }) : _run = run; - final JsonSerializable_Case Function() _value; + final void Function() _run; - JsonSerializable_Case value() { - return _value(); + void run() { + return _run(); } } -final class $JsonSerializableType extends jni.JObjType { - const $JsonSerializableType(); +final class $MyRunnable$Type extends _$jni.JObjType { + @_$jni.internal + const $MyRunnable$Type(); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; + r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;'; - @override - JsonSerializable fromReference(jni.JReference reference) => - JsonSerializable.fromReference(reference); + @_$jni.internal + @_$core.override + MyRunnable fromReference(_$jni.JReference reference) => + MyRunnable.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($JsonSerializableType).hashCode; + @_$core.override + int get hashCode => ($MyRunnable$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializableType) && - other is $JsonSerializableType; + return other.runtimeType == ($MyRunnable$Type) && other is $MyRunnable$Type; } } -/// from: `com.github.dart_lang.jnigen.annotations.MyDataClass` -class MyDataClass extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.interfaces.MyRunnableRunner` +class MyRunnableRunner extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - MyDataClass.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + MyRunnableRunner.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/annotations/MyDataClass'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/MyRunnableRunner'); /// The type which includes information such as the signature of this class. - static const type = $MyDataClassType(); - static final _id_new$ = _class.constructorId( - r'()V', + static const type = $MyRunnableRunner$Type(); + static final _id_error = _class.instanceFieldId( + r'error', + r'Ljava/lang/Throwable;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `public void ()` + /// from: `public java.lang.Throwable error` /// The returned object must be released after use, by calling the [release] method. - factory MyDataClass() { - return MyDataClass.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); - } -} - -final class $MyDataClassType extends jni.JObjType { - const $MyDataClassType(); - - @override - String get signature => - r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; + _$jni.JObject get error => _id_error.get(this, const _$jni.JObjectType()); - @override - MyDataClass fromReference(jni.JReference reference) => - MyDataClass.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); + /// from: `public java.lang.Throwable error` + /// The returned object must be released after use, by calling the [release] method. + set error(_$jni.JObject value) => + _id_error.set(this, const _$jni.JObjectType(), value); - @override - final superCount = 1; + static final _id_new$ = _class.constructorId( + r'(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V', + ); - @override - int get hashCode => ($MyDataClassType).hashCode; + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - @override - bool operator ==(Object other) { - return other.runtimeType == ($MyDataClassType) && other is $MyDataClassType; + /// from: `public void (com.github.dart_lang.jnigen.interfaces.MyRunnable runnable)` + /// The returned object must be released after use, by calling the [release] method. + factory MyRunnableRunner( + MyRunnable runnable, + ) { + return MyRunnableRunner.fromReference(_new$(_class.reference.pointer, + _id_new$ as _$jni.JMethodIDPtr, runnable.reference.pointer) + .reference); } -} - -/// from: `com.github.dart_lang.jnigen.simple_package.Color` -class Color extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Color.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - static final _class = - jni.JClass.forName(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 = _class.staticMethodId( - r'values', - r'()[Lcom/github/dart_lang/jnigen/simple_package/Color;', + static final _id_runOnSameThread = _class.instanceMethodId( + r'runOnSameThread', + r'()V', ); - static final _values = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') + static final _runOnSameThread = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.simple_package.Color[] values()` - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray values() { - return _values(_class.reference.pointer, _id_values as jni.JMethodIDPtr) - .object(const jni.JArrayType($ColorType())); + /// from: `public void runOnSameThread()` + void runOnSameThread() { + _runOnSameThread( + reference.pointer, _id_runOnSameThread as _$jni.JMethodIDPtr) + .check(); } - static final _id_valueOf = _class.staticMethodId( - r'valueOf', - r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;', + static final _id_runOnAnotherThread = _class.instanceMethodId( + r'runOnAnotherThread', + r'()V', ); - static final _valueOf = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') + static final _runOnAnotherThread = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer)>(); + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name)` - /// The returned object must be released after use, by calling the [release] method. - static Color valueOf( - jni.JString name, - ) { - return _valueOf(_class.reference.pointer, _id_valueOf as jni.JMethodIDPtr, - name.reference.pointer) - .object(const $ColorType()); + /// from: `public void runOnAnotherThread()` + void runOnAnotherThread() { + _runOnAnotherThread( + reference.pointer, _id_runOnAnotherThread as _$jni.JMethodIDPtr) + .check(); } } -final class $ColorType extends jni.JObjType { - const $ColorType(); +final class $MyRunnableRunner$Type extends _$jni.JObjType { + @_$jni.internal + const $MyRunnableRunner$Type(); - @override - String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Color;'; + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;'; - @override - Color fromReference(jni.JReference reference) => - Color.fromReference(reference); + @_$jni.internal + @_$core.override + MyRunnableRunner fromReference(_$jni.JReference reference) => + MyRunnableRunner.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($ColorType).hashCode; + @_$core.override + int get hashCode => ($MyRunnableRunner$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($ColorType) && other is $ColorType; + return other.runtimeType == ($MyRunnableRunner$Type) && + other is $MyRunnableRunner$Type; } } -/// from: `com.github.dart_lang.jnigen.simple_package.Exceptions` -class Exceptions extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.interfaces.StringConversionException` +class StringConversionException extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - Exceptions.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + StringConversionException.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/simple_package/Exceptions'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/StringConversionException'); /// The type which includes information such as the signature of this class. - static const type = $ExceptionsType(); + static const type = $StringConversionException$Type(); static final _id_new$ = _class.constructorId( - r'()V', - ); - - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `public void ()` - /// The returned object must be released after use, by calling the [release] method. - factory Exceptions() { - return Exceptions.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); - } - - static final _id_new$1 = _class.constructorId( - r'(F)V', - ); - - static final _new$1 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Double,)>)>>('globalEnv_NewObject') - .asFunction< - jni.JniResult Function( - ffi.Pointer, jni.JMethodIDPtr, double)>(); - - /// from: `public void (float x)` - /// The returned object must be released after use, by calling the [release] method. - factory Exceptions.new$1( - double x, - ) { - return Exceptions.fromReference( - _new$1(_class.reference.pointer, _id_new$1 as jni.JMethodIDPtr, x) - .reference); - } - - static final _id_new$2 = _class.constructorId( - r'(IIIIII)V', + r'(Ljava/lang/String;)V', ); - static final _new$2 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - $Int32, - $Int32, - $Int32, - $Int32, - $Int32, - $Int32 - )>)>>('globalEnv_NewObject') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_NewObject') .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - int, int, int, int, int)>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (int a, int b, int c, int d, int e, int f)` + /// from: `public void (java.lang.String message)` /// The returned object must be released after use, by calling the [release] method. - factory Exceptions.new$2( - int a, - int b, - int c, - int d, - int e, - int f, + factory StringConversionException( + _$jni.JString message, ) { - return Exceptions.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as jni.JMethodIDPtr, a, b, c, d, e, f) + return StringConversionException.fromReference(_new$( + _class.reference.pointer, + _id_new$ as _$jni.JMethodIDPtr, + message.reference.pointer) .reference); } +} - static final _id_staticObjectMethod = _class.staticMethodId( - r'staticObjectMethod', - r'()Ljava/lang/Object;', - ); - - static final _staticObjectMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `static public java.lang.Object staticObjectMethod()` - /// The returned object must be released after use, by calling the [release] method. - static jni.JObject staticObjectMethod() { - return _staticObjectMethod(_class.reference.pointer, - _id_staticObjectMethod as jni.JMethodIDPtr) - .object(const jni.JObjectType()); - } - - static final _id_staticIntMethod = _class.staticMethodId( - r'staticIntMethod', - r'()I', - ); - - static final _staticIntMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticIntMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: `static public int staticIntMethod()` - static int staticIntMethod() { - return _staticIntMethod( - _class.reference.pointer, _id_staticIntMethod as jni.JMethodIDPtr) - .integer; - } +final class $StringConversionException$Type + extends _$jni.JObjType { + @_$jni.internal + const $StringConversionException$Type(); - static final _id_staticObjectArrayMethod = _class.staticMethodId( - r'staticObjectArrayMethod', - r'()[Ljava/lang/Object;', - ); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/StringConversionException;'; - static final _staticObjectArrayMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + @_$core.override + StringConversionException fromReference(_$jni.JReference reference) => + StringConversionException.fromReference(reference); - /// from: `static public java.lang.Object[] staticObjectArrayMethod()` - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray staticObjectArrayMethod() { - return _staticObjectArrayMethod(_class.reference.pointer, - _id_staticObjectArrayMethod as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.JObjectType())); - } + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - static final _id_staticIntArrayMethod = _class.staticMethodId( - r'staticIntArrayMethod', - r'()[I', - ); + @_$jni.internal + @_$core.override + final superCount = 1; - static final _staticIntArrayMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$core.override + int get hashCode => ($StringConversionException$Type).hashCode; - /// from: `static public int[] staticIntArrayMethod()` - /// The returned object must be released after use, by calling the [release] method. - static jni.JArray staticIntArrayMethod() { - return _staticIntArrayMethod(_class.reference.pointer, - _id_staticIntArrayMethod as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jintType())); + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringConversionException$Type) && + other is $StringConversionException$Type; } +} - static final _id_objectMethod = _class.instanceMethodId( - r'objectMethod', - r'()Ljava/lang/Object;', - ); +/// from: `com.github.dart_lang.jnigen.interfaces.StringConverter` +class StringConverter extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - static final _objectMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + StringConverter.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - /// from: `public java.lang.Object objectMethod()` - /// The returned object must be released after use, by calling the [release] method. - jni.JObject objectMethod() { - return _objectMethod( - reference.pointer, _id_objectMethod as jni.JMethodIDPtr) - .object(const jni.JObjectType()); - } + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/StringConverter'); - static final _id_intMethod = _class.instanceMethodId( - r'intMethod', - r'()I', + /// The type which includes information such as the signature of this class. + static const type = $StringConverter$Type(); + static final _id_parseToInt = _class.instanceMethodId( + r'parseToInt', + r'(Ljava/lang/String;)I', ); - static final _intMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') + static final _parseToInt = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallIntMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public int intMethod()` - int intMethod() { - return _intMethod(reference.pointer, _id_intMethod as jni.JMethodIDPtr) + /// from: `public abstract int parseToInt(java.lang.String s)` + int parseToInt( + _$jni.JString s, + ) { + return _parseToInt(reference.pointer, _id_parseToInt as _$jni.JMethodIDPtr, + s.reference.pointer) .integer; } - static final _id_objectArrayMethod = _class.instanceMethodId( - r'objectArrayMethod', - r'()[Ljava/lang/Object;', - ); + /// Maps a specific port to the implemented interface. + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( + int port, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + _$jni.MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } - static final _objectArrayMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static final _$jni.Pointer< + _$jni.NativeFunction< + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); - /// from: `public java.lang.Object[] objectArrayMethod()` - /// The returned object must be released after use, by calling the [release] method. - jni.JArray objectArrayMethod() { - return _objectArrayMethod( - reference.pointer, _id_objectArrayMethod as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.JObjectType())); + static _$jni.Pointer<_$jni.Void> _$invokeMethod( + int $p, + _$jni.MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r'parseToInt(Ljava/lang/String;)I') { + final $r = _$impls[$p]!.parseToInt( + $a[0].as(const _$jni.JStringType(), releaseOriginal: true), + ); + return _$jni.JInteger($r).reference.toPointer(); + } + } catch (e) { + return _$jni.ProtectedJniExtensions.newDartException(e); + } + return _$jni.nullptr; } - static final _id_intArrayMethod = _class.instanceMethodId( - r'intArrayMethod', - r'()[I', - ); - - static final _intArrayMethod = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + static void implementIn( + _$jni.JImplementer implementer, + $StringConverter $impl, + ) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = _$jni.MethodInvocation.fromMessage($m); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + }); + implementer.add( + r'com.github.dart_lang.jnigen.interfaces.StringConverter', + $p, + _$invokePointer, + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } - /// from: `public int[] intArrayMethod()` - /// The returned object must be released after use, by calling the [release] method. - jni.JArray intArrayMethod() { - return _intArrayMethod( - reference.pointer, _id_intArrayMethod as jni.JMethodIDPtr) - .object(const jni.JArrayType(jni.jintType())); + factory StringConverter.implement( + $StringConverter $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return StringConverter.fromReference( + $i.implementReference(), + ); } +} - static final _id_throwNullPointerException = _class.instanceMethodId( - r'throwNullPointerException', - r'()I', - ); +abstract interface class $StringConverter { + factory $StringConverter({ + required int Function(_$jni.JString s) parseToInt, + }) = _$StringConverter; - static final _throwNullPointerException = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + int parseToInt(_$jni.JString s); +} - /// from: `public int throwNullPointerException()` - int throwNullPointerException() { - return _throwNullPointerException(reference.pointer, - _id_throwNullPointerException as jni.JMethodIDPtr) - .integer; +class _$StringConverter implements $StringConverter { + _$StringConverter({ + required int Function(_$jni.JString s) parseToInt, + }) : _parseToInt = parseToInt; + + final int Function(_$jni.JString s) _parseToInt; + + int parseToInt(_$jni.JString s) { + return _parseToInt(s); } +} - static final _id_throwFileNotFoundException = _class.instanceMethodId( - r'throwFileNotFoundException', - r'()Ljava/io/InputStream;', - ); +final class $StringConverter$Type extends _$jni.JObjType { + @_$jni.internal + const $StringConverter$Type(); - static final _throwFileNotFoundException = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/StringConverter;'; - /// from: `public java.io.InputStream throwFileNotFoundException()` - /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwFileNotFoundException() { - return _throwFileNotFoundException(reference.pointer, - _id_throwFileNotFoundException as jni.JMethodIDPtr) - .object(const jni.JObjectType()); - } + @_$jni.internal + @_$core.override + StringConverter fromReference(_$jni.JReference reference) => + StringConverter.fromReference(reference); - static final _id_throwClassCastException = _class.instanceMethodId( - r'throwClassCastException', - r'()Ljava/io/FileInputStream;', - ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - static final _throwClassCastException = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + @_$jni.internal + @_$core.override + final superCount = 1; - /// from: `public java.io.FileInputStream throwClassCastException()` - /// The returned object must be released after use, by calling the [release] method. - jni.JObject throwClassCastException() { - return _throwClassCastException( - reference.pointer, _id_throwClassCastException as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + @_$core.override + int get hashCode => ($StringConverter$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringConverter$Type) && + other is $StringConverter$Type; } +} - static final _id_throwArrayIndexException = _class.instanceMethodId( - r'throwArrayIndexException', - r'()I', +/// from: `com.github.dart_lang.jnigen.interfaces.StringConverterConsumer` +class StringConverterConsumer extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + StringConverterConsumer.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/StringConverterConsumer'); + + /// The type which includes information such as the signature of this class. + static const type = $StringConverterConsumer$Type(); + static final _id_new$ = _class.constructorId( + r'()V', ); - static final _throwArrayIndexException = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public int throwArrayIndexException()` - int throwArrayIndexException() { - return _throwArrayIndexException( - reference.pointer, _id_throwArrayIndexException as jni.JMethodIDPtr) - .integer; + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory StringConverterConsumer() { + return StringConverterConsumer.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); } - static final _id_throwArithmeticException = _class.instanceMethodId( - r'throwArithmeticException', - r'()I', + static final _id_consumeOnSameThread = _class.staticMethodId( + r'consumeOnSameThread', + r'(Lcom/github/dart_lang/jnigen/interfaces/StringConverter;Ljava/lang/String;)Ljava/lang/Integer;', ); - static final _throwArithmeticException = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') + static final _consumeOnSameThread = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// from: `public int throwArithmeticException()` - int throwArithmeticException() { - return _throwArithmeticException( - reference.pointer, _id_throwArithmeticException as jni.JMethodIDPtr) - .integer; + /// from: `static public java.lang.Integer consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String s)` + /// The returned object must be released after use, by calling the [release] method. + static _$jni.JInteger consumeOnSameThread( + StringConverter stringConverter, + _$jni.JString s, + ) { + return _consumeOnSameThread( + _class.reference.pointer, + _id_consumeOnSameThread as _$jni.JMethodIDPtr, + stringConverter.reference.pointer, + s.reference.pointer) + .object(const _$jni.JIntegerType()); } - static final _id_throwLoremIpsum = _class.staticMethodId( - r'throwLoremIpsum', - r'()V', + static final _id_consumeOnAnotherThread = _class.staticMethodId( + r'consumeOnAnotherThread', + r'(Lcom/github/dart_lang/jnigen/interfaces/StringConverter;Ljava/lang/String;)Ljava/util/concurrent/Future;', ); - static final _throwLoremIpsum = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_CallStaticVoidMethod') + static final _consumeOnAnotherThread = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public void throwLoremIpsum()` - static void throwLoremIpsum() { - _throwLoremIpsum( - _class.reference.pointer, _id_throwLoremIpsum as jni.JMethodIDPtr) - .check(); + /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String s)` + /// The returned object must be released after use, by calling the [release] method. + static _$jni.JObject consumeOnAnotherThread( + StringConverter stringConverter, + _$jni.JString s, + ) { + return _consumeOnAnotherThread( + _class.reference.pointer, + _id_consumeOnAnotherThread as _$jni.JMethodIDPtr, + stringConverter.reference.pointer, + s.reference.pointer) + .object(const _$jni.JObjectType()); } } -final class $ExceptionsType extends jni.JObjType { - const $ExceptionsType(); +final class $StringConverterConsumer$Type + extends _$jni.JObjType { + @_$jni.internal + const $StringConverterConsumer$Type(); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/simple_package/Exceptions;'; + r'Lcom/github/dart_lang/jnigen/interfaces/StringConverterConsumer;'; - @override - Exceptions fromReference(jni.JReference reference) => - Exceptions.fromReference(reference); + @_$jni.internal + @_$core.override + StringConverterConsumer fromReference(_$jni.JReference reference) => + StringConverterConsumer.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($ExceptionsType).hashCode; + @_$core.override + int get hashCode => ($StringConverterConsumer$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($ExceptionsType) && other is $ExceptionsType; + return other.runtimeType == ($StringConverterConsumer$Type) && + other is $StringConverterConsumer$Type; } } -/// from: `com.github.dart_lang.jnigen.simple_package.Fields` -class Fields extends jni.JObject { - @override - late final jni.JObjType $type = type; - - Fields.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); +/// from: `com.github.dart_lang.jnigen.inheritance.BaseClass` +class BaseClass<$T extends _$jni.JObject> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/simple_package/Fields'); + @_$jni.internal + final _$jni.JObjType<$T> T; - /// The type which includes information such as the signature of this class. - static const type = $FieldsType(); - static final _id_amount = _class.staticFieldId( - r'amount', - r'I', - ); + @_$jni.internal + BaseClass.fromReference( + this.T, + _$jni.JReference reference, + ) : $type = type(T), + super.fromReference(reference); - /// from: `static public int amount` - static int get amount => _id_amount.get(_class, const jni.jintType()); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/inheritance/BaseClass'); - /// from: `static public int amount` - static set amount(int value) => - _id_amount.set(_class, const jni.jintType(), value); + /// The type which includes information such as the signature of this class. + static $BaseClass$Type<$T> type<$T extends _$jni.JObject>( + _$jni.JObjType<$T> T, + ) { + return $BaseClass$Type( + T, + ); + } - static final _id_pi = _class.staticFieldId( - r'pi', - r'D', + static final _id_new$ = _class.constructorId( + r'()V', ); - /// from: `static public double pi` - static double get pi => _id_pi.get(_class, const jni.jdoubleType()); - - /// from: `static public double pi` - static set pi(double value) => - _id_pi.set(_class, const jni.jdoubleType(), value); - - static final _id_asterisk = _class.staticFieldId( - r'asterisk', - r'C', - ); + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `static public char asterisk` - static int get asterisk => _id_asterisk.get(_class, const jni.jcharType()); + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory BaseClass({ + required _$jni.JObjType<$T> T, + }) { + return BaseClass.fromReference( + T, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); + } +} - /// from: `static public char asterisk` - static set asterisk(int value) => - _id_asterisk.set(_class, const jni.jcharType(), value); +final class $BaseClass$Type<$T extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; - static final _id_name = _class.staticFieldId( - r'name', - r'Ljava/lang/String;', + @_$jni.internal + const $BaseClass$Type( + this.T, ); - /// 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 => _id_name.get(_class, const jni.JStringType()); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/inheritance/BaseClass;'; - /// 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) => - _id_name.set(_class, const jni.JStringType(), value); + @_$jni.internal + @_$core.override + BaseClass<$T> fromReference(_$jni.JReference reference) => + BaseClass.fromReference(T, reference); - static final _id_i = _class.instanceFieldId( - r'i', - r'Ljava/lang/Integer;', - ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - /// from: `public java.lang.Integer i` - /// The returned object must be released after use, by calling the [release] method. - jni.JInteger get i => _id_i.get(this, const jni.JIntegerType()); + @_$jni.internal + @_$core.override + final superCount = 1; - /// from: `public java.lang.Integer i` - /// The returned object must be released after use, by calling the [release] method. - set i(jni.JInteger value) => _id_i.set(this, const jni.JIntegerType(), value); + @_$core.override + int get hashCode => Object.hash($BaseClass$Type, T); - static final _id_trillion = _class.instanceFieldId( - r'trillion', - r'J', - ); + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($BaseClass$Type<$T>) && + other is $BaseClass$Type<$T> && + T == other.T; + } +} - /// from: `public long trillion` - int get trillion => _id_trillion.get(this, const jni.jlongType()); +/// from: `com.github.dart_lang.jnigen.inheritance.GenericDerivedClass` +class GenericDerivedClass<$T extends _$jni.JObject> extends BaseClass<$T> { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; - /// from: `public long trillion` - set trillion(int value) => - _id_trillion.set(this, const jni.jlongType(), value); + @_$jni.internal + final _$jni.JObjType<$T> T; - static final _id_isAchillesDead = _class.instanceFieldId( - r'isAchillesDead', - r'Z', - ); + @_$jni.internal + GenericDerivedClass.fromReference( + this.T, + _$jni.JReference reference, + ) : $type = type(T), + super.fromReference(T, reference); - /// from: `public boolean isAchillesDead` - bool get isAchillesDead => - _id_isAchillesDead.get(this, const jni.jbooleanType()); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/inheritance/GenericDerivedClass'); - /// from: `public boolean isAchillesDead` - set isAchillesDead(bool value) => - _id_isAchillesDead.set(this, const jni.jbooleanType(), value); + /// The type which includes information such as the signature of this class. + static $GenericDerivedClass$Type<$T> type<$T extends _$jni.JObject>( + _$jni.JObjType<$T> T, + ) { + return $GenericDerivedClass$Type( + T, + ); + } - static final _id_bestFighterInGreece = _class.instanceFieldId( - r'bestFighterInGreece', - r'Ljava/lang/String;', + static final _id_new$ = _class.constructorId( + r'()V', ); - /// from: `public java.lang.String bestFighterInGreece` - /// The returned object must be released after use, by calling the [release] method. - jni.JString get bestFighterInGreece => - _id_bestFighterInGreece.get(this, const jni.JStringType()); + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `public java.lang.String bestFighterInGreece` + /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - set bestFighterInGreece(jni.JString value) => - _id_bestFighterInGreece.set(this, const jni.JStringType(), value); + factory GenericDerivedClass({ + required _$jni.JObjType<$T> T, + }) { + return GenericDerivedClass.fromReference( + T, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); + } +} - static final _id_random = _class.instanceFieldId( - r'random', - r'Ljava/util/Random;', +final class $GenericDerivedClass$Type<$T extends _$jni.JObject> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $GenericDerivedClass$Type( + this.T, ); - /// from: `public java.util.Random random` - /// The returned object must be released after use, by calling the [release] method. - jni.JObject get random => _id_random.get(this, const jni.JObjectType()); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/inheritance/GenericDerivedClass;'; - /// from: `public java.util.Random random` - /// The returned object must be released after use, by calling the [release] method. - set random(jni.JObject value) => - _id_random.set(this, const jni.JObjectType(), value); + @_$jni.internal + @_$core.override + GenericDerivedClass<$T> fromReference(_$jni.JReference reference) => + GenericDerivedClass.fromReference(T, reference); - static final _id_euroSymbol = _class.staticFieldId( - r'euroSymbol', - r'C', - ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $BaseClass$Type(T); - /// from: `static public char euroSymbol` - static int get euroSymbol => - _id_euroSymbol.get(_class, const jni.jcharType()); + @_$jni.internal + @_$core.override + final superCount = 2; - /// from: `static public char euroSymbol` - static set euroSymbol(int value) => - _id_euroSymbol.set(_class, const jni.jcharType(), value); + @_$core.override + int get hashCode => Object.hash($GenericDerivedClass$Type, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GenericDerivedClass$Type<$T>) && + other is $GenericDerivedClass$Type<$T> && + T == other.T; + } +} +/// from: `com.github.dart_lang.jnigen.inheritance.SpecificDerivedClass` +class SpecificDerivedClass extends BaseClass<_$jni.JString> { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + SpecificDerivedClass.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(const _$jni.JStringType(), reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/inheritance/SpecificDerivedClass'); + + /// The type which includes information such as the signature of this class. + static const type = $SpecificDerivedClass$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory Fields() { - return Fields.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + factory SpecificDerivedClass() { + return SpecificDerivedClass.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $FieldsType extends jni.JObjType { - const $FieldsType(); +final class $SpecificDerivedClass$Type + extends _$jni.JObjType { + @_$jni.internal + const $SpecificDerivedClass$Type(); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/simple_package/Fields;'; + r'Lcom/github/dart_lang/jnigen/inheritance/SpecificDerivedClass;'; - @override - Fields fromReference(jni.JReference reference) => - Fields.fromReference(reference); + @_$jni.internal + @_$core.override + SpecificDerivedClass fromReference(_$jni.JReference reference) => + SpecificDerivedClass.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const $BaseClass$Type(_$jni.JStringType()); - @override - final superCount = 1; + @_$jni.internal + @_$core.override + final superCount = 2; - @override - int get hashCode => ($FieldsType).hashCode; + @_$core.override + int get hashCode => ($SpecificDerivedClass$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($FieldsType) && other is $FieldsType; + return other.runtimeType == ($SpecificDerivedClass$Type) && + other is $SpecificDerivedClass$Type; } } -/// from: `com.github.dart_lang.jnigen.simple_package.Fields$Nested` -class Fields_Nested extends jni.JObject { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable$Case` +class JsonSerializable_Case extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - Fields_Nested.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + JsonSerializable_Case.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/simple_package/Fields$Nested'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/JsonSerializable$Case'); /// The type which includes information such as the signature of this class. - static const type = $Fields_NestedType(); - static final _id_hundred = _class.instanceFieldId( - r'hundred', - r'J', - ); - - /// from: `public long hundred` - int get hundred => _id_hundred.get(this, const jni.jlongType()); - - /// from: `public long hundred` - set hundred(int value) => _id_hundred.set(this, const jni.jlongType(), value); - - static final _id_BEST_GOD = _class.staticFieldId( - r'BEST_GOD', - r'Ljava/lang/String;', + static const type = $JsonSerializable_Case$Type(); + static final _id_values = _class.staticMethodId( + r'values', + r'()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', ); - /// 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 => - _id_BEST_GOD.get(_class, const jni.JStringType()); + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); - /// from: `static public java.lang.String BEST_GOD` + /// 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 set BEST_GOD(jni.JString value) => - _id_BEST_GOD.set(_class, const jni.JStringType(), value); + static _$jni.JArray values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object(const _$jni.JArrayType($JsonSerializable_Case$Type())); + } - static final _id_new$ = _class.constructorId( - r'()V', + static final _id_valueOf = _class.staticMethodId( + r'valueOf', + r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// 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 Fields_Nested() { - return Fields_Nested.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); + static JsonSerializable_Case valueOf( + _$jni.JString name, + ) { + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + name.reference.pointer) + .object(const $JsonSerializable_Case$Type()); } } -final class $Fields_NestedType extends jni.JObjType { - const $Fields_NestedType(); +final class $JsonSerializable_Case$Type + extends _$jni.JObjType { + @_$jni.internal + const $JsonSerializable_Case$Type(); - @override + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;'; + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; - @override - Fields_Nested fromReference(jni.JReference reference) => - Fields_Nested.fromReference(reference); + @_$jni.internal + @_$core.override + JsonSerializable_Case fromReference(_$jni.JReference reference) => + JsonSerializable_Case.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => ($Fields_NestedType).hashCode; + @_$core.override + int get hashCode => ($JsonSerializable_Case$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Fields_NestedType) && - other is $Fields_NestedType; + return other.runtimeType == ($JsonSerializable_Case$Type) && + other is $JsonSerializable_Case$Type; } } -/// 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; +/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable` +class JsonSerializable extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - GenericTypeParams.fromReference( - this.S, - this.K, - jni.JReference reference, - ) : super.fromReference(reference); + @_$jni.internal + JsonSerializable.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = jni.JClass.forName( - r'com/github/dart_lang/jnigen/generics/GenericTypeParams'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/JsonSerializable'); /// 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 _id_new$ = _class.constructorId( - r'()V', + static const type = $JsonSerializable$Type(); + static final _id_value = _class.instanceMethodId( + r'value', + r'()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>('globalEnv_NewObject') + static final _value = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); - /// from: `public void ()` + /// 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. - factory GenericTypeParams({ - required jni.JObjType<$S> S, - required jni.JObjType<$K> K, - }) { - return GenericTypeParams.fromReference( - S, - K, - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) - .reference); + JsonSerializable_Case value() { + return _value(reference.pointer, _id_value as _$jni.JMethodIDPtr) + .object(const $JsonSerializable_Case$Type()); + } + + /// Maps a specific port to the implemented interface. + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( + int port, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + _$jni.MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final _$jni.Pointer< + _$jni.NativeFunction< + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + + static _$jni.Pointer<_$jni.Void> _$invokeMethod( + int $p, + _$jni.MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == + r'value()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;') { + final $r = _$impls[$p]!.value(); + return ($r as _$jni.JObject) + .as(const _$jni.JObjectType()) + .reference + .toPointer(); + } + } catch (e) { + return _$jni.ProtectedJniExtensions.newDartException(e); + } + return _$jni.nullptr; + } + + static void implementIn( + _$jni.JImplementer implementer, + $JsonSerializable $impl, + ) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = _$jni.MethodInvocation.fromMessage($m); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + }); + implementer.add( + r'com.github.dart_lang.jnigen.annotations.JsonSerializable', + $p, + _$invokePointer, + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } + + factory JsonSerializable.implement( + $JsonSerializable $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return JsonSerializable.fromReference( + $i.implementReference(), + ); } } -final class $GenericTypeParamsType<$S extends jni.JObject, - $K extends jni.JObject> extends jni.JObjType> { - final jni.JObjType<$S> S; - final jni.JObjType<$K> K; +abstract interface class $JsonSerializable { + factory $JsonSerializable({ + required JsonSerializable_Case Function() value, + }) = _$JsonSerializable; - const $GenericTypeParamsType( - this.S, - this.K, - ); + JsonSerializable_Case value(); +} + +class _$JsonSerializable implements $JsonSerializable { + _$JsonSerializable({ + required JsonSerializable_Case Function() value, + }) : _value = value; + + final JsonSerializable_Case Function() _value; + + JsonSerializable_Case value() { + return _value(); + } +} - @override +final class $JsonSerializable$Type extends _$jni.JObjType { + @_$jni.internal + const $JsonSerializable$Type(); + + @_$jni.internal + @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;'; + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; - @override - GenericTypeParams<$S, $K> fromReference(jni.JReference reference) => - GenericTypeParams.fromReference(S, K, reference); + @_$jni.internal + @_$core.override + JsonSerializable fromReference(_$jni.JReference reference) => + JsonSerializable.fromReference(reference); - @override - jni.JObjType get superType => const jni.JObjectType(); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override + @_$jni.internal + @_$core.override final superCount = 1; - @override - int get hashCode => Object.hash($GenericTypeParamsType, S, K); + @_$core.override + int get hashCode => ($JsonSerializable$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($GenericTypeParamsType<$S, $K>) && - other is $GenericTypeParamsType<$S, $K> && - S == other.S && - K == other.K; + return other.runtimeType == ($JsonSerializable$Type) && + other is $JsonSerializable$Type; } } -/// from: `com.github.dart_lang.jnigen.generics.StringMap` -class StringMap extends StringKeyedMap { - @override - late final jni.JObjType $type = type; +/// from: `com.github.dart_lang.jnigen.annotations.MyDataClass` +class MyDataClass extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; - StringMap.fromReference( - jni.JReference reference, - ) : super.fromReference(const jni.JStringType(), reference); + @_$jni.internal + MyDataClass.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); - static final _class = - jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringMap'); + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/MyDataClass'); /// The type which includes information such as the signature of this class. - static const type = $StringMapType(); + static const type = $MyDataClass$Type(); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory StringMap() { - return StringMap.fromReference( - _new$(_class.reference.pointer, _id_new$ as jni.JMethodIDPtr) + factory MyDataClass() { + return MyDataClass.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $StringMapType extends jni.JObjType { - const $StringMapType(); +final class $MyDataClass$Type extends _$jni.JObjType { + @_$jni.internal + const $MyDataClass$Type(); - @override - String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringMap;'; + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; - @override - StringMap fromReference(jni.JReference reference) => - StringMap.fromReference(reference); + @_$jni.internal + @_$core.override + MyDataClass fromReference(_$jni.JReference reference) => + MyDataClass.fromReference(reference); - @override - jni.JObjType get superType => const $StringKeyedMapType(jni.JStringType()); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); - @override - final superCount = 3; + @_$jni.internal + @_$core.override + final superCount = 1; - @override - int get hashCode => ($StringMapType).hashCode; + @_$core.override + int get hashCode => ($MyDataClass$Type).hashCode; - @override + @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($StringMapType) && other is $StringMapType; + return other.runtimeType == ($MyDataClass$Type) && + other is $MyDataClass$Type; } } diff --git a/pkgs/jnigen/test/simple_package_test/generate.dart b/pkgs/jnigen/test/simple_package_test/generate.dart index ce498c0dc..b91478059 100644 --- a/pkgs/jnigen/test/simple_package_test/generate.dart +++ b/pkgs/jnigen/test/simple_package_test/generate.dart @@ -24,24 +24,32 @@ const preamble = ''' final javaPrefix = join('com', 'github', 'dart_lang', 'jnigen'); final javaFiles = [ + join(javaPrefix, 'annotations', 'JsonSerializable.java'), + join(javaPrefix, 'annotations', 'MyDataClass.java'), + join(javaPrefix, 'simple_package', 'Color.java'), join(javaPrefix, 'simple_package', 'Example.java'), + join(javaPrefix, 'simple_package', 'Exceptions.java'), + join(javaPrefix, 'simple_package', 'Fields.java'), join(javaPrefix, 'pkg2', 'C2.java'), join(javaPrefix, 'pkg2', 'Example.java'), join(javaPrefix, 'generics', 'MyStack.java'), join(javaPrefix, 'generics', 'MyMap.java'), + join(javaPrefix, 'generics', 'GenericTypeParams.java'), join(javaPrefix, 'generics', 'GrandParent.java'), join(javaPrefix, 'generics', 'StringStack.java'), - join(javaPrefix, 'generics', 'StringValuedMap.java'), join(javaPrefix, 'generics', 'StringKeyedMap.java'), - join(javaPrefix, 'interfaces', 'MyRunnable.java'), - join(javaPrefix, 'interfaces', 'MyRunnableRunner.java'), + join(javaPrefix, 'generics', 'StringMap.java'), + join(javaPrefix, 'generics', 'StringValuedMap.java'), + join(javaPrefix, 'inheritance', 'BaseClass.java'), + join(javaPrefix, 'inheritance', 'GenericDerivedClass.java'), + join(javaPrefix, 'inheritance', 'SpecificDerivedClass.java'), join(javaPrefix, 'interfaces', 'MyInterface.java'), join(javaPrefix, 'interfaces', 'MyInterfaceConsumer.java'), + join(javaPrefix, 'interfaces', 'MyRunnable.java'), + join(javaPrefix, 'interfaces', 'MyRunnableRunner.java'), join(javaPrefix, 'interfaces', 'StringConversionException.java'), join(javaPrefix, 'interfaces', 'StringConverter.java'), join(javaPrefix, 'interfaces', 'StringConverterConsumer.java'), - join(javaPrefix, 'annotations', 'JsonSerializable.java'), - join(javaPrefix, 'annotations', 'MyDataClass.java'), ]; void compileJavaSources(String workingDir, List files) async { @@ -65,12 +73,16 @@ Config getConfig() { 'com.github.dart_lang.jnigen.pkg2', 'com.github.dart_lang.jnigen.generics', 'com.github.dart_lang.jnigen.interfaces', + 'com.github.dart_lang.jnigen.inheritance', 'com.github.dart_lang.jnigen.annotations', ], logLevel: Level.INFO, customClassBody: { 'com.github.dart_lang.jnigen.interfaces.MyInterface': r''' - static Map get $impls => _$impls; + static _$core.Map get $impls => _$impls; +''', + 'com.github.dart_lang.jnigen.interfaces.MyRunnable': r''' + static _$core.Map get $impls => _$impls; ''' }, outputConfig: OutputConfig( diff --git a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart index f59bd24fd..642ba29a3 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'dart:io'; import 'dart:isolate'; +import 'package:jni/_internal.dart'; import 'package:jni/jni.dart'; import 'package:test/test.dart'; @@ -270,7 +271,7 @@ void registerTests(String groupName, TestRunnerCallback test) { GrandParent('Hello'.toJString()..releasedBy(arena)) ..releasedBy(arena); expect(grandParent, isA>()); - expect(grandParent.$type, isA<$GrandParentType>()); + expect(grandParent.$type, isA<$GrandParent$Type>()); expect( grandParent.value.toDartString(releaseOriginal: true), 'Hello'); }); @@ -312,21 +313,19 @@ void registerTests(String groupName, TestRunnerCallback test) { map.put('Hello'.toJString()..releasedBy(arena), helloExample); map.put('World'.toJString()..releasedBy(arena), worldExample); expect( - (map.get$('Hello'.toJString()..releasedBy(arena)) - ..releasedBy(arena)) + (map.get('Hello'.toJString()..releasedBy(arena))..releasedBy(arena)) .getNumber(), 1, ); expect( - (map.get$('World'.toJString()..releasedBy(arena)) - ..releasedBy(arena)) + (map.get('World'.toJString()..releasedBy(arena))..releasedBy(arena)) .getNumber(), 2, ); expect( ((map.entryStack()..releasedBy(arena)).pop()..releasedBy(arena)) .key - .castTo(JString.type, releaseOriginal: true) + .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), anyOf('Hello', 'World'), ); @@ -347,7 +346,7 @@ void registerTests(String groupName, TestRunnerCallback test) { final example = Example()..releasedBy(arena); map.put('Hello'.toJString()..releasedBy(arena), example); expect( - (map.get$('Hello'.toJString()..releasedBy(arena)) + (map.get('Hello'.toJString()..releasedBy(arena)) ..releasedBy(arena)) .getNumber(), 0, @@ -360,7 +359,7 @@ void registerTests(String groupName, TestRunnerCallback test) { final example = Example()..releasedBy(arena); map.put(example, 'Hello'.toJString()..releasedBy(arena)); expect( - map.get$(example).toDartString(releaseOriginal: true), + map.get(example).toDartString(releaseOriginal: true), 'Hello', ); }); @@ -372,7 +371,7 @@ void registerTests(String groupName, TestRunnerCallback test) { 'world'.toJString()..releasedBy(arena)); expect( map - .get$('hello'.toJString()..releasedBy(arena)) + .get('hello'.toJString()..releasedBy(arena)) .toDartString(releaseOriginal: true), 'world', ); @@ -414,7 +413,7 @@ void registerTests(String groupName, TestRunnerCallback test) { final strParent = grandParent.stringParent()..releasedBy(arena); expect( strParent.parentValue - .castTo(JString.type, releaseOriginal: true) + .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), '!', ); @@ -428,7 +427,7 @@ void registerTests(String groupName, TestRunnerCallback test) { ..releasedBy(arena); expect( exampleParent.parentValue - .castTo(JString.type, releaseOriginal: true) + .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), '!', ); @@ -466,7 +465,7 @@ void registerTests(String groupName, TestRunnerCallback test) { 'Hello'.toJString()..releasedBy(arena), )..releasedBy(arena); expect(stack, isA>()); - expect(stack.$type, isA<$MyStackType>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( stack.pop().toDartString(releaseOriginal: true), 'Hello', @@ -480,7 +479,7 @@ void registerTests(String groupName, TestRunnerCallback test) { 'World'.toJString()..releasedBy(arena), )..releasedBy(arena); expect(stack, isA>()); - expect(stack.$type, isA<$MyStackType>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( stack.pop().toDartString(releaseOriginal: true), 'World', @@ -500,18 +499,18 @@ void registerTests(String groupName, TestRunnerCallback test) { array, )..releasedBy(arena); expect(stack, isA>()); - expect(stack.$type, isA<$MyStackType>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( stack .pop() - .castTo(JArray.type(JString.type), releaseOriginal: true)[0] + .as(JArray.type(JString.type), releaseOriginal: true)[0] .toDartString(releaseOriginal: true), 'World', ); expect( stack .pop() - .castTo(JString.type, releaseOriginal: true) + .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), 'Hello', ); @@ -523,7 +522,7 @@ void registerTests(String groupName, TestRunnerCallback test) { ..releasedBy(arena); final stack = MyStack.fromArray(array)..releasedBy(arena); expect(stack, isA>()); - expect(stack.$type, isA<$MyStackType>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( stack.pop().toDartString(releaseOriginal: true), 'Hello', @@ -543,7 +542,7 @@ void registerTests(String groupName, TestRunnerCallback test) { MyStack.fromArrayOfArrayOfGrandParents(twoDimentionalArray) ..releasedBy(arena); expect(stack, isA>()); - expect(stack.$type, isA<$MyStackType>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( stack.pop().toDartString(releaseOriginal: true), 'Hello', @@ -566,7 +565,7 @@ void registerTests(String groupName, TestRunnerCallback test) { // or `self` argument for each one of the callbacks. late final MyInterface myInterface; myInterface = MyInterface.implement( - $MyInterfaceImpl( + $MyInterface( voidCallback: voidCallbackResult.complete, stringCallback: (s) { return (s.toDartString(releaseOriginal: true) * 2).toJString(); @@ -617,7 +616,7 @@ void registerTests(String groupName, TestRunnerCallback test) { expect(manyPrimitives, -1 + 3 + 3.14.toInt() + 1); // Currently we have one implementation of the interface. - expect(MyInterface.$impls, hasLength(1)); + expect(MyInterface.$impls, hasLength(1), skip: Platform.isAndroid); myInterface.release(); if (!Platform.isAndroid) { // Running garbage collection does not work on Android. Skipping this @@ -634,6 +633,75 @@ void registerTests(String groupName, TestRunnerCallback test) { expect(MyInterface.$impls, isEmpty); } }); + test('implementing multiple interfaces', () async { + final implementer = JImplementer(); + MyInterface.implementIn( + implementer, + $MyInterface( + T: JString.type, + voidCallback: (s) {}, + stringCallback: (s) { + return s; + }, + varCallback: (t) { + return t; + }, + manyPrimitives: (a, b, c, d) => 42, + ), + ); + var runnableRan = false; + MyRunnable.implementIn( + implementer, + $MyRunnable( + run: () { + runnableRan = true; + }, + ), + ); + final runnable = implementer.implement(MyRunnable.type); + runnable.run(); + expect(runnableRan, isTrue); + final myInterface = runnable.as( + MyInterface.type(JString.type), + releaseOriginal: true, + ); + expect(myInterface.manyPrimitives(1, true, 3, 4), 42); + + expect(MyInterface.$impls, hasLength(1), skip: Platform.isAndroid); + expect(MyRunnable.$impls, hasLength(1), skip: Platform.isAndroid); + myInterface.release(); + if (!Platform.isAndroid) { + // Running garbage collection does not work on Android. Skipping this + // test for android. + _runJavaGC(); + for (var i = 0; i < 8; ++i) { + await Future.delayed(Duration(milliseconds: (1 << i) * 100)); + if (MyInterface.$impls.isEmpty) { + break; + } + } + // Since the interface is now deleted, the cleaner must signal to Dart + // to clean up. + expect(MyInterface.$impls, isEmpty); + expect(MyRunnable.$impls, isEmpty); + } + }); + test('Reuse implementation for multiple instances', () { + using((arena) { + final hexParser = + StringConverter.implement(DartStringToIntParser(radix: 16)) + ..releasedBy(arena); + final decimalParser = + StringConverter.implement(DartStringToIntParser(radix: 10)) + ..releasedBy(arena); + final fifteen = StringConverterConsumer.consumeOnSameThread( + hexParser, 'F'.toJString()..releasedBy(arena)); + expect(fifteen.intValue(releaseOriginal: true), 15); + final fortyTwo = StringConverterConsumer.consumeOnSameThread( + decimalParser, '42'.toJString()..releasedBy(arena)); + expect(fortyTwo.intValue(releaseOriginal: true), 42); + }); + }); } group('Dart exceptions are handled', () { for (final exception in [UnimplementedError(), 'Hello!']) { @@ -641,47 +709,57 @@ void registerTests(String groupName, TestRunnerCallback test) { test( 'on ${sameThread ? 'the same thread' : 'another thread'}' ' throwing $exception', () async { - final runnable = MyRunnable.implement( - $MyRunnableImpl( - run: () { - // ignore: only_throw_errors - throw exception; - }, - ), - ); - final runner = MyRunnableRunner(runnable); - if (sameThread) { - runner.runOnSameThread(); - } else { - runner.runOnAnotherThread(); - } - while (runner.error.isNull) { - await Future.delayed(const Duration(milliseconds: 100)); + await using((arena) async { + final runnable = MyRunnable.implement( + $MyRunnable( + run: () { + // ignore: only_throw_errors + throw exception; + }, + ), + )..releasedBy(arena); + final runner = MyRunnableRunner(runnable)..releasedBy(arena); + if (sameThread) { + runner.runOnSameThread(); + } else { + runner.runOnAnotherThread(); + } + while (runner.error.isNull) { + await Future.delayed(const Duration(milliseconds: 100)); + } + expect( + Jni.env.IsInstanceOf( + // ignore: invalid_use_of_internal_member + runner.error.reference.pointer, + JClass.forName( + 'java/lang/reflect/UndeclaredThrowableException') + // ignore: invalid_use_of_internal_member + .reference + .pointer, + ), + isTrue, + ); + final throwableClass = runner.error.jClass; + final cause = throwableClass + .instanceMethodId('getCause', '()Ljava/lang/Throwable;') + .call(runner.error, JObject.type, []); + expect( + Jni.env.IsInstanceOf( + // ignore: invalid_use_of_internal_member + cause.reference.pointer, + JClass.forName( + 'com/github/dart_lang/jni/PortProxyBuilder\$DartException') + // ignore: invalid_use_of_internal_member + .reference + .pointer, + ), + isTrue, + ); + expect(cause.toString(), contains(exception.toString())); + }); + if (!Platform.isAndroid) { + _runJavaGC(); } - expect( - Jni.env.IsInstanceOf( - runner.error.reference.pointer, - JClass.forName('java/lang/reflect/UndeclaredThrowableException') - .reference - .pointer, - ), - isTrue, - ); - final throwableClass = runner.error.jClass; - final cause = throwableClass - .instanceMethodId('getCause', '()Ljava/lang/Throwable;') - .call(runner.error, JObject.type, []); - expect( - Jni.env.IsInstanceOf( - cause.reference.pointer, - JClass.forName( - 'com/github/dart_lang/jni/PortProxy\$DartException') - .reference - .pointer, - ), - isTrue, - ); - expect(cause.toString(), contains(exception.toString())); }); } } @@ -693,8 +771,7 @@ void registerTests(String groupName, TestRunnerCallback test) { ('the same thread', StringConverterConsumer.consumeOnSameThread), ]) { test('StringConverter.implement on $threading ', () async { - final stringConverter = - StringConverter.implement($StringConverterImpl( + final stringConverter = StringConverter.implement($StringConverter( parseToInt: (s) { final value = int.tryParse(s.toDartString()); if (value == null) { @@ -710,7 +787,10 @@ void registerTests(String groupName, TestRunnerCallback test) { // Gets the result of a Java Future. // TODO(#1213): remove this once we support Java futures. Future<$T> toDartFuture<$T extends JObject>( - JObject future, JObjType<$T> T) async { + JObject future, + // ignore: invalid_use_of_internal_member + JObjType<$T> T, + ) async { final receivePort = ReceivePort(); await Isolate.spawn((sendPort) { final futureClass = JClass.forName('java/util/concurrent/Future'); @@ -815,3 +895,14 @@ void registerTests(String groupName, TestRunnerCallback test) { } }); } + +class DartStringToIntParser implements $StringConverter { + final int radix; + + DartStringToIntParser({required this.radix}); + + @override + int parseToInt(JString s) { + return int.parse(s.toDartString(releaseOriginal: true), radix: radix); + } +} diff --git a/pkgs/native_assets_builder/CHANGELOG.md b/pkgs/native_assets_builder/CHANGELOG.md index 6e6bc9a6c..ed1a89875 100644 --- a/pkgs/native_assets_builder/CHANGELOG.md +++ b/pkgs/native_assets_builder/CHANGELOG.md @@ -1,9 +1,22 @@ -## 0.8.3-wip +## 0.8.4-wip + +- Also lock `BuildConfig` and `LinkConfig` `outputDirectoryShared` when invoking + hooks to prevent concurrency issues with shared output caching. +- Fix test packages with RecordUse annotations + [#1586](https://github.com/dart-lang/native/issues/1586). +- Update SDK constraint to 3.5.0+ +- Rename the environment variables we use to communicate CCompilerConfig from + Dart CI test runner to the `package:native_assets_builder` for testing the + dart-lang/native repository to make it clear those are not intended to be used + by end-users. + +## 0.8.3 - Added a validation step on the output of the build and link hooks (both as a per package, and as in all the packages together). - Fixed caching bug for link hooks [#1515](https://github.com/dart-lang/native/pull/1515). +- Bump `native_toolchain_c` to `0.5.4` and `native_assets_cli` to `0.8.0`. ## 0.8.2 diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 2a1f05a54..5c0a2a0cb 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -6,11 +6,11 @@ import 'dart:async'; import 'dart:io'; import 'package:logging/logging.dart'; -import 'package:native_assets_cli/locking.dart'; import 'package:native_assets_cli/native_assets_cli.dart' as api; import 'package:native_assets_cli/native_assets_cli_internal.dart'; import 'package:package_config/package_config.dart'; +import '../locking/locking.dart'; import '../model/build_dry_run_result.dart'; import '../model/build_result.dart'; import '../model/hook_result.dart'; @@ -158,6 +158,43 @@ class NativeAssetsBuildRunner { assert(hook == Hook.link || buildResult == null); assert(hook == Hook.build || linkingEnabled == null); + // Specifically for running our tests on Dart CI with the test runner, we + // recognize specific variables to setup the C Compiler configuration. + if (cCompilerConfig == null) { + String? unparseKey(String key) => + 'DART_HOOK_TESTING_${key.replaceAll('.', '__').toUpperCase()}'; + + final env = Platform.environment; + String? lookup(String key) => env[unparseKey(key)]; + + final cc = lookup(CCompilerConfigImpl.ccConfigKeyFull); + final ar = lookup(CCompilerConfigImpl.arConfigKeyFull); + final ld = lookup(CCompilerConfigImpl.ldConfigKeyFull); + final envScript = lookup(CCompilerConfigImpl.envScriptConfigKeyFull); + final envScriptArgs = + lookup(CCompilerConfigImpl.envScriptArgsConfigKeyFull) + ?.split(' ') + .map((arg) => arg.trim()) + .where((arg) => arg.isNotEmpty) + .toList(); + final hasEnvScriptArgs = + envScriptArgs != null && envScriptArgs.isNotEmpty; + + if (cc != null || + ar != null || + ld != null || + envScript != null || + hasEnvScriptArgs) { + cCompilerConfig = CCompilerConfigImpl( + archiver: ar != null ? Uri.file(ar) : null, + compiler: cc != null ? Uri.file(cc) : null, + envScript: envScript != null ? Uri.file(envScript) : null, + envScriptArgs: hasEnvScriptArgs ? envScriptArgs : null, + linker: ld != null ? Uri.file(ld) : null, + ); + } + } + packageLayout ??= await PackageLayout.fromRootPackageRoot(workingDirectory); final (buildPlan, packageGraph, planSuccess) = await _makePlan( hook: hook, @@ -263,13 +300,21 @@ class NativeAssetsBuildRunner { ); final buildDirUri = packageLayout.dartToolNativeAssetsBuilder.resolve('$buildDirName/'); - final outDirUri = buildDirUri.resolve('out/'); - final outDir = Directory.fromUri(outDirUri); + final outputDirectory = buildDirUri.resolve('out/'); + final outDir = Directory.fromUri(outputDirectory); if (!await outDir.exists()) { // TODO(https://dartbug.com/50565): Purge old or unused folders. await outDir.create(recursive: true); } + final outputDirectoryShared = packageLayout.dartToolNativeAssetsBuilder + .resolve('shared/${package.name}/$hook/'); + final outDirShared = Directory.fromUri(outputDirectoryShared); + if (!await outDirShared.exists()) { + // TODO(https://dartbug.com/50565): Purge old or unused folders. + await outDirShared.create(recursive: true); + } + if (hook == Hook.link) { File? resourcesFile; if (resourceIdentifiers != null) { @@ -279,7 +324,8 @@ class NativeAssetsBuildRunner { } return LinkConfigImpl( - outputDirectory: outDirUri, + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: package.name, packageRoot: package.root, targetOS: target.os, @@ -297,7 +343,8 @@ class NativeAssetsBuildRunner { ); } else { return BuildConfigImpl( - outputDirectory: outDirUri, + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: package.name, packageRoot: package.root, targetOS: target.os, @@ -428,8 +475,11 @@ class NativeAssetsBuildRunner { continue; } // TODO(https://github.com/dart-lang/native/issues/1321): Should dry runs be cached? - var (buildOutput, packageSuccess) = await runUnderDirectoryLock( - Directory.fromUri(config.outputDirectory.parent), + var (buildOutput, packageSuccess) = await runUnderDirectoriesLock( + [ + Directory.fromUri(config.outputDirectoryShared.parent), + Directory.fromUri(config.outputDirectory.parent), + ], timeout: singleHookTimeout, logger: logger, () => _runHookForPackage( @@ -482,8 +532,11 @@ class NativeAssetsBuildRunner { PackageLayout packageLayout, ) async { final outDir = config.outputDirectory; - return await runUnderDirectoryLock( - Directory.fromUri(config.outputDirectory.parent), + return await runUnderDirectoriesLock( + [ + Directory.fromUri(config.outputDirectoryShared.parent), + Directory.fromUri(config.outputDirectory.parent), + ], timeout: singleHookTimeout, logger: logger, () async { @@ -608,9 +661,6 @@ ${result.stdout} try { final output = HookOutputImpl.readFromFile(file: config.outputFile) ?? - (config.outputFileV1_1_0 == null - ? null - : HookOutputImpl.readFromFile(file: config.outputFileV1_1_0!)) ?? HookOutputImpl(); final validateResult = await validate( @@ -784,15 +834,27 @@ ${compileResult.stdout} hook: hook, linkingEnabled: linkingEnabled, ); + final outDirUri = buildParentDir.resolve('$buildDirName/out/'); final outDir = Directory.fromUri(outDirUri); if (!await outDir.exists()) { await outDir.create(recursive: true); } + + // Shared between dry run and wet run. + final outputDirectoryShared = + buildParentDir.resolve('shared/${package.name}/$hook/out/'); + final outDirShared = Directory.fromUri(outputDirectoryShared); + if (!await outDirShared.exists()) { + // TODO(https://dartbug.com/50565): Purge old or unused folders. + await outDirShared.create(recursive: true); + } + switch (hook) { case Hook.build: return BuildConfigImpl.dryRun( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRoot, targetOS: targetOS, @@ -803,6 +865,7 @@ ${compileResult.stdout} case Hook.link: return LinkConfigImpl.dryRun( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRoot, targetOS: targetOS, diff --git a/pkgs/native_assets_cli/lib/src/locking/locking.dart b/pkgs/native_assets_builder/lib/src/locking/locking.dart similarity index 87% rename from pkgs/native_assets_cli/lib/src/locking/locking.dart rename to pkgs/native_assets_builder/lib/src/locking/locking.dart index 005bfb88b..c4b1d7ac3 100644 --- a/pkgs/native_assets_cli/lib/src/locking/locking.dart +++ b/pkgs/native_assets_builder/lib/src/locking/locking.dart @@ -7,6 +7,28 @@ import 'dart:io'; import 'package:logging/logging.dart'; +Future runUnderDirectoriesLock( + List directories, + Future Function() callback, { + Duration? timeout, + Logger? logger, +}) async { + if (directories.isEmpty) { + return await callback(); + } + return await runUnderDirectoryLock( + directories.first, + () => runUnderDirectoriesLock( + directories.skip(1).toList(), + callback, + timeout: timeout, + logger: logger, + ), + timeout: timeout, + logger: logger, + ); +} + /// Run [callback] with this Dart process having exclusive access to /// [directory]. /// diff --git a/pkgs/native_assets_builder/pubspec.yaml b/pkgs/native_assets_builder/pubspec.yaml index 387839ec9..f335ee763 100644 --- a/pkgs/native_assets_builder/pubspec.yaml +++ b/pkgs/native_assets_builder/pubspec.yaml @@ -1,19 +1,19 @@ name: native_assets_builder description: >- This package is the backend that invokes build hooks. -version: 0.8.3-wip +version: 0.8.4-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder publish_to: none environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' dependencies: collection: ^1.18.0 graphs: ^2.3.1 logging: ^1.2.0 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../native_assets_cli/ package_config: ^2.1.0 diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart index a7f02557f..ecfa8b28b 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart @@ -13,7 +13,9 @@ import 'helpers.dart'; const Timeout longTimeout = Timeout(Duration(minutes: 5)); void main() async { - String unparseKey(String key) => key.replaceAll('.', '__').toUpperCase(); + String unparseKey(String key) => + 'DART_HOOK_TESTING_${key.replaceAll('.', '__').toUpperCase()}'; + final arKey = unparseKey(CCompilerConfigImpl.arConfigKeyFull); final ccKey = unparseKey(CCompilerConfigImpl.ccConfigKeyFull); final ldKey = unparseKey(CCompilerConfigImpl.ldConfigKeyFull); diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test.dart new file mode 100644 index 000000000..1b095e6dd --- /dev/null +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test.dart @@ -0,0 +1,76 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; + +import 'package:native_assets_builder/src/utils/run_process.dart' + show RunProcessResult; +import 'package:native_assets_cli/native_assets_cli_internal.dart'; +import 'package:test/test.dart'; + +import '../helpers.dart'; +import 'helpers.dart'; + +const Timeout longTimeout = Timeout(Duration(minutes: 5)); + +void main() async { + const packageName = 'transformer'; + + test('Concurrent invocations', timeout: longTimeout, () async { + await inTempDir((tempUri) async { + final packageUri = tempUri.resolve('$packageName/'); + await copyTestProjects( + sourceUri: testDataUri.resolve('$packageName/'), + targetUri: packageUri, + ); + + await runPubGet( + workingDirectory: packageUri, + logger: logger, + ); + + Future runBuildInProcess( + Target target, + ) async { + final result = await runProcess( + executable: dartExecutable, + arguments: [ + pkgNativeAssetsBuilderUri + .resolve( + 'test/build_runner/concurrency_shared_test_helper.dart', + ) + .toFilePath(), + packageUri.toFilePath(), + target.toString(), + ], + workingDirectory: packageUri, + logger: logger, + ); + expect(result.exitCode, 0); + return result; + } + + // Simulate running `dart run` concurrently in 3 different terminals. + // Twice for the same target and also for a different target. + final results = await Future.wait([ + runBuildInProcess(Target.androidArm64), + runBuildInProcess(Target.current), + runBuildInProcess(Target.current), + ]); + final stdouts = results.map((e) => e.stdout).join('\n'); + // One run for the two targets wins in running first. + expect(stdouts, stringContainsInOrder(['Reused 0 cached files.'])); + // The other run reuses the cached results. + expect(stdouts, stringContainsInOrder(['Reused 10 cached files.'])); + // One of the two runs for the same target will not be invoked at all. + expect( + stdouts, + stringContainsInOrder([ + 'Waiting to be able to obtain lock of directory', + 'Skipping build for', + ]), + ); + }); + }); +} diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart new file mode 100644 index 000000000..ebec9d0d5 --- /dev/null +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -0,0 +1,38 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:logging/logging.dart'; +import 'package:native_assets_builder/native_assets_builder.dart'; +import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:native_assets_cli/native_assets_cli_internal.dart'; + +import '../helpers.dart'; + +// Is invoked concurrently multiple times in separate processes. +void main(List args) async { + final packageUri = Uri.directory(args[0]); + final target = Target.fromString(args[1]); + + final logger = Logger('') + ..level = Level.ALL + ..onRecord.listen((event) => print(event.message)); + + final result = await NativeAssetsBuildRunner( + logger: logger, + dartExecutable: dartExecutable, + ).build( + buildMode: BuildModeImpl.release, + linkModePreference: LinkModePreferenceImpl.dynamic, + target: target, + workingDirectory: packageUri, + includeParentEnvironment: true, + linkingEnabled: false, + supportedAssetTypes: [DataAsset.type], + targetAndroidNdkApi: target.os == OS.android ? 30 : null, + ); + if (!result.success) { + throw Error(); + } + print('done'); +} diff --git a/pkgs/native_assets_builder/test/build_runner/v1_0_0_test.dart b/pkgs/native_assets_builder/test/build_runner/v1_0_0_test.dart deleted file mode 100644 index 44a98a3e1..000000000 --- a/pkgs/native_assets_builder/test/build_runner/v1_0_0_test.dart +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:test/test.dart'; - -import '../helpers.dart'; -import 'helpers.dart'; - -const Timeout longTimeout = Timeout(Duration(minutes: 5)); - -void main() async { - test('native_add build', timeout: longTimeout, () async { - await inTempDir((tempUri) async { - await copyTestProjects(targetUri: tempUri); - final packageUri = tempUri.resolve('native_add_v1_0_0/'); - - // First, run `pub get`, we need pub to resolve our dependencies. - await runPubGet( - workingDirectory: packageUri, - logger: logger, - ); - - { - final result = await build( - packageUri, - logger, - dartExecutable, - ); - expect(result.assets.length, 1); - } - }); - }); -} diff --git a/pkgs/native_assets_builder/test/helpers.dart b/pkgs/native_assets_builder/test/helpers.dart index f7f6f122e..fa6fc9638 100644 --- a/pkgs/native_assets_builder/test/helpers.dart +++ b/pkgs/native_assets_builder/test/helpers.dart @@ -123,7 +123,8 @@ final pkgNativeAssetsBuilderUri = findPackageRoot('native_assets_builder'); final testDataUri = pkgNativeAssetsBuilderUri.resolve('test_data/'); -String unparseKey(String key) => key.replaceAll('.', '__').toUpperCase(); +String unparseKey(String key) => + 'DART_HOOK_TESTING_${key.replaceAll('.', '__').toUpperCase()}'; /// Archiver provided by the environment. /// diff --git a/pkgs/native_assets_cli/test/locking/locking_test.dart b/pkgs/native_assets_builder/test/locking/locking_test.dart similarity index 99% rename from pkgs/native_assets_cli/test/locking/locking_test.dart rename to pkgs/native_assets_builder/test/locking/locking_test.dart index ad85cba68..ecf89d5e3 100644 --- a/pkgs/native_assets_cli/test/locking/locking_test.dart +++ b/pkgs/native_assets_builder/test/locking/locking_test.dart @@ -14,6 +14,8 @@ import '../helpers.dart'; const Timeout longTimeout = Timeout(Duration(minutes: 5)); void main() async { + final packageUri = findPackageRoot('native_assets_builder'); + test('Concurrent invocations', timeout: longTimeout, () async { await inTempDir((tempUri) async { Future runInProcess() async { diff --git a/pkgs/native_assets_cli/test/locking/locking_test_helper.dart b/pkgs/native_assets_builder/test/locking/locking_test_helper.dart similarity index 91% rename from pkgs/native_assets_cli/test/locking/locking_test_helper.dart rename to pkgs/native_assets_builder/test/locking/locking_test_helper.dart index aacae4bc6..3fa8248c6 100644 --- a/pkgs/native_assets_cli/test/locking/locking_test_helper.dart +++ b/pkgs/native_assets_builder/test/locking/locking_test_helper.dart @@ -4,7 +4,7 @@ import 'dart:io'; -import 'package:native_assets_cli/locking.dart'; +import 'package:native_assets_builder/src/locking/locking.dart'; void main(List args) async { final directory = Directory.fromUri(Uri.directory(args[0])); diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index 6ac15ca3d..15352eae7 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -24,13 +24,18 @@ void main() async { test( 'native_dynamic_linking build$testSuffix', () => inTempDir((tempUri) async { + final outputDirectory = tempUri.resolve('out/'); + await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempUri.resolve('out_shared/'); + await Directory.fromUri(outputDirectoryShared).create(); final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); final testPackageUri = testDataUri.resolve('$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); final config = BuildConfigImpl( - outputDirectory: tempUri, + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: name, packageRoot: testPackageUri, targetOS: OSImpl.current, @@ -62,7 +67,7 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = tempUri.resolve('build_output.json'); + final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = HookOutputImpl.fromJsonString( await File.fromUri(buildOutputUri).readAsString()); final assets = buildOutput.assets; @@ -100,9 +105,12 @@ void main() async { environment: { // Add the directory containing the linked dynamic libraries to // the PATH so that the dynamic linker can find them. + // TODO(https://github.com/dart-lang/sdk/issues/56551): We could + // skip this if Dart would implicitly add dylib containing + // directories to the PATH. if (Platform.isWindows) - 'PATH': - '${tempUri.toFilePath()};${Platform.environment['PATH']}', + 'PATH': '${outputDirectory.toFilePath()};' + '${Platform.environment['PATH']}', }, throwOnUnexpectedExitCode: true, logger: logger, diff --git a/pkgs/native_assets_builder/test/test_data/transformer_test.dart b/pkgs/native_assets_builder/test/test_data/transformer_test.dart new file mode 100644 index 000000000..eae5cfc7b --- /dev/null +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -0,0 +1,132 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +@OnPlatform({ + 'mac-os': Timeout.factor(2), + 'windows': Timeout.factor(10), +}) +library; + +import 'dart:convert'; +import 'dart:io'; + +import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:native_assets_cli/native_assets_cli_internal.dart'; +import 'package:test/test.dart'; + +import '../build_runner/helpers.dart'; +import '../helpers.dart'; + +void main() async { + const packageName = 'transformer'; + + test( + 'transformer caching', + () => inTempDir((tempUri) async { + final packageUri = tempUri.resolve('$packageName/'); + await copyTestProjects( + sourceUri: testDataUri.resolve('$packageName/'), + targetUri: packageUri, + ); + + await runPubGet( + workingDirectory: packageUri, + logger: logger, + ); + + final outputDirectory = tempUri.resolve('out/'); + await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempUri.resolve('out_shared/'); + await Directory.fromUri(outputDirectoryShared).create(); + final testTempUri = tempUri.resolve('test1/'); + await Directory.fromUri(testTempUri).create(); + final dartUri = Uri.file(Platform.resolvedExecutable); + + late String stdout; + late HookOutputImpl output; + + Future runBuild(Architecture architecture) async { + final config = BuildConfigImpl( + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, + packageName: packageName, + packageRoot: packageUri, + targetOS: OSImpl.current, + version: HookConfigImpl.latestVersion, + linkModePreference: LinkModePreferenceImpl.dynamic, + dryRun: false, + linkingEnabled: false, + targetArchitecture: architecture as ArchitectureImpl, + buildMode: BuildModeImpl.debug, + supportedAssetTypes: [DataAsset.type], + ); + + final buildConfigUri = testTempUri.resolve('build_config.json'); + await File.fromUri(buildConfigUri) + .writeAsString(jsonEncode(config.toJson())); + + final processResult = await Process.run( + dartUri.toFilePath(), + [ + 'hook/build.dart', + '--config=${buildConfigUri.toFilePath()}', + ], + workingDirectory: packageUri.toFilePath(), + ); + if (processResult.exitCode != 0) { + print(processResult.stdout); + print(processResult.stderr); + print(processResult.exitCode); + } + expect(processResult.exitCode, 0); + stdout = processResult.stdout as String; + + final buildOutputUri = outputDirectory.resolve('build_output.json'); + output = HookOutputImpl.fromJsonString( + await File.fromUri(buildOutputUri).readAsString()); + } + + await runBuild(Architecture.x64); + expect( + stdout, + stringContainsInOrder([ + 'Transformed 10 files.', + 'Reused 0 cached files.', + ]), + ); + expect( + output.assets, + contains( + DataAsset( + file: outputDirectoryShared.resolve('data_transformed0.json'), + name: 'data_transformed0.json', + package: packageName, + ), + ), + ); + expect( + output.dependencies, + containsAll([ + packageUri.resolve('data/'), + packageUri.resolve('data/data0.json'), + ]), + ); + + await File.fromUri(packageUri.resolve('data/data0.json')).writeAsString( + jsonEncode({'foo': 'bar'}), + ); + + // Run the build for a different architecture. + // This should use the caching inside the hook. + await runBuild(Architecture.arm64); + expect( + stdout, + stringContainsInOrder([ + 'Transformed 1 files.', + 'Reused 9 cached files.', + ]), + ); + }), + ); +} diff --git a/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml index d73644401..af5048e88 100644 --- a/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml @@ -10,10 +10,10 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml index 7c3dc2cb9..d4445c879 100644 --- a/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: complex_link_helper: path: ../complex_link_helper/ logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml b/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml index 9d6a6c1f0..0a5355a85 100644 --- a/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: cli_config: ^0.2.0 logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml b/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml index ec76b0a39..6f446150c 100644 --- a/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: cyclic_package_2: path: ../cyclic_package_2 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml b/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml index 7dd179f65..08198d0eb 100644 --- a/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: cyclic_package_1: path: ../cyclic_package_1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/drop_dylib_link/lib/src/drop_dylib_link.dart b/pkgs/native_assets_builder/test_data/drop_dylib_link/lib/src/drop_dylib_link.dart index c71715c97..658b14b52 100644 --- a/pkgs/native_assets_builder/test_data/drop_dylib_link/lib/src/drop_dylib_link.dart +++ b/pkgs/native_assets_builder/test_data/drop_dylib_link/lib/src/drop_dylib_link.dart @@ -2,14 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - import 'drop_dylib_link_bindings.dart' as bindings; class MyMath { - @ResourceIdentifier('add') static int add(int a, int b) => bindings.add(a, b); - @ResourceIdentifier('multiply') static int multiply(int a, int b) => bindings.multiply(a, b); } diff --git a/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml index 0bfa7ccb5..1be5a388b 100644 --- a/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml @@ -9,11 +9,10 @@ environment: dependencies: logging: ^1.1.1 - meta: ^1.12.0 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml index 6724d21d3..e558494b3 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml index 90794c99e..87a430c9d 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: fail_on_os_sdk_version_linker: path: ../fail_on_os_sdk_version_linker/ - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml index ca1cc14fd..334c98891 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/manifest.yaml b/pkgs/native_assets_builder/test_data/manifest.yaml index fd8a5fa9c..6bcdcd32c 100644 --- a/pkgs/native_assets_builder/test_data/manifest.yaml +++ b/pkgs/native_assets_builder/test_data/manifest.yaml @@ -46,14 +46,6 @@ - fail_on_os_sdk_version_linker/pubspec.yaml - fail_on_os_sdk_version/hook/build.dart - fail_on_os_sdk_version/pubspec.yaml -- native_add_v1_0_0/build.dart -- native_add_v1_0_0/ffigen.yaml -- native_add_v1_0_0/lib/native_add.dart -- native_add_v1_0_0/lib/src/native_add_bindings_generated.dart -- native_add_v1_0_0/lib/src/native_add.dart -- native_add_v1_0_0/pubspec.yaml -- native_add_v1_0_0/src/native_add.c -- native_add_v1_0_0/src/native_add.h - native_add/ffigen.yaml - native_add/hook/build.dart - native_add/lib/native_add.dart @@ -99,6 +91,20 @@ - simple_data_asset/bin/deep_modify_data_asset.dart.debug - some_dev_dep/bin/some_dev_dep.dart - some_dev_dep/pubspec.yaml +- transformer/data/data0.json +- transformer/data/data1.json +- transformer/data/data2.json +- transformer/data/data3.json +- transformer/data/data4.json +- transformer/data/data5.json +- transformer/data/data6.json +- transformer/data/data7.json +- transformer/data/data8.json +- transformer/data/data9.json +- transformer/hook/build.dart +- transformer/lib/src/transform.dart +- transformer/tool/generate_data.dart +- transformer/pubspec.yaml - treeshaking_native_libs/pubspec.yaml - treeshaking_native_libs/lib/treeshaking_native_libs.dart - treeshaking_native_libs/lib/src/treeshaking_native_libs.dart diff --git a/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml index a57c6eed9..cfbd4ee50 100644 --- a/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml @@ -9,10 +9,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml index fdd489b14..5146e3c33 100644 --- a/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml @@ -9,10 +9,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/native_add_duplicate/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_add_duplicate/pubspec.yaml index 5cbba7125..3d23fbc22 100644 --- a/pkgs/native_assets_builder/test_data/native_add_duplicate/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_add_duplicate/pubspec.yaml @@ -11,10 +11,10 @@ dependencies: logging: ^1.1.1 native_add: path: ../native_add/ - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/build.dart b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/build.dart deleted file mode 100644 index bfc42ab1a..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/build.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:logging/logging.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; -import 'package:native_toolchain_c/native_toolchain_c.dart'; - -const packageName = 'native_add'; - -void main(List arguments) async { - final config = await BuildConfig.fromArgs(arguments); - final output = BuildOutput(); - final cbuilder = CBuilder.library( - name: packageName, - assetId: 'package/$packageName:src/${packageName}_bindings_generated.dart', - sources: [ - 'src/$packageName.c', - ], - dartBuildFiles: ['build.dart'], - ); - await cbuilder.run( - buildConfig: config, - buildOutput: output, - logger: Logger('') - ..level = Level.ALL - ..onRecord.listen((record) { - print('${record.level.name}: ${record.time}: ${record.message}'); - }), - ); - await output.writeToFile(outDir: config.outDir); -} diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/ffigen.yaml b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/ffigen.yaml deleted file mode 100644 index b8716bd2d..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/ffigen.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Run with `flutter pub run ffigen --config ffigen.yaml`. -name: NativeAddBindings -description: | - Bindings for `src/native_add.h`. - - Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`. -output: "lib/src/native_add_bindings_generated.dart" -headers: - entry-points: - - "src/native_add.h" - include-directives: - - "src/native_add.h" -preamble: | - // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file - // for details. All rights reserved. Use of this source code is governed by a - // BSD-style license that can be found in the LICENSE file. -comments: - style: any - length: full -ffi-native: diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/src/native_add.dart b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/src/native_add.dart deleted file mode 100644 index 9c8a43b9e..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/src/native_add.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'native_add_bindings_generated.dart' as bindings; - -int add(int a, int b) => bindings.add(a, b); diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/src/native_add_bindings_generated.dart b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/src/native_add_bindings_generated.dart deleted file mode 100644 index 4d1e803aa..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/lib/src/native_add_bindings_generated.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -// ignore_for_file: type=lint -import 'dart:ffi' as ffi; - -@ffi.Native(symbol: 'add') -external int add( - int a, - int b, -); diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/manifest.yaml b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/manifest.yaml deleted file mode 100644 index f55289629..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/manifest.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- build.dart -- ffigen.yaml -- lib/native_add.dart -- lib/src/native_add_bindings_generated.dart -- lib/src/native_add.dart -- pubspec.yaml -- src/native_add.c -- src/native_add.h diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/pubspec.yaml deleted file mode 100644 index 82473ed0f..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: native_add_v1_0_0 -description: Sums two numbers with native code. Uses an old version of the protocol -version: 0.1.0 - -publish_to: none - -environment: - sdk: '>=3.3.0 <4.0.0' - -dependencies: - logging: ^1.1.1 - native_assets_cli: ^0.3.0 - native_toolchain_c: ^0.3.0 - -dev_dependencies: - ffigen: ^8.0.2 - lints: ^3.0.0 - some_dev_dep: - path: ../some_dev_dep/ - test: ^1.23.1 diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/src/native_add.c b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/src/native_add.c deleted file mode 100644 index cf21076d1..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/src/native_add.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -#include "native_add.h" - -int32_t add(int32_t a, int32_t b) { - return a + b; -} diff --git a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/src/native_add.h b/pkgs/native_assets_builder/test_data/native_add_v1_0_0/src/native_add.h deleted file mode 100644 index 5824f98a7..000000000 --- a/pkgs/native_assets_builder/test_data/native_add_v1_0_0/src/native_add.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -#include - -#if _WIN32 -#define MYLIB_EXPORT __declspec(dllexport) -#else -#define MYLIB_EXPORT -#endif - -MYLIB_EXPORT int32_t add(int32_t a, int32_t b); diff --git a/pkgs/native_assets_builder/test_data/native_dynamic_linking/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_dynamic_linking/pubspec.yaml index b654820ba..e4ce60564 100644 --- a/pkgs/native_assets_builder/test_data/native_dynamic_linking/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_dynamic_linking/pubspec.yaml @@ -10,10 +10,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.1 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.2 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml index 6ce9a56df..7b55541b4 100644 --- a/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml @@ -9,10 +9,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml index 0aade4602..d92b70e32 100644 --- a/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml b/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml index 4e74cfa16..2b804d89f 100644 --- a/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ package_with_metadata: diff --git a/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml b/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml index 3719d79d6..6f45f62ce 100644 --- a/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml b/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml index fb939b97e..0e7baf732 100644 --- a/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml @@ -9,7 +9,7 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml index ee548f137..42efe06c5 100644 --- a/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: cli_config: ^0.2.0 logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data0.json b/pkgs/native_assets_builder/test_data/transformer/data/data0.json new file mode 100644 index 000000000..6ddd34dfe --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data0.json @@ -0,0 +1,3 @@ +{ + "some_data": 0 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data1.json b/pkgs/native_assets_builder/test_data/transformer/data/data1.json new file mode 100644 index 000000000..8dd184525 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data1.json @@ -0,0 +1,3 @@ +{ + "some_data": 1 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data2.json b/pkgs/native_assets_builder/test_data/transformer/data/data2.json new file mode 100644 index 000000000..2cde95d52 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data2.json @@ -0,0 +1,3 @@ +{ + "some_data": 2 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data3.json b/pkgs/native_assets_builder/test_data/transformer/data/data3.json new file mode 100644 index 000000000..36d4e05a1 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data3.json @@ -0,0 +1,3 @@ +{ + "some_data": 3 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data4.json b/pkgs/native_assets_builder/test_data/transformer/data/data4.json new file mode 100644 index 000000000..be3cb8da1 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data4.json @@ -0,0 +1,3 @@ +{ + "some_data": 4 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data5.json b/pkgs/native_assets_builder/test_data/transformer/data/data5.json new file mode 100644 index 000000000..1994bb266 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data5.json @@ -0,0 +1,3 @@ +{ + "some_data": 5 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data6.json b/pkgs/native_assets_builder/test_data/transformer/data/data6.json new file mode 100644 index 000000000..a78009fb9 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data6.json @@ -0,0 +1,3 @@ +{ + "some_data": 6 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data7.json b/pkgs/native_assets_builder/test_data/transformer/data/data7.json new file mode 100644 index 000000000..9af10bbe7 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data7.json @@ -0,0 +1,3 @@ +{ + "some_data": 7 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data8.json b/pkgs/native_assets_builder/test_data/transformer/data/data8.json new file mode 100644 index 000000000..6d1ba9bbc --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data8.json @@ -0,0 +1,3 @@ +{ + "some_data": 8 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/data/data9.json b/pkgs/native_assets_builder/test_data/transformer/data/data9.json new file mode 100644 index 000000000..4d1a16fdc --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/data/data9.json @@ -0,0 +1,3 @@ +{ + "some_data": 9 +} diff --git a/pkgs/native_assets_builder/test_data/transformer/hook/build.dart b/pkgs/native_assets_builder/test_data/transformer/hook/build.dart new file mode 100644 index 000000000..9b1f2308c --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/hook/build.dart @@ -0,0 +1,60 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:transformer/src/transform.dart'; + +void main(List arguments) async { + await build(arguments, (config, output) async { + final dataDirectory = + Directory.fromUri(config.packageRoot.resolve('data/')); + // If data are added, rerun hook. + output.addDependency(dataDirectory.uri); + + var transformedFiles = 0; + var cachedFiles = 0; + + await for (final sourceFile in dataDirectory.list()) { + if (sourceFile is! File) { + continue; + } + + final sourceName = + sourceFile.uri.pathSegments.lastWhere((e) => e.isNotEmpty); + final name = sourceName.replaceFirst('data', 'data_transformed'); + final targetFile = File.fromUri(config.outputDirectoryShared + .resolve(sourceName.replaceFirst('data', 'data_transformed'))); + + if (!config.dryRun) { + // TODO(dacoharkes): Timestamps are not enough for correct caching. + if (!await targetFile.exists() || + !(await sourceFile.lastModified()) + .isBefore(await targetFile.lastModified())) { + await transformFile(sourceFile, targetFile); + transformedFiles++; + } else { + cachedFiles++; + } + } + + output.addAsset( + DataAsset( + package: config.packageName, + name: name, + file: targetFile.uri, + ), + ); + output.addDependency( + sourceFile.uri, + ); + } + + if (!config.dryRun) { + print('Transformed $transformedFiles files.'); + print('Reused $cachedFiles cached files.'); + } + }); +} diff --git a/pkgs/native_assets_builder/test_data/transformer/lib/src/transform.dart b/pkgs/native_assets_builder/test_data/transformer/lib/src/transform.dart new file mode 100644 index 000000000..afa2314da --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/lib/src/transform.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; + +final _encoder = JsonEncoder.withIndent(' ' * 4); + +Future transformFile(File input, File output) async { + final inputContents = jsonDecode(await input.readAsString()); + final outputContents = { + 'Status': 'I have been transformed!', + 'original': inputContents, + }; + await output.writeAsString('${_encoder.convert(outputContents)}\n'); +} diff --git a/pkgs/native_assets_builder/test_data/transformer/manifest.yaml b/pkgs/native_assets_builder/test_data/transformer/manifest.yaml new file mode 100644 index 000000000..53c68965a --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/manifest.yaml @@ -0,0 +1,16 @@ +# The list of files to copy to a temporary folder to ensure running tests from +# a completely clean setup. +- data/data0.json +- data/data1.json +- data/data2.json +- data/data3.json +- data/data4.json +- data/data5.json +- data/data6.json +- data/data7.json +- data/data8.json +- data/data9.json +- hook/build.dart +- lib/src/transform.dart +- tool/generate_data.dart +- pubspec.yaml diff --git a/pkgs/native_assets_builder/test_data/transformer/pubspec.yaml b/pkgs/native_assets_builder/test_data/transformer/pubspec.yaml new file mode 100644 index 000000000..547239723 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/pubspec.yaml @@ -0,0 +1,16 @@ +name: transformer +description: Transforms assets, caches the transformation, and caches across build invocations. +version: 0.1.0 + +publish_to: none + +environment: + sdk: '>=3.3.0 <4.0.0' + +dependencies: + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + +dev_dependencies: + lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/transformer/tool/generate_data.dart b/pkgs/native_assets_builder/test_data/transformer/tool/generate_data.dart new file mode 100644 index 000000000..5c344af85 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/transformer/tool/generate_data.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; + +void main() async { + final packageRoot = Platform.script.resolve('../'); + final dataDirectory = packageRoot.resolve('data/'); + const numFiles = 10; + final encoder = JsonEncoder.withIndent(' ' * 4); + for (var i = 0; i < numFiles; i++) { + final file = File.fromUri(dataDirectory.resolve('data$i.json')); + await file.writeAsString('${encoder.convert({'some_data': i})}\n'); + } + print('Wrote $numFiles data files to ${dataDirectory.toFilePath()}.'); +} diff --git a/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml b/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml index 183b87a0f..33a0ab5bb 100644 --- a/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml @@ -9,10 +9,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml index 804fc82b7..f32c0f7a6 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml index f3ec03d23..56fa0ce8d 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml index 155307ff7..3b844805d 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/wrong_linker/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_linker/pubspec.yaml index b1556457b..8e85aeaea 100644 --- a/pkgs/native_assets_builder/test_data/wrong_linker/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_linker/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml index b1556457b..8e85aeaea 100644 --- a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../native_assets_cli/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index ee998a527..f04086cd1 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -1,4 +1,24 @@ -## 0.8.0-wip +## 0.9.0-wip + +- Add `BuildConfig` and `LinkConfig` `outputDirectoryShared`. +- Remove `package:native_assets_cli/locking.dart` with `runUnderDirectoryLock`. + Hook writers should not use this, the `native_assets_builder` does this. +- Fix example packages with RecordUse annotations + [#1586](https://github.com/dart-lang/native/issues/1586). +- Remove v1.0 / v1.1 related serialization +- Update SDK constraint to 3.5.0+ +- Remove (deprecated) support for accepting yaml as config +- Remove usage of `package:cli_config` and `package:args`: it minimizes + dependencies and it simplifies logic any hook has to do (as it no longer has + to look into environment variables, arguments and json file, determine which + has presence over other, etc) +- Use `DART_HOOK_TESTING` prefix for environment variables used for testing on + Dart CI +- No longer try to resolve uris encoded in `config.json` against any base uri. + The `hook/{build,link}.dart` invoker has to ensure the uris it encodes can be + opened as-is (i.e. without resolving against any base uri) + +## 0.8.0 - Add URI for the recorded usages file to the `LinkConfig`. - Added a validation step in the `build` and `link` methods. diff --git a/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml b/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml index 12892faf0..c8e0294fe 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml b/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml index b998d0a86..028679dcf 100644 --- a/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml @@ -10,10 +10,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../../native_assets_cli/ - # native_toolchain_c: ^0.5.3 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml b/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml index 2e599c209..eb41ecda8 100644 --- a/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml @@ -10,10 +10,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../../native_assets_cli/ - # native_toolchain_c: ^0.5.2 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml b/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml index f3b0d5cd3..0e4a736dc 100644 --- a/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml @@ -9,10 +9,10 @@ environment: dependencies: logging: ^1.1.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../../native_assets_cli/ - # native_toolchain_c: ^0.5.2 + # native_toolchain_c: ^0.5.4 native_toolchain_c: path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_cli/example/link/package_with_assets/hook/link.dart b/pkgs/native_assets_cli/example/link/package_with_assets/hook/link.dart index 7c81e64d1..a5cd73bfc 100644 --- a/pkgs/native_assets_cli/example/link/package_with_assets/hook/link.dart +++ b/pkgs/native_assets_cli/example/link/package_with_assets/hook/link.dart @@ -2,12 +2,36 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:convert'; +import 'dart:io'; + import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:record_use/record_use.dart'; + +const multiplyIdentifier = Identifier( + importUri: 'package:package_with_assets/package_with_assets.dart', + name: 'AssetUsed', +); void main(List args) async { await link(args, (config, output) async { - //TODO: Add tree shaking by reading the resources.json produced by the SDK. - final dataAssets = config.assets.whereType(); - output.addAssets(dataAssets); + final usages = config.usages; + + final usedAssets = (usages.instancesOf(multiplyIdentifier) ?? []).map((e) => + (e.instanceConstant.fields.values.first as StringConstant).value); + + output.addAssets(config.assets + .whereType() + .where((asset) => usedAssets.contains(asset.name))); }); } + +extension on LinkConfig { + RecordedUsages get usages { + final usagesFile = recordedUsagesFile; + final usagesContent = File.fromUri(usagesFile!).readAsStringSync(); + final usagesJson = jsonDecode(usagesContent) as Map; + final usages = RecordedUsages.fromJson(usagesJson); + return usages; + } +} diff --git a/pkgs/native_assets_cli/example/link/package_with_assets/lib/package_with_assets.dart b/pkgs/native_assets_cli/example/link/package_with_assets/lib/package_with_assets.dart index 1fb4ea06c..8c3cc35fd 100644 --- a/pkgs/native_assets_cli/example/link/package_with_assets/lib/package_with_assets.dart +++ b/pkgs/native_assets_cli/example/link/package_with_assets/lib/package_with_assets.dart @@ -6,8 +6,15 @@ import 'package:meta/meta.dart'; //TODO: Actually use the assets, needs the AssetBundle interface for Dart. See //also https://github.com/dart-lang/sdk/issues/54003. -@ResourceIdentifier('assets/used_asset.json') +@AssetUsed('assets/used_asset.json') String someMethod() => 'Using used_asset'; -@ResourceIdentifier('assets/unused_asset.json') +@AssetUsed('assets/unused_asset.json') String someOtherMethod() => 'Using unused_asset'; + +@RecordUse() +class AssetUsed { + final String assetName; + + const AssetUsed(this.assetName); +} diff --git a/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml b/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml index e41d75ac0..0fa10dd1b 100644 --- a/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml +++ b/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml @@ -1,7 +1,7 @@ publish_to: none name: package_with_assets -description: A starting point for Dart libraries or applications. +description: An example of using a package with assets. version: 1.0.0 # repository: https://github.com/my_org/my_repo @@ -11,9 +11,10 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../../../../native_assets_cli/ + record_use: ^0.3.0 dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_cli/lib/locking.dart b/pkgs/native_assets_cli/lib/locking.dart deleted file mode 100644 index 2db664603..000000000 --- a/pkgs/native_assets_cli/lib/locking.dart +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -/// A library that contains helpers for running hooks concurrently. -library; - -export 'src/locking/locking.dart' show runUnderDirectoryLock; diff --git a/pkgs/native_assets_cli/lib/src/api/asset.dart b/pkgs/native_assets_cli/lib/src/api/asset.dart index 96c47e2df..79dbf3041 100644 --- a/pkgs/native_assets_cli/lib/src/api/asset.dart +++ b/pkgs/native_assets_cli/lib/src/api/asset.dart @@ -4,7 +4,6 @@ import 'package:pub_semver/pub_semver.dart'; -import '../model/target.dart'; import '../utils/json.dart'; import '../utils/map.dart'; import 'architecture.dart'; diff --git a/pkgs/native_assets_cli/lib/src/api/build_config.dart b/pkgs/native_assets_cli/lib/src/api/build_config.dart index 7fe7c16b9..ff0401eb6 100644 --- a/pkgs/native_assets_cli/lib/src/api/build_config.dart +++ b/pkgs/native_assets_cli/lib/src/api/build_config.dart @@ -2,12 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:convert'; import 'dart:io'; -import 'package:cli_config/cli_config.dart'; import 'package:collection/collection.dart'; import 'package:pub_semver/pub_semver.dart'; +import '../args_parser.dart'; +import '../json_utils.dart'; import '../model/hook.dart'; import '../model/metadata.dart'; import '../utils/json.dart'; @@ -112,6 +114,7 @@ abstract final class BuildConfig implements HookConfig { /// parameters in [metadatum]. factory BuildConfig.build({ required Uri outputDirectory, + required Uri outputDirectoryShared, required String packageName, required Uri packageRoot, required BuildMode buildMode, @@ -130,6 +133,7 @@ abstract final class BuildConfig implements HookConfig { }) => BuildConfigImpl( outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRoot, buildMode: buildMode as BuildModeImpl, @@ -160,6 +164,7 @@ abstract final class BuildConfig implements HookConfig { /// For the documentation of the parameters, see the equally named fields. factory BuildConfig.dryRun({ required Uri outputDirectory, + required Uri outputDirectoryShared, required String packageName, required Uri packageRoot, required OS targetOS, @@ -169,6 +174,7 @@ abstract final class BuildConfig implements HookConfig { }) => BuildConfigImpl.dryRun( outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRoot, targetOS: targetOS as OSImpl, diff --git a/pkgs/native_assets_cli/lib/src/api/build_output.dart b/pkgs/native_assets_cli/lib/src/api/build_output.dart index a8aa084b9..66b97e4e5 100644 --- a/pkgs/native_assets_cli/lib/src/api/build_output.dart +++ b/pkgs/native_assets_cli/lib/src/api/build_output.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:collection/collection.dart'; import 'package:pub_semver/pub_semver.dart'; -import 'package:yaml/yaml.dart' show loadYaml; import '../model/dependencies.dart'; import '../model/metadata.dart'; diff --git a/pkgs/native_assets_cli/lib/src/api/hook_config.dart b/pkgs/native_assets_cli/lib/src/api/hook_config.dart index 076741267..f05b8d748 100644 --- a/pkgs/native_assets_cli/lib/src/api/hook_config.dart +++ b/pkgs/native_assets_cli/lib/src/api/hook_config.dart @@ -3,12 +3,13 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:convert'; +import 'dart:io'; -import 'package:cli_config/cli_config.dart'; import 'package:collection/collection.dart'; import 'package:crypto/crypto.dart'; import 'package:pub_semver/pub_semver.dart'; +import '../json_utils.dart'; import '../model/hook.dart'; import '../model/metadata.dart'; import '../model/target.dart'; @@ -21,7 +22,6 @@ import 'ios_sdk.dart'; import 'link_config.dart'; import 'link_mode_preference.dart'; import 'os.dart'; - part '../model/hook_config.dart'; /// The shared properties of a [LinkConfig] and a [BuildConfig]. @@ -29,10 +29,30 @@ part '../model/hook_config.dart'; /// This abstraction makes it easier to design APIs intended for both kinds of /// build hooks, building and linking. abstract class HookConfig { - /// The directory in which all output and intermediate artifacts should be - /// placed. + /// The directory in which output and intermediate artifacts that are unique + /// to this configuration can be placed. + /// + /// This directory is unique per hook and per configuration. + /// + /// The contents of this directory will not be modified by anything else than + /// the hook itself. + /// + /// The invoker of the the hook will ensure concurrent invocations wait on + /// each other. Uri get outputDirectory; + /// The directory in which shared output and intermediate artifacts can be + /// placed. + /// + /// This directory is unique per hook. + /// + /// The contents of this directory will not be modified by anything else than + /// the hook itself. + /// + /// The invoker of the the hook will ensure concurrent invocations wait on + /// each other. + Uri get outputDirectoryShared; + /// The name of the package the assets are built for. String get packageName; diff --git a/pkgs/native_assets_cli/lib/src/api/link_config.dart b/pkgs/native_assets_cli/lib/src/api/link_config.dart index 612de3688..e3897bd01 100644 --- a/pkgs/native_assets_cli/lib/src/api/link_config.dart +++ b/pkgs/native_assets_cli/lib/src/api/link_config.dart @@ -4,12 +4,12 @@ import 'dart:convert'; import 'dart:io'; -import 'package:args/args.dart'; -import 'package:cli_config/cli_config.dart'; import 'package:collection/collection.dart'; import 'package:meta/meta.dart'; import 'package:pub_semver/pub_semver.dart'; +import '../args_parser.dart'; +import '../json_utils.dart'; import '../model/hook.dart'; import '../utils/map.dart'; import 'architecture.dart'; @@ -44,6 +44,7 @@ abstract class LinkConfig implements HookConfig { factory LinkConfig.build({ required Uri outputDirectory, + required Uri outputDirectoryShared, required String packageName, required Uri packageRoot, Architecture? targetArchitecture, @@ -63,6 +64,7 @@ abstract class LinkConfig implements HookConfig { LinkConfigImpl( assets: assets.cast(), outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRoot, buildMode: buildMode as BuildModeImpl, @@ -81,6 +83,7 @@ abstract class LinkConfig implements HookConfig { factory LinkConfig.dryRun({ required Uri outputDirectory, + required Uri outputDirectoryShared, required String packageName, required Uri packageRoot, required OS targetOS, @@ -92,6 +95,7 @@ abstract class LinkConfig implements HookConfig { LinkConfigImpl.dryRun( assets: assets.cast(), outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRoot, targetOS: targetOS as OSImpl, diff --git a/pkgs/native_assets_cli/lib/src/api/test.dart b/pkgs/native_assets_cli/lib/src/api/test.dart index 4ffca5ed1..e4b25c2d5 100644 --- a/pkgs/native_assets_cli/lib/src/api/test.dart +++ b/pkgs/native_assets_cli/lib/src/api/test.dart @@ -42,9 +42,12 @@ Future testBuildHook({ final outputDirectory = tempDir.resolve('output/'); await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempDir.resolve('output_shared/'); + await Directory.fromUri(outputDirectory).create(); final buildConfig = BuildConfig.build( outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: await _packageName(), packageRoot: Directory.current.uri, buildMode: buildMode ?? BuildMode.release, diff --git a/pkgs/native_assets_cli/lib/src/args_parser.dart b/pkgs/native_assets_cli/lib/src/args_parser.dart new file mode 100644 index 000000000..942b3a6d4 --- /dev/null +++ b/pkgs/native_assets_cli/lib/src/args_parser.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +String getConfigArgument(List arguments) { + for (var i = 0; i < arguments.length; ++i) { + final argument = arguments[i]; + if (argument.startsWith('--config=')) { + return argument.substring('--config='.length); + } + if (argument == '--config') { + if ((i + 1) < arguments.length) { + return arguments[i + 1]; + } + } + } + throw StateError('No --config argument given.'); +} diff --git a/pkgs/native_assets_cli/lib/src/json_utils.dart b/pkgs/native_assets_cli/lib/src/json_utils.dart new file mode 100644 index 000000000..e64be65f7 --- /dev/null +++ b/pkgs/native_assets_cli/lib/src/json_utils.dart @@ -0,0 +1,90 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:core'; +import 'dart:core' as core; +import 'dart:io'; + +extension JsonUtils on Map { + String string(String key, {Iterable? validValues}) { + final value = get(key); + if (validValues != null && !validValues.contains(value)) { + throw FormatException('Json "$key" had value $value but expected one of ' + '${validValues.join(',')}'); + } + return value; + } + + String? optionalString(String key) => getOptional(key); + + bool? optionalBool(String key) => getOptional(key); + core.int int(String key) => get(key); + core.int? optionalInt(String key) => getOptional(key); + + Uri path(String key, {bool mustExist = false}) => + _fileSystemPathToUri(get(key)); + + Uri? optionalPath(String key, {bool mustExist = false}) { + final value = getOptional(key); + if (value == null) return null; + final uri = _fileSystemPathToUri(value); + if (mustExist) { + _throwIfNotExists(key, uri); + } + return uri; + } + + List? optionalStringList(String key) { + final value = getOptional>(key); + if (value == null) return null; + return value.cast(); + } + + List list(String key) => get>(key); + List? optionalList(String key) => getOptional>(key); + Map? optionalMap(String key) => + getOptional>(key); + + T get(String key) { + final value = this[key]; + if (value == null) { + throw FormatException('No value was provided for required key: $key'); + } + if (value is T) return value; + throw FormatException( + 'Unexpected value \'$value\' for key \'.$key\' in config file. ' + 'Expected a $T.'); + } + + T? getOptional(String key) { + final value = this[key]; + if (value is T?) return value; + throw FormatException( + 'Unexpected value \'$value\' for key \'.$key\' in config file. ' + 'Expected a $T?.'); + } +} + +void _throwIfNotExists(String key, Uri value) { + final fileSystemEntity = value.fileSystemEntity; + if (!fileSystemEntity.existsSync()) { + throw FormatException("Path '$value' for key '$key' doesn't exist."); + } +} + +extension on Uri { + FileSystemEntity get fileSystemEntity { + if (path.endsWith(Platform.pathSeparator) || path.endsWith('/')) { + return Directory.fromUri(this); + } + return File.fromUri(this); + } +} + +Uri _fileSystemPathToUri(String path) { + if (path.endsWith(Platform.pathSeparator)) { + return Uri.directory(path); + } + return Uri.file(path); +} diff --git a/pkgs/native_assets_cli/lib/src/model/asset.dart b/pkgs/native_assets_cli/lib/src/model/asset.dart index 0c98f3b07..62e50308a 100644 --- a/pkgs/native_assets_cli/lib/src/model/asset.dart +++ b/pkgs/native_assets_cli/lib/src/model/asset.dart @@ -15,7 +15,6 @@ abstract final class AssetImpl implements Asset { final type = jsonMap[NativeCodeAssetImpl.typeKey]; switch (type) { case NativeCodeAsset.type: - case null: // Backwards compatibility with v1.0.0. assets.add(NativeCodeAssetImpl.fromJson(jsonMap)); case DataAsset.type: assets.add(DataAssetImpl.fromJson(jsonMap)); diff --git a/pkgs/native_assets_cli/lib/src/model/build_config.dart b/pkgs/native_assets_cli/lib/src/model/build_config.dart index 489417740..211613b6b 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_config.dart +++ b/pkgs/native_assets_cli/lib/src/model/build_config.dart @@ -20,11 +20,7 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { } @override - String get outputName => - version > Version(1, 1, 0) ? 'build_output.json' : outputNameV1_1_0; - - @override - String get outputNameV1_1_0 => 'build_output.yaml'; + String get outputName => 'build_output.json'; @override Object? metadatum(String packageName, String key) { @@ -36,9 +32,6 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { @override bool get linkingEnabled { - if (version <= Version(1, 2, 0)) { - return false; - } if (version == Version(1, 3, 0)) { return true; } @@ -54,6 +47,7 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { BuildConfigImpl({ required super.outputDirectory, + required super.outputDirectoryShared, required super.packageName, required super.packageRoot, Version? version, @@ -87,6 +81,7 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { BuildConfigImpl.dryRun({ required super.outputDirectory, + required super.outputDirectoryShared, required super.packageName, required super.packageRoot, required super.targetOS, @@ -102,34 +97,29 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { _supportedAssetTypesBackwardsCompatibility(supportedAssetTypes), ); - factory BuildConfigImpl._fromConfig(Config config) => - _readFieldsFromConfig(config); - static BuildConfigImpl fromArguments( - List args, { + List arguments, { Map? environment, Uri? workingDirectory, }) { - // TODO(https://github.com/dart-lang/native/issues/1000): At some point, - // migrate away from package:cli_config, to get rid of package:yaml - // dependency. - final config = Config.fromArgumentsSync( - arguments: args, - environment: environment, - workingDirectory: workingDirectory, - ); - return BuildConfigImpl._fromConfig(config); + final configPath = getConfigArgument(arguments); + final bytes = File(configPath).readAsBytesSync(); + final linkConfigJson = const Utf8Decoder() + .fuse(const JsonDecoder()) + .convert(bytes) as Map; + return fromJson(linkConfigJson); } static const dependencyMetadataConfigKey = 'dependency_metadata'; static const linkingEnabledKey = 'linking_enabled'; - static BuildConfigImpl _readFieldsFromConfig(Config config) { + static BuildConfigImpl fromJson(Map config) { final dryRun = HookConfigImpl.parseDryRun(config) ?? false; final targetOS = HookConfigImpl.parseTargetOS(config); return BuildConfigImpl( outputDirectory: HookConfigImpl.parseOutDir(config), + outputDirectoryShared: HookConfigImpl.parseOutDirShared(config), packageName: HookConfigImpl.parsePackageName(config), packageRoot: HookConfigImpl.parsePackageRoot(config), buildMode: HookConfigImpl.parseBuildMode(config, dryRun), @@ -153,9 +143,9 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { ); } - static Map? parseDependencyMetadata(Config config) { - final fileValue = - config.valueOf?>(dependencyMetadataConfigKey); + static Map? parseDependencyMetadata( + Map config) { + final fileValue = config.optionalMap(dependencyMetadataConfigKey); if (fileValue == null) { return null; } @@ -178,12 +168,9 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig { ).sortOnKey(); } - static bool? parseHasLinkPhase(Config config) => + static bool? parseHasLinkPhase(Map config) => config.optionalBool(linkingEnabledKey); - static BuildConfigImpl fromJson(Map buildConfigJson) => - BuildConfigImpl._fromConfig(Config(fileParsed: buildConfigJson)); - @override Map toJson() => { ...hookToJson(), diff --git a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md index 0e4fce0d5..f3126361e 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md +++ b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.6.0 + +- `BuildConfig.outputDirectoryShared` for sharing between hook invocations. + Compatibility with older SDKs: Create a sibling dir next to the output + directory. This does not facilitate caching, but should not break the hook. + Compatibility with older hooks: These will not read this field. + ## 1.5.0 - No changes, but rev version due to BuildOutput change. diff --git a/pkgs/native_assets_cli/lib/src/model/build_output_CHANGELOG.md b/pkgs/native_assets_cli/lib/src/model/build_output_CHANGELOG.md index 4d825e062..43daa84e6 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_output_CHANGELOG.md +++ b/pkgs/native_assets_cli/lib/src/model/build_output_CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.6.0 + +- No changes, but rev version due to BuildConfig change. + ## 1.5.0 - BuildOutput.dependencies no longer have to list Dart dependencies. diff --git a/pkgs/native_assets_cli/lib/src/model/data_asset.dart b/pkgs/native_assets_cli/lib/src/model/data_asset.dart index 9a05e7c97..6c298147d 100644 --- a/pkgs/native_assets_cli/lib/src/model/data_asset.dart +++ b/pkgs/native_assets_cli/lib/src/model/data_asset.dart @@ -35,14 +35,16 @@ final class DataAssetImpl implements DataAsset, AssetImpl { if (other is! DataAssetImpl) { return false; } - return other.package == package && other.file == file && other.name == name; + return other.package == package && + other.file.toFilePath() == file.toFilePath() && + other.name == name; } @override int get hashCode => Object.hash( package, name, - file, + file.toFilePath(), ); @override diff --git a/pkgs/native_assets_cli/lib/src/model/hook_config.dart b/pkgs/native_assets_cli/lib/src/model/hook_config.dart index f6ce8a1c6..f67ce2513 100644 --- a/pkgs/native_assets_cli/lib/src/model/hook_config.dart +++ b/pkgs/native_assets_cli/lib/src/model/hook_config.dart @@ -7,11 +7,12 @@ part of '../api/hook_config.dart'; abstract class HookConfigImpl implements HookConfig { final Hook hook; - /// The folder in which all output and intermediate artifacts should be - /// placed. @override final Uri outputDirectory; + @override + final Uri outputDirectoryShared; + @override final String packageName; @@ -103,15 +104,10 @@ abstract class HookConfigImpl implements HookConfig { /// Makes newer build hooks work with older Dart SDKs. String get outputName; - /// Legacy output file name. - /// - /// Older build hooks output a yaml file, ignoring the newer protocol version - /// in the config. - String? get outputNameV1_1_0; - HookConfigImpl({ required this.hook, required this.outputDirectory, + required this.outputDirectoryShared, required this.packageName, required this.packageRoot, required this.version, @@ -137,6 +133,7 @@ abstract class HookConfigImpl implements HookConfig { HookConfigImpl.dryRun({ required this.hook, required this.outputDirectory, + required this.outputDirectoryShared, required this.packageName, required this.packageRoot, required this.version, @@ -154,10 +151,6 @@ abstract class HookConfigImpl implements HookConfig { Uri get outputFile => outputDirectory.resolve(outputName); - Uri? get outputFileV1_1_0 => outputNameV1_1_0 == null - ? null - : outputDirectory.resolve(outputNameV1_1_0!); - // This is currently overriden by [BuildConfig], do account for older versions // still using a top-level build.dart. Uri get script => packageRoot.resolve('hook/').resolve(hook.scriptName); @@ -165,6 +158,7 @@ abstract class HookConfigImpl implements HookConfig { String toJsonString() => const JsonEncoder.withIndent(' ').convert(toJson()); static const outDirConfigKey = 'out_dir'; + static const outDirSharedConfigKey = 'out_dir_shared'; static const packageNameConfigKey = 'package_name'; static const packageRootConfigKey = 'package_root'; static const _versionKey = 'version'; @@ -184,6 +178,7 @@ abstract class HookConfigImpl implements HookConfig { return { outDirConfigKey: outputDirectory.toFilePath(), + outDirSharedConfigKey: outputDirectoryShared.toFilePath(), packageNameConfigKey: packageName, packageRootConfigKey: packageRoot.toFilePath(), OSImpl.configKey: targetOS.toString(), @@ -209,7 +204,7 @@ abstract class HookConfigImpl implements HookConfig { }.sortOnKey(); } - static Version parseVersion(Config config) { + static Version parseVersion(Map config) { final version = Version.parse(config.string('version')); if (version.major > latestVersion.major) { throw FormatException( @@ -228,19 +223,35 @@ abstract class HookConfigImpl implements HookConfig { return version; } - static bool? parseDryRun(Config config) => + static bool? parseDryRun(Map config) => config.optionalBool(dryRunConfigKey); - static Uri parseOutDir(Config config) => + static Uri parseOutDir(Map config) => config.path(outDirConfigKey, mustExist: true); - static String parsePackageName(Config config) => + static Uri parseOutDirShared(Map config) { + final configResult = + config.optionalPath(outDirSharedConfigKey, mustExist: true); + if (configResult != null) { + return configResult; + } + // Backwards compatibility, create a directory next to the output dir. + // This is will not be shared so caching doesn't work, but it will make + // the newer hooks not crash. + final outDir = config.path(outDirConfigKey); + final outDirShared = outDir.resolve('../out_shared/'); + Directory.fromUri(outDirShared).createSync(); + return outDirShared; + } + + static String parsePackageName(Map config) => config.string(packageNameConfigKey); - static Uri parsePackageRoot(Config config) => + static Uri parsePackageRoot(Map config) => config.path(packageRootConfigKey, mustExist: true); - static BuildModeImpl? parseBuildMode(Config config, bool dryRun) { + static BuildModeImpl? parseBuildMode( + Map config, bool dryRun) { if (dryRun) { _throwIfNotNullInDryRun(config, BuildModeImpl.configKey); return null; @@ -254,7 +265,8 @@ abstract class HookConfigImpl implements HookConfig { } } - static LinkModePreferenceImpl parseLinkModePreference(Config config) => + static LinkModePreferenceImpl parseLinkModePreference( + Map config) => LinkModePreferenceImpl.fromString( config.string( LinkModePreferenceImpl.configKey, @@ -262,7 +274,7 @@ abstract class HookConfigImpl implements HookConfig { ), ); - static OSImpl parseTargetOS(Config config) => OSImpl.fromString( + static OSImpl parseTargetOS(Map config) => OSImpl.fromString( config.string( OSImpl.configKey, validValues: OSImpl.values.map((e) => '$e'), @@ -270,7 +282,7 @@ abstract class HookConfigImpl implements HookConfig { ); static ArchitectureImpl? parseTargetArchitecture( - Config config, + Map config, bool dryRun, OSImpl? targetOS, ) { @@ -295,7 +307,7 @@ abstract class HookConfigImpl implements HookConfig { } static IOSSdkImpl? parseTargetIOSSdk( - Config config, bool dryRun, OSImpl? targetOS) { + Map config, bool dryRun, OSImpl? targetOS) { if (dryRun) { _throwIfNotNullInDryRun(config, IOSSdkImpl.configKey); return null; @@ -312,7 +324,7 @@ abstract class HookConfigImpl implements HookConfig { } static int? parseTargetAndroidNdkApi( - Config config, + Map config, bool dryRun, OSImpl? targetOS, ) { @@ -327,7 +339,7 @@ abstract class HookConfigImpl implements HookConfig { } static int? parseTargetIosVersion( - Config config, + Map config, bool dryRun, OSImpl? targetOS, ) { @@ -342,7 +354,7 @@ abstract class HookConfigImpl implements HookConfig { } static int? parseTargetMacOSVersion( - Config config, + Map config, bool dryRun, OSImpl? targetOS, ) { @@ -356,84 +368,58 @@ abstract class HookConfigImpl implements HookConfig { } } - static Uri? _parseArchiver(Config config, bool dryRun) { - if (dryRun) { - _throwIfNotNullInDryRun(config, CCompilerConfigImpl.arConfigKeyFull); - return null; - } else { - return config.optionalPath( - CCompilerConfigImpl.arConfigKeyFull, + static Uri? _parseArchiver(Map config) => + config.optionalPath( + CCompilerConfigImpl.arConfigKey, mustExist: true, ); - } - } - static Uri? _parseCompiler(Config config, bool dryRun) { - if (dryRun) { - _throwIfNotNullInDryRun(config, CCompilerConfigImpl.ccConfigKeyFull); - return null; - } else { - return config.optionalPath( - CCompilerConfigImpl.ccConfigKeyFull, + static Uri? _parseCompiler(Map config) => + config.optionalPath( + CCompilerConfigImpl.ccConfigKey, mustExist: true, ); - } - } - static Uri? _parseLinker(Config config, bool dryRun) { - if (dryRun) { - _throwIfNotNullInDryRun(config, CCompilerConfigImpl.ccConfigKeyFull); - return null; - } else { - return config.optionalPath( - CCompilerConfigImpl.ldConfigKeyFull, + static Uri? _parseLinker(Map config) => config.optionalPath( + CCompilerConfigImpl.ldConfigKey, mustExist: true, ); - } - } - static Uri? _parseEnvScript(Config config, bool dryRun, Uri? compiler) { - if (dryRun) { - _throwIfNotNullInDryRun(config, CCompilerConfigImpl.ccConfigKeyFull); - return null; - } else { - return (compiler != null && compiler.toFilePath().endsWith('cl.exe')) - ? config.path(CCompilerConfigImpl.envScriptConfigKeyFull, - mustExist: true) + static Uri? _parseEnvScript(Map config, Uri? compiler) => + (compiler != null && compiler.toFilePath().endsWith('cl.exe')) + ? config.path(CCompilerConfigImpl.envScriptConfigKey, mustExist: true) : null; - } - } - static List? _parseEnvScriptArgs(Config config, bool dryRun) { - if (dryRun) { - _throwIfNotNullInDryRun(config, CCompilerConfigImpl.ccConfigKeyFull); - return null; - } else { - return config.optionalStringList( - CCompilerConfigImpl.envScriptArgsConfigKeyFull, - splitEnvironmentPattern: ' ', - ); - } - } + static List? _parseEnvScriptArgs(Map config) => + config.optionalStringList(CCompilerConfigImpl.envScriptArgsConfigKey); - static List parseSupportedAssetTypes(Config config) => + static List parseSupportedAssetTypes(Map config) => config.optionalStringList(supportedAssetTypesKey) ?? [NativeCodeAsset.type]; - static CCompilerConfigImpl parseCCompiler(Config config, bool dryRun) { - final parseCompiler = _parseCompiler(config, dryRun); - final cCompiler = CCompilerConfigImpl( - archiver: _parseArchiver(config, dryRun), - compiler: parseCompiler, - envScript: _parseEnvScript(config, dryRun, parseCompiler), - envScriptArgs: _parseEnvScriptArgs(config, dryRun), - linker: _parseLinker(config, dryRun), + static CCompilerConfigImpl parseCCompiler( + Map config, bool dryRun) { + if (dryRun) { + _throwIfNotNullInDryRun(config, CCompilerConfigImpl.configKey); + } + + final cCompilerJson = + config.getOptional>(CCompilerConfigImpl.configKey); + if (cCompilerJson == null) return CCompilerConfigImpl(); + + final compiler = _parseCompiler(cCompilerJson); + return CCompilerConfigImpl( + archiver: _parseArchiver(cCompilerJson), + compiler: compiler, + envScript: _parseEnvScript(cCompilerJson, compiler), + envScriptArgs: _parseEnvScriptArgs(cCompilerJson), + linker: _parseLinker(cCompilerJson), ); - return cCompiler; } - static void _throwIfNotNullInDryRun(Config config, String key) { - final object = config.valueOf(key); + static void _throwIfNotNullInDryRun( + Map config, String key) { + final object = config.getOptional(key); if (object != null) { throw const FormatException('''This field is not available in dry runs. In Flutter projects, native builds are generated per OS which target multiple @@ -457,13 +443,16 @@ can _only_ depend on OS.'''); return false; } if (other.outputDirectory != outputDirectory) return false; + if (other.outputDirectoryShared != outputDirectoryShared) return false; if (other.packageName != packageName) return false; if (other.packageRoot != packageRoot) return false; if (other.dryRun != dryRun) return false; if (other.targetOS != targetOS) return false; if (other.linkModePreference != linkModePreference) return false; if (!const DeepCollectionEquality() - .equals(other.supportedAssetTypes, supportedAssetTypes)) return false; + .equals(other.supportedAssetTypes, supportedAssetTypes)) { + return false; + } if (!dryRun) { if (other.buildMode != buildMode) return false; if (other.targetArchitecture != targetArchitecture) return false; @@ -479,6 +468,7 @@ can _only_ depend on OS.'''); @override int get hashCode => Object.hashAll([ outputDirectory, + outputDirectoryShared, packageName, packageRoot, targetOS, diff --git a/pkgs/native_assets_cli/lib/src/model/hook_output.dart b/pkgs/native_assets_cli/lib/src/model/hook_output.dart index a5bf5982b..a87a85be2 100644 --- a/pkgs/native_assets_cli/lib/src/model/hook_output.dart +++ b/pkgs/native_assets_cli/lib/src/model/hook_output.dart @@ -59,15 +59,8 @@ final class HookOutputImpl implements BuildOutput, LinkOutput { static const _versionKey = 'version'; factory HookOutputImpl.fromJsonString(String jsonString) { - final Object? json; - if (jsonString.startsWith('{')) { - json = jsonDecode(jsonString); - } else { - // TODO(https://github.com/dart-lang/native/issues/1000): At some point - // remove the YAML fallback. - json = loadYaml(jsonString); - } - return HookOutputImpl.fromJson(as>(json)); + final Object? json = jsonDecode(jsonString); + return HookOutputImpl.fromJson(as>(json)); } factory HookOutputImpl.fromJson(Map jsonMap) { @@ -89,7 +82,7 @@ final class HookOutputImpl implements BuildOutput, LinkOutput { return HookOutputImpl( timestamp: DateTime.parse(get(jsonMap, _timestampKey)), assets: AssetImpl.listFromJson(get?>(jsonMap, _assetsKey)), - assetsForLinking: get?>( + assetsForLinking: get?>( jsonMap, _assetsForLinkingKey) ?.map((packageName, assets) => MapEntry( packageName, AssetImpl.listFromJson(as>(assets)))), @@ -100,48 +93,21 @@ final class HookOutputImpl implements BuildOutput, LinkOutput { ); } - Map toJson(Version version) { - final assets = []; - for (final asset in _assets) { - switch (asset) { - case NativeCodeAssetImpl _: - if (version <= Version(1, 0, 0) && asset.architecture == null) { - // Dry run does not report architecture. But old Dart and Flutter - // expect architecture to be populated. So, populate assets for all - // architectures. - for (final architecture in asset.os.architectures) { - assets.add(asset.copyWith( - architecture: architecture, - )); - } - } else { - assets.add(asset); - } - default: - assets.add(asset); - } - } - final linkMinVersion = Version(1, 3, 0); - if (_assetsForLinking.isNotEmpty && version < linkMinVersion) { - throw UnsupportedError('Please update your Dart or Flutter SDK to link ' - 'assets in `link.dart` scripts. Your current version is $version, ' - 'but this feature requires $linkMinVersion'); - } - return { - _timestampKey: timestamp.toString(), - if (assets.isNotEmpty) _assetsKey: AssetImpl.listToJson(assets, version), - if (version >= linkMinVersion && _assetsForLinking.isNotEmpty) - _assetsForLinkingKey: - _assetsForLinking.map((packageName, assets) => MapEntry( - packageName, - AssetImpl.listToJson(assets, version), - )), - if (_dependencies.dependencies.isNotEmpty) - _dependenciesKey: _dependencies.toJson(), - if (metadata.metadata.isNotEmpty) _metadataKey: metadata.toJson(), - _versionKey: version.toString(), - }..sortOnKey(); - } + Map toJson(Version version) => { + _timestampKey: timestamp.toString(), + if (_assets.isNotEmpty) + _assetsKey: AssetImpl.listToJson(_assets, version), + if (_assetsForLinking.isNotEmpty) + _assetsForLinkingKey: + _assetsForLinking.map((packageName, assets) => MapEntry( + packageName, + AssetImpl.listToJson(assets, version), + )), + if (_dependencies.dependencies.isNotEmpty) + _dependenciesKey: _dependencies.toJson(), + if (metadata.metadata.isNotEmpty) _metadataKey: metadata.toJson(), + _versionKey: version.toString(), + }..sortOnKey(); String toJsonString(Version version) => const JsonEncoder.withIndent(' ').convert(toJson(version)); @@ -152,7 +118,7 @@ final class HookOutputImpl implements BuildOutput, LinkOutput { /// packages through build hook invocations. /// /// If we ever were to make breaking changes, it would be useful to give - /// proper error messages rather than just fail to parse the YAML + /// proper error messages rather than just fail to parse the JSON /// representation in the protocol. /// /// [BuildOutput.latestVersion] is tied to [BuildConfig.latestVersion]. This diff --git a/pkgs/native_assets_cli/lib/src/model/link_config.dart b/pkgs/native_assets_cli/lib/src/model/link_config.dart index eb32b7dfa..bf10c27c6 100644 --- a/pkgs/native_assets_cli/lib/src/model/link_config.dart +++ b/pkgs/native_assets_cli/lib/src/model/link_config.dart @@ -25,6 +25,7 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig { required this.assets, this.recordedUsagesFile, required super.outputDirectory, + required super.outputDirectoryShared, required super.packageName, required super.packageRoot, Version? version, @@ -49,6 +50,7 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig { required this.assets, this.recordedUsagesFile, required super.outputDirectory, + required super.outputDirectoryShared, required super.packageName, required super.packageRoot, Version? version, @@ -67,9 +69,6 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig { @override String get outputName => 'link_output.json'; - @override - String? get outputNameV1_1_0 => null; - @override Map toJson() => { ...hookToJson(), @@ -79,24 +78,20 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig { }.sortOnKey(); static LinkConfig fromArguments(List arguments) { - final argParser = ArgParser()..addOption('config'); - - final results = argParser.parse(arguments); - final linkConfigContents = - File(results['config'] as String).readAsStringSync(); - final linkConfigJson = - jsonDecode(linkConfigContents) as Map; - + final configPath = getConfigArgument(arguments); + final bytes = File(configPath).readAsBytesSync(); + final linkConfigJson = const Utf8Decoder() + .fuse(const JsonDecoder()) + .convert(bytes) as Map; return fromJson(linkConfigJson); } - static LinkConfigImpl fromJson(Map linkConfigJson) { - final config = - Config.fromConfigFileContents(fileContents: jsonEncode(linkConfigJson)); + static LinkConfigImpl fromJson(Map config) { final dryRun = HookConfigImpl.parseDryRun(config) ?? false; final targetOS = HookConfigImpl.parseTargetOS(config); return LinkConfigImpl( outputDirectory: HookConfigImpl.parseOutDir(config), + outputDirectoryShared: HookConfigImpl.parseOutDirShared(config), packageName: HookConfigImpl.parsePackageName(config), packageRoot: HookConfigImpl.parsePackageRoot(config), buildMode: HookConfigImpl.parseBuildMode(config, dryRun), @@ -120,11 +115,11 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig { ); } - static Uri? parseRecordedUsagesUri(Config config) => + static Uri? parseRecordedUsagesUri(Map config) => config.optionalPath(resourceIdentifierKey); - static List parseAssets(Config config) => - AssetImpl.listFromJson(config.valueOf(assetsKey)); + static List parseAssets(Map config) => + AssetImpl.listFromJson(config.optionalList(assetsKey)); @override bool operator ==(Object other) { diff --git a/pkgs/native_assets_cli/lib/src/model/native_code_asset.dart b/pkgs/native_assets_cli/lib/src/model/native_code_asset.dart index 962a137fe..b04f278d6 100644 --- a/pkgs/native_assets_cli/lib/src/model/native_code_asset.dart +++ b/pkgs/native_assets_cli/lib/src/model/native_code_asset.dart @@ -5,7 +5,7 @@ part of '../api/asset.dart'; abstract final class LinkModeImpl implements LinkMode { - /// Serialization of v1.1.0 and newer + /// Serialization of a link mode. /// /// Does not include the toplevel keys. /// @@ -15,30 +15,14 @@ abstract final class LinkModeImpl implements LinkMode { /// ``` Map toJson(); - /// Backwards compatibility with v1.0.0 of the protocol - /// - /// Includes the parent keys. - /// - /// ``` - /// link_mode: dynamic - /// path: - /// path_type: system - /// uri: ${foo3Uri.toFilePath()} - /// ``` - Map toJsonV1_0_0(Uri? file); - factory LinkModeImpl(String type, Uri? uri) { switch (type) { - case DynamicLoadingBundledImpl._typeValueV1_0_0: case DynamicLoadingBundledImpl._typeValue: return DynamicLoadingBundledImpl(); - case DynamicLoadingSystemImpl._typeValueV1_0_0: case DynamicLoadingSystemImpl._typeValue: return DynamicLoadingSystemImpl(uri!); - case LookupInExecutableImpl._typeValueV1_0_0: case LookupInExecutableImpl._typeValue: return LookupInExecutableImpl(); - case LookupInProcessImpl._typeValueV1_0_0: case LookupInProcessImpl._typeValue: return LookupInProcessImpl(); case StaticLinkingImpl._typeValue: @@ -47,7 +31,6 @@ abstract final class LinkModeImpl implements LinkMode { throw FormatException('Unknown type: $type.'); } - /// v1.1.0 and newer. factory LinkModeImpl.fromJson(Map jsonMap) { final type = get(jsonMap, _typeKey); final uriString = get(jsonMap, _uriKey); @@ -61,11 +44,8 @@ abstract final class LinkModeImpl implements LinkMode { abstract final class DynamicLoadingImpl implements LinkModeImpl, DynamicLoading { - static const _pathTypeKeyV1_0_0 = 'path_type'; static const _typeKey = 'type'; static const _uriKey = 'uri'; - - static const _typeValueV1_0_0 = 'dynamic'; } final class DynamicLoadingBundledImpl @@ -77,7 +57,6 @@ final class DynamicLoadingBundledImpl factory DynamicLoadingBundledImpl() => _singleton; - static const _typeValueV1_0_0 = 'absolute'; static const _typeValue = 'dynamic_loading_bundle'; @override @@ -85,15 +64,6 @@ final class DynamicLoadingBundledImpl DynamicLoadingImpl._typeKey: _typeValue, }; - @override - Map toJsonV1_0_0(Uri? file) => { - NativeCodeAssetImpl._linkModeKey: DynamicLoadingImpl._typeValueV1_0_0, - NativeCodeAssetImpl._pathKey: { - DynamicLoadingImpl._pathTypeKeyV1_0_0: _typeValueV1_0_0, - DynamicLoadingImpl._uriKey: file!.toFilePath(), - } - }; - @override String toString() => _typeValue; } @@ -106,7 +76,6 @@ final class DynamicLoadingSystemImpl DynamicLoadingSystemImpl(this.uri); static const _typeValue = 'dynamic_loading_system'; - static const _typeValueV1_0_0 = 'system'; @override Map toJson() => { @@ -114,15 +83,6 @@ final class DynamicLoadingSystemImpl DynamicLoadingImpl._uriKey: uri.toFilePath(), }; - @override - Map toJsonV1_0_0(Uri? file) => { - NativeCodeAssetImpl._linkModeKey: DynamicLoadingImpl._typeValueV1_0_0, - NativeCodeAssetImpl._pathKey: { - DynamicLoadingImpl._pathTypeKeyV1_0_0: _typeValueV1_0_0, - DynamicLoadingImpl._uriKey: uri.toFilePath(), - } - }; - @override int get hashCode => Object.hash(uri, 133723); @@ -146,21 +106,12 @@ final class LookupInProcessImpl implements DynamicLoadingImpl, LookupInProcess { factory LookupInProcessImpl() => _singleton; static const _typeValue = 'dynamic_loading_process'; - static const _typeValueV1_0_0 = 'process'; @override Map toJson() => { DynamicLoadingImpl._typeKey: _typeValue, }; - @override - Map toJsonV1_0_0(Uri? file) => { - NativeCodeAssetImpl._linkModeKey: DynamicLoadingImpl._typeValueV1_0_0, - NativeCodeAssetImpl._pathKey: { - DynamicLoadingImpl._pathTypeKeyV1_0_0: _typeValueV1_0_0, - } - }; - @override String toString() => _typeValue; } @@ -174,20 +125,11 @@ final class LookupInExecutableImpl factory LookupInExecutableImpl() => _singleton; static const _typeValue = 'dynamic_loading_executable'; - static const _typeValueV1_0_0 = 'executable'; @override Map toJson() => { DynamicLoadingImpl._typeKey: _typeValue, }; - - @override - Map toJsonV1_0_0(Uri? file) => { - NativeCodeAssetImpl._linkModeKey: DynamicLoadingImpl._typeValueV1_0_0, - NativeCodeAssetImpl._pathKey: { - DynamicLoadingImpl._pathTypeKeyV1_0_0: _typeValueV1_0_0, - } - }; } final class StaticLinkingImpl implements LinkModeImpl, StaticLinking { @@ -204,11 +146,6 @@ final class StaticLinkingImpl implements LinkModeImpl, StaticLinking { DynamicLoadingImpl._typeKey: _typeValue, }; - @override - Map toJsonV1_0_0(Uri? file) => { - NativeCodeAssetImpl._linkModeKey: _typeValue, - }; - @override String toString() => _typeValue; } @@ -248,56 +185,24 @@ final class NativeCodeAssetImpl implements NativeCodeAsset, AssetImpl { } factory NativeCodeAssetImpl.fromJson(Map jsonMap) { - final LinkModeImpl linkMode; final linkModeJson = jsonMap[_linkModeKey]; - if (linkModeJson is String) { - // v1.0.0 - if (linkModeJson == StaticLinkingImpl._typeValue) { - linkMode = StaticLinkingImpl(); - } else { - assert(linkModeJson == DynamicLoadingImpl._typeValueV1_0_0); - final pathJson = get>(jsonMap, _pathKey); - final type = - as(pathJson[DynamicLoadingImpl._pathTypeKeyV1_0_0]); - final uriString = as(pathJson[DynamicLoadingImpl._uriKey]); - final uri = uriString != null ? Uri(path: uriString) : null; - linkMode = LinkModeImpl(type, uri); - } - } else { - // v1.1.0 and newer. - linkMode = LinkModeImpl.fromJson(as>(linkModeJson)); - } + final linkMode = + LinkModeImpl.fromJson(as>(linkModeJson)); final fileString = get(jsonMap, _fileKey); final Uri? file; if (fileString != null) { file = Uri(path: fileString); - } else if ((linkMode is DynamicLoadingBundledImpl || - linkMode is StaticLinkingImpl) && - jsonMap[_pathKey] != null) { - // Compatibility with v1.0.0. - final oldPath = as((jsonMap[_pathKey] - as Map)[DynamicLoadingImpl._uriKey]); - file = oldPath != null ? Uri(path: oldPath) : null; } else { file = null; } - final targetString = get(jsonMap, _targetKey); final ArchitectureImpl? architecture; - final OSImpl os; - if (targetString != null) { - // Compatibility with v1.0.0. - final target = Target.fromString(targetString); - os = target.os; - architecture = target.architecture; + final os = OSImpl.fromString(get(jsonMap, _osKey)); + final architectureString = get(jsonMap, _architectureKey); + if (architectureString != null) { + architecture = ArchitectureImpl.fromString(architectureString); } else { - os = OSImpl.fromString(get(jsonMap, _osKey)); - final architectureString = get(jsonMap, _architectureKey); - if (architectureString != null) { - architecture = ArchitectureImpl.fromString(architectureString); - } else { - architecture = null; - } + architecture = null; } return NativeCodeAssetImpl( @@ -346,29 +251,18 @@ final class NativeCodeAssetImpl implements NativeCodeAsset, AssetImpl { ); @override - Map toJson(Version version) { - if (version == Version(1, 0, 0)) { - return { + Map toJson(Version version) => { + if (architecture != null) _architectureKey: architecture.toString(), + if (file != null) _fileKey: file!.toFilePath(), _idKey: id, - ...linkMode.toJsonV1_0_0(file), - _targetKey: Target.fromArchitectureAndOS(architecture!, os).toString(), + _linkModeKey: linkMode.toJson(), + _osKey: os.toString(), + typeKey: NativeCodeAsset.type, }..sortOnKey(); - } - return { - if (architecture != null) _architectureKey: architecture.toString(), - if (file != null) _fileKey: file!.toFilePath(), - _idKey: id, - _linkModeKey: linkMode.toJson(), - _osKey: os.toString(), - typeKey: NativeCodeAsset.type, - }..sortOnKey(); - } static const typeKey = 'type'; static const _idKey = 'id'; static const _linkModeKey = 'link_mode'; - static const _pathKey = 'path'; - static const _targetKey = 'target'; static const _fileKey = 'file'; static const _osKey = 'os'; static const _architectureKey = 'architecture'; diff --git a/pkgs/native_assets_cli/lib/src/model/resource_identifiers.dart b/pkgs/native_assets_cli/lib/src/model/resource_identifiers.dart index 0ed06d619..b1b1211cf 100644 --- a/pkgs/native_assets_cli/lib/src/model/resource_identifiers.dart +++ b/pkgs/native_assets_cli/lib/src/model/resource_identifiers.dart @@ -21,20 +21,20 @@ class ResourceIdentifiers { final fileJson = (jsonDecode(fileContents) as Map)['identifiers'] as List; return ResourceIdentifiers( identifiers: fileJson - .map((e) => e as Map) + .map((e) => e as Map) .map(Identifier.fromJson) .toList()); } - factory ResourceIdentifiers.fromJson(Map map) => + factory ResourceIdentifiers.fromJson(Map map) => ResourceIdentifiers( identifiers: List.from((map['identifiers'] as List?) - ?.whereType>() + ?.whereType>() .map(Identifier.fromJson) ?? []), ); - Map toJson() => { + Map toJson() => { 'identifiers': identifiers.map((x) => x.toJson()).toList(), }; @@ -69,7 +69,7 @@ class Identifier { required this.files, }); - Map toJson() => { + Map toJson() => { 'name': name, 'id': id, 'uri': uri.toFilePath(), @@ -81,13 +81,13 @@ class Identifier { String toString() => '''Identifier(name: $name, id: $id, uri: $uri, nonConstant: $nonConstant, files: $files)'''; - factory Identifier.fromJson(Map map) => Identifier( + factory Identifier.fromJson(Map map) => Identifier( name: map['name'] as String, id: map['id'] as String, uri: Uri.file(map['uri'] as String), nonConstant: map['nonConstant'] as bool, files: List.from((map['files'] as List) - .map((e) => e as Map) + .map((e) => e as Map) .map(ResourceFile.fromJson)), ); @@ -119,15 +119,15 @@ class ResourceFile { ResourceFile({required this.part, required this.references}); - Map toJson() => { + Map toJson() => { 'part': part, 'references': references.map((x) => x.toJson()).toList(), }; - factory ResourceFile.fromJson(Map map) => ResourceFile( + factory ResourceFile.fromJson(Map map) => ResourceFile( part: map['part'] as int, references: List.from((map['references'] as List) - .map((e) => e as Map) + .map((e) => e as Map) .map(ResourceReference.fromJson)), ); @@ -161,7 +161,7 @@ class ResourceReference { required this.arguments, }); - Map toJson() => { + Map toJson() => { '@': { 'uri': uri.toFilePath(), 'line': line, @@ -174,8 +174,8 @@ class ResourceReference { String toString() => '''ResourceReference(uri: $uri, line: $line, column: $column, arguments: $arguments)'''; - factory ResourceReference.fromJson(Map map) { - final submap = map['@'] as Map; + factory ResourceReference.fromJson(Map map) { + final submap = map['@'] as Map; return ResourceReference( uri: Uri.file(submap['uri'] as String), line: submap['line'] as int, diff --git a/pkgs/native_assets_cli/pubspec.yaml b/pkgs/native_assets_cli/pubspec.yaml index fb41ca377..944665ffe 100644 --- a/pkgs/native_assets_cli/pubspec.yaml +++ b/pkgs/native_assets_cli/pubspec.yaml @@ -4,7 +4,7 @@ description: >- native assets CLI. # Note: Bump BuildConfig.version and BuildOutput.version on breaking changes! -version: 0.8.0-wip +version: 0.9.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli topics: @@ -13,21 +13,18 @@ topics: - native-assets environment: - sdk: '>=3.3.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' dependencies: - args: ^2.4.2 - cli_config: ^0.2.0 collection: ^1.17.1 crypto: ^3.0.3 logging: ^1.2.0 meta: ^1.15.0 pub_semver: ^2.1.3 test: ^1.25.7 - yaml: ^3.1.2 + yaml: ^3.1.2 # Used for reading pubspec.yaml to obtain the package name dev_dependencies: dart_flutter_team_lints: ^2.1.1 file_testing: ^3.0.0 glob: any - yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_cli/test/api/build_config_test.dart b/pkgs/native_assets_cli/test/api/build_config_test.dart index 564861c79..2488ab103 100644 --- a/pkgs/native_assets_cli/test/api/build_config_test.dart +++ b/pkgs/native_assets_cli/test/api/build_config_test.dart @@ -14,6 +14,8 @@ void main() async { late Uri tempUri; late Uri outDirUri; late Uri outDir2Uri; + late Uri outputDirectoryShared; + late Uri outputDirectoryShared2; late String packageName; late Uri packageRootUri; late Uri fakeClang; @@ -27,8 +29,12 @@ void main() async { outDirUri = tempUri.resolve('out1/'); await Directory.fromUri(outDirUri).create(); outDir2Uri = tempUri.resolve('out2/'); - packageName = 'my_package'; await Directory.fromUri(outDir2Uri).create(); + outputDirectoryShared = tempUri.resolve('out_shared1/'); + await Directory.fromUri(outputDirectoryShared).create(); + outputDirectoryShared2 = tempUri.resolve('out_shared2/'); + await Directory.fromUri(outputDirectoryShared2).create(); + packageName = 'my_package'; packageRootUri = tempUri.resolve('$packageName/'); await Directory.fromUri(packageRootUri).create(); fakeClang = tempUri.resolve('fake_clang'); @@ -50,6 +56,7 @@ void main() async { test('BuildConfig ==', () { final config1 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -68,6 +75,7 @@ void main() async { final config2 = BuildConfig.build( outputDirectory: outDir2Uri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -102,6 +110,7 @@ void main() async { test('BuildConfig fromConfig', () { final buildConfig2 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: Architecture.arm64, @@ -118,6 +127,7 @@ void main() async { 'linking_enabled': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, @@ -133,6 +143,7 @@ void main() async { test('BuildConfig.dryRun', () { final buildConfig2 = BuildConfig.dryRun( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, @@ -146,6 +157,7 @@ void main() async { 'linking_enabled': true, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', @@ -159,6 +171,7 @@ void main() async { test('BuildConfig == dependency metadata', () { final buildConfig1 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -180,6 +193,7 @@ void main() async { final buildConfig2 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -208,6 +222,7 @@ void main() async { test('BuildConfig == hasLinkConfig', () { final buildConfig1 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.x64, @@ -219,6 +234,7 @@ void main() async { final buildConfig2 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.x64, @@ -236,6 +252,7 @@ void main() async { test('BuildConfig fromArgs', () async { final buildConfig = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, diff --git a/pkgs/native_assets_cli/test/api/build_test.dart b/pkgs/native_assets_cli/test/api/build_test.dart index ce62f8777..186aa7969 100644 --- a/pkgs/native_assets_cli/test/api/build_test.dart +++ b/pkgs/native_assets_cli/test/api/build_test.dart @@ -12,6 +12,7 @@ import 'package:test/test.dart'; void main() async { late Uri tempUri; late Uri outDirUri; + late Uri outputDirectoryShared; late String packageName; late Uri packageRootUri; late Uri fakeClang; @@ -26,6 +27,8 @@ void main() async { tempUri = (await Directory.systemTemp.createTemp()).uri; outDirUri = tempUri.resolve('out1/'); await Directory.fromUri(outDirUri).create(); + outputDirectoryShared = tempUri.resolve('out_shared1/'); + await Directory.fromUri(outputDirectoryShared).create(); packageName = 'my_package'; packageRootUri = tempUri.resolve('$packageName/'); await Directory.fromUri(packageRootUri).create(); @@ -42,6 +45,7 @@ void main() async { config1 = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, diff --git a/pkgs/native_assets_cli/test/api/link_config_test.dart b/pkgs/native_assets_cli/test/api/link_config_test.dart index 831278f75..a066acab1 100644 --- a/pkgs/native_assets_cli/test/api/link_config_test.dart +++ b/pkgs/native_assets_cli/test/api/link_config_test.dart @@ -12,6 +12,7 @@ void main() async { late Uri tempUri; late Uri outDirUri; late Uri outDir2Uri; + late Uri outputDirectoryShared; late String packageName; late Uri packageRootUri; late Uri fakeClang; @@ -25,8 +26,10 @@ void main() async { outDirUri = tempUri.resolve('out1/'); await Directory.fromUri(outDirUri).create(); outDir2Uri = tempUri.resolve('out2/'); - packageName = 'my_package'; await Directory.fromUri(outDir2Uri).create(); + outputDirectoryShared = tempUri.resolve('out_shared1/'); + await Directory.fromUri(outputDirectoryShared).create(); + packageName = 'my_package'; packageRootUri = tempUri.resolve('$packageName/'); await Directory.fromUri(packageRootUri).create(); fakeClang = tempUri.resolve('fake_clang'); @@ -48,6 +51,7 @@ void main() async { test('LinkConfig ==', () { final config1 = LinkConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -66,6 +70,7 @@ void main() async { final config2 = LinkConfig.build( outputDirectory: outDir2Uri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -98,6 +103,7 @@ void main() async { test('LinkConfig fromConfig', () { final linkConfig2 = LinkConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: Architecture.arm64, @@ -113,6 +119,7 @@ void main() async { 'dry_run': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, @@ -129,6 +136,7 @@ void main() async { test('LinkConfig.dryRun', () { final linkConfig2 = LinkConfig.dryRun( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, @@ -141,6 +149,7 @@ void main() async { 'dry_run': true, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', @@ -155,6 +164,7 @@ void main() async { test('LinkConfig fromArgs', () async { final linkConfig = LinkConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, diff --git a/pkgs/native_assets_cli/test/example/local_asset_test.dart b/pkgs/native_assets_cli/test/example/local_asset_test.dart index 365eea413..000edb57f 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -33,11 +33,16 @@ void main() async { test('local_asset build$testSuffix', () async { final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); + final outputDirectory = tempUri.resolve('out/'); + await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempUri.resolve('out_shared/'); + await Directory.fromUri(outputDirectoryShared).create(); final testPackageUri = packageUri.resolve('example/build/$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); final config = BuildConfigImpl( - outputDirectory: tempUri, + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: name, packageRoot: testPackageUri, targetOS: OSImpl.current, @@ -69,7 +74,7 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = tempUri.resolve('build_output.json'); + final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = HookOutputImpl.fromJsonString( await File.fromUri(buildOutputUri).readAsString()); final assets = buildOutput.assets; diff --git a/pkgs/native_assets_cli/test/example/native_add_library_test.dart b/pkgs/native_assets_cli/test/example/native_add_library_test.dart index c78d87f58..ccec7203b 100644 --- a/pkgs/native_assets_cli/test/example/native_add_library_test.dart +++ b/pkgs/native_assets_cli/test/example/native_add_library_test.dart @@ -33,11 +33,16 @@ void main() async { test('native_add build$testSuffix', () async { final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); + final outputDirectory = tempUri.resolve('out/'); + await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempUri.resolve('out_shared/'); + await Directory.fromUri(outputDirectoryShared).create(); final testPackageUri = packageUri.resolve('example/build/$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); final config = BuildConfigImpl( - outputDirectory: tempUri, + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: name, packageRoot: testPackageUri, targetOS: OSImpl.current, @@ -69,7 +74,7 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = tempUri.resolve('build_output.json'); + final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = HookOutputImpl.fromJsonString( await File.fromUri(buildOutputUri).readAsString()); final assets = buildOutput.assets; diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index 1a91b5a6b..193dd159b 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -42,11 +42,16 @@ void main() async { test('native_dynamic_linking build$testSuffix', () async { final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); + final outputDirectory = tempUri.resolve('out/'); + await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempUri.resolve('out_shared/'); + await Directory.fromUri(outputDirectoryShared).create(); final testPackageUri = packageUri.resolve('example/build/$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); final config = BuildConfigImpl( - outputDirectory: tempUri, + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, packageName: name, packageRoot: testPackageUri, targetOS: OSImpl.current, @@ -78,7 +83,7 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = tempUri.resolve('build_output.json'); + final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = HookOutputImpl.fromJsonString( await File.fromUri(buildOutputUri).readAsString()); final assets = buildOutput.assets; diff --git a/pkgs/native_assets_cli/test/helpers.dart b/pkgs/native_assets_cli/test/helpers.dart index f6d3015fc..d3771ed9e 100644 --- a/pkgs/native_assets_cli/test/helpers.dart +++ b/pkgs/native_assets_cli/test/helpers.dart @@ -8,8 +8,6 @@ import 'package:logging/logging.dart'; import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart' as internal; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; -import 'package:yaml_edit/yaml_edit.dart'; const keepTempKey = 'KEEP_TEMPORARY_DIRECTORIES'; @@ -82,7 +80,8 @@ extension on Uri { String get name => pathSegments.where((e) => e != '').last; } -String unparseKey(String key) => key.replaceAll('.', '__').toUpperCase(); +String unparseKey(String key) => + 'DART_HOOK_TESTING_${key.replaceAll('.', '__').toUpperCase()}'; /// Archiver provided by the environment. /// @@ -165,37 +164,6 @@ extension UriExtension on Uri { } } -String yamlEncode(Object yamlEncoding) { - final editor = YamlEditor(''); - editor.update( - [], - wrapAsYamlNode( - yamlEncoding, - collectionStyle: CollectionStyle.BLOCK, - ), - ); - return editor.toString(); -} - -dynamic yamlDecode(String yaml) { - final value = loadYaml(yaml); - return yamlToDart(value); -} - -dynamic yamlToDart(dynamic value) { - if (value is YamlMap) { - final entries = >[]; - for (final key in value.keys) { - entries.add(MapEntry(key as String, yamlToDart(value[key]))); - } - return Map.fromEntries(entries); - } else if (value is YamlList) { - return List.from(value.map(yamlToDart)); - } else { - return value; - } -} - /// Logger that outputs the full trace when a test fails. Logger get logger => _logger ??= () { // A new logger is lazily created for each test so that the messages diff --git a/pkgs/native_assets_cli/test/model/asset_test.dart b/pkgs/native_assets_cli/test/model/asset_test.dart index 77a5e1b45..61b33baf6 100644 --- a/pkgs/native_assets_cli/test/model/asset_test.dart +++ b/pkgs/native_assets_cli/test/model/asset_test.dart @@ -5,7 +5,6 @@ import 'package:collection/collection.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; void main() { final fooUri = Uri.file('path/to/libfoo.so'); @@ -72,41 +71,6 @@ void main() { ...dataAssets, ]; - final assetsYamlEncodingV1_0_0 = '''- id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: ${fooUri.toFilePath()} - target: android_x64 -- id: package:my_package/foo3 - link_mode: dynamic - path: - path_type: system - uri: ${foo3Uri.toFilePath()} - target: android_x64 -- id: package:my_package/foo4 - link_mode: dynamic - path: - path_type: executable - target: android_x64 -- id: package:my_package/foo5 - link_mode: dynamic - path: - path_type: process - target: android_x64 -- id: package:my_package/bar - link_mode: static - path: - path_type: absolute - uri: ${barUri.toFilePath()} - target: linux_arm64 -- id: package:my_package/bla - link_mode: dynamic - path: - path_type: absolute - uri: ${blaUri.toFilePath()} - target: windows_x64'''; - final assetsJsonEncoding = [ { 'architecture': 'x64', @@ -170,7 +134,7 @@ void main() { } ]; - test('asset yaml', () { + test('asset json', () { final json = [ for (final item in assets) item.toJson(HookOutputImpl.latestVersion) ]; @@ -179,12 +143,6 @@ void main() { expect(assets, assets2); }); - test('build_output protocol v1.0.0 keeps working', () { - final assets2 = AssetImpl.listFromJson( - loadYaml(assetsYamlEncodingV1_0_0) as List); - expect(nativeCodeAssets, assets2); - }); - test('AssetPath factory', () async { expect( () => LinkModeImpl('wrong', null), diff --git a/pkgs/native_assets_cli/test/model/build_config_test.dart b/pkgs/native_assets_cli/test/model/build_config_test.dart index 1c93316b4..9d5e90751 100644 --- a/pkgs/native_assets_cli/test/model/build_config_test.dart +++ b/pkgs/native_assets_cli/test/model/build_config_test.dart @@ -6,16 +6,15 @@ import 'dart:io'; import 'package:native_assets_cli/native_assets_cli_internal.dart'; import 'package:native_assets_cli/src/api/asset.dart'; -import 'package:pub_semver/pub_semver.dart'; import 'package:test/test.dart'; -import '../helpers.dart'; - void main() async { const packageName = 'my_package'; late Uri tempUri; late Uri outDirUri; late Uri outDir2Uri; + late Uri outputDirectoryShared; + late Uri outputDirectoryShared2; late Uri packageRootUri; late Uri fakeClang; late Uri fakeLd; @@ -29,6 +28,10 @@ void main() async { await Directory.fromUri(outDirUri).create(); outDir2Uri = tempUri.resolve('out2/'); await Directory.fromUri(outDir2Uri).create(); + outputDirectoryShared = tempUri.resolve('out_shared1/'); + await Directory.fromUri(outputDirectoryShared).create(); + outputDirectoryShared2 = tempUri.resolve('out_shared2/'); + await Directory.fromUri(outputDirectoryShared2).create(); packageRootUri = tempUri.resolve('$packageName/'); await Directory.fromUri(packageRootUri).create(); fakeClang = tempUri.resolve('fake_clang'); @@ -50,6 +53,7 @@ void main() async { test('BuildConfig ==', () { final config1 = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -67,6 +71,7 @@ void main() async { final config2 = BuildConfigImpl( outputDirectory: outDir2Uri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -99,6 +104,7 @@ void main() async { test('BuildConfig fromConfig', () { final buildConfig2 = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: ArchitectureImpl.arm64, @@ -115,6 +121,7 @@ void main() async { 'linking_enabled': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, @@ -130,6 +137,7 @@ void main() async { test('BuildConfig.dryRun', () { final buildConfig2 = BuildConfigImpl.dryRun( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetOS: OSImpl.android, @@ -142,6 +150,7 @@ void main() async { 'linking_enabled': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', @@ -155,6 +164,7 @@ void main() async { test('BuildConfig toJson fromConfig', () { final buildConfig1 = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: ArchitectureImpl.arm64, @@ -177,6 +187,7 @@ void main() async { test('BuildConfig == dependency metadata', () { final buildConfig1 = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -198,6 +209,7 @@ void main() async { final buildConfig2 = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -225,6 +237,7 @@ void main() async { final outDir = outDirUri; final buildConfig1 = BuildConfigImpl( outputDirectory: outDir, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -263,6 +276,7 @@ void main() async { 'linking_enabled': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'supported_asset_types': [NativeCodeAsset.type], @@ -280,60 +294,6 @@ void main() async { expect(buildConfig2, buildConfig1); }); - test('BuildConfig from yaml v1.0.0 keeps working', () { - final outDir = outDirUri; - final yamlString = '''build_mode: release -c_compiler: - cc: ${fakeClang.toFilePath()} - ld: ${fakeLd.toFilePath()} -dependency_metadata: - bar: - key: value - foo: - a: 321 - z: - - z - - a -link_mode_preference: prefer-static -out_dir: ${outDir.toFilePath()} -package_name: $packageName -package_root: ${tempUri.toFilePath()} -target_architecture: arm64 -target_ios_sdk: iphoneos -target_os: ios -version: 1.0.0'''; - final buildConfig1 = BuildConfigImpl( - outputDirectory: outDir, - packageName: packageName, - packageRoot: tempUri, - targetArchitecture: ArchitectureImpl.arm64, - targetOS: OSImpl.iOS, - targetIOSSdk: IOSSdkImpl.iPhoneOS, - cCompiler: CCompilerConfigImpl( - compiler: fakeClang, - linker: fakeLd, - ), - buildMode: BuildModeImpl.release, - linkModePreference: LinkModePreferenceImpl.preferStatic, - // This map should be sorted on key for two layers. - dependencyMetadata: { - 'foo': const Metadata({ - 'z': ['z', 'a'], - 'a': 321, - }), - 'bar': const Metadata({ - 'key': 'value', - }), - }, - version: Version(1, 0, 0), - linkingEnabled: null, - ); - - final buildConfig2 = BuildConfigImpl.fromJson( - yamlDecode(yamlString) as Map); - expect(buildConfig2, buildConfig1); - }); - test('BuildConfig FormatExceptions', () { expect( () => BuildConfigImpl.fromJson({}), @@ -367,6 +327,7 @@ version: 1.0.0'''; () => BuildConfigImpl.fromJson({ 'version': HookConfigImpl.latestVersion.toString(), 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_architecture': 'arm64', @@ -391,6 +352,7 @@ version: 1.0.0'''; expect( () => BuildConfigImpl.fromJson({ 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'version': HookConfigImpl.latestVersion.toString(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), @@ -412,6 +374,7 @@ version: 1.0.0'''; test('BuildConfig toString', () { final config = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -431,6 +394,7 @@ version: 1.0.0'''; test('BuildConfig fromArgs', () async { final buildConfig = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -441,7 +405,7 @@ version: 1.0.0'''; linkingEnabled: false, ); final configFileContents = buildConfig.toJsonString(); - final configUri = tempUri.resolve('config.yaml'); + final configUri = tempUri.resolve('config.json'); final configFile = File.fromUri(configUri); await configFile.writeAsString(configFileContents); final buildConfig2 = BuildConfigImpl.fromArguments( @@ -454,6 +418,7 @@ version: 1.0.0'''; test('envScript', () { final buildConfig1 = BuildConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: ArchitectureImpl.x64, @@ -479,6 +444,7 @@ version: 1.0.0'''; final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_root': tempUri.toFilePath(), 'target_os': 'linux', 'version': version, @@ -502,6 +468,7 @@ version: 1.0.0'''; final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'windows', @@ -522,6 +489,7 @@ version: 1.0.0'''; final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'windows', @@ -546,6 +514,7 @@ version: 1.0.0'''; 'linking_enabled': true, 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'android', @@ -567,6 +536,7 @@ version: 1.0.0'''; 'linking_enabled': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'windows', @@ -579,6 +549,7 @@ version: 1.0.0'''; test('BuildConfig dry_run toString', () { final buildConfig = BuildConfigImpl.dryRun( packageName: packageName, + outputDirectoryShared: outputDirectoryShared, outputDirectory: outDirUri, packageRoot: tempUri, targetOS: OSImpl.windows, @@ -595,6 +566,7 @@ version: 1.0.0'''; 'dry_run': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, diff --git a/pkgs/native_assets_cli/test/model/build_output_test.dart b/pkgs/native_assets_cli/test/model/build_output_test.dart index 9d0b27d86..80449dede 100644 --- a/pkgs/native_assets_cli/test/model/build_output_test.dart +++ b/pkgs/native_assets_cli/test/model/build_output_test.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:native_assets_cli/native_assets_cli_internal.dart'; import 'package:pub_semver/pub_semver.dart'; import 'package:test/test.dart'; -import '../helpers.dart'; void main() { late Uri tempUri; @@ -20,82 +19,6 @@ void main() { await Directory.fromUri(tempUri).delete(recursive: true); }); - final dryRunOutput = HookOutputImpl( - timestamp: DateTime.parse('2022-11-10 13:25:01.000'), - assets: [ - NativeCodeAssetImpl( - id: 'package:my_package/foo', - file: Uri(path: 'path/to/libfoo.so'), - linkMode: DynamicLoadingBundledImpl(), - os: OSImpl.android, - ), - ], - ); - - const yamlEncodingV1_0_0 = '''timestamp: 2022-11-10 13:25:01.000 -assets: - - id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_x64 - - id: package:my_package/foo2 - link_mode: dynamic - path: - path_type: system - uri: path/to/libfoo2.so - target: android_x64 - - id: package:my_package/foo3 - link_mode: dynamic - path: - path_type: process - target: android_x64 - - id: package:my_package/foo4 - link_mode: dynamic - path: - path_type: executable - target: android_x64 -dependencies: - - path/to/file.ext -metadata: - key: value -version: 1.0.0'''; - - const yamlEncodingV1_0_0dryRun = '''timestamp: 2022-11-10 13:25:01.000 -assets: - - id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_arm - - id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_arm64 - - id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_ia32 - - id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_x64 - - id: package:my_package/foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_riscv64 -version: 1.0.0'''; - final jsonEncoding = { 'timestamp': '2022-11-10 13:25:01.000', 'assets': [ @@ -167,26 +90,6 @@ version: 1.0.0'''; expect(buildOutput, buildOutput2); }); - test('built info yaml v1.0.0 parsing keeps working', () { - final buildOutput = getBuildOutput(withLinkedAssets: false); - final buildOutput2 = HookOutputImpl.fromJsonString(yamlEncodingV1_0_0); - expect(buildOutput.hashCode, buildOutput2.hashCode); - expect(buildOutput, buildOutput2); - }); - - test('built info yaml v1.0.0 serialization keeps working', () { - final buildOutput = getBuildOutput(withLinkedAssets: false); - final yamlEncoding = - yamlEncode(buildOutput.toJson(Version(1, 0, 0))).unescape(); - expect(yamlEncoding, yamlEncodingV1_0_0); - }); - - test('built info yaml v1.0.0 serialization keeps working dry run', () { - final yamlEncoding = - yamlEncode(dryRunOutput.toJson(Version(1, 0, 0))).unescape(); - expect(yamlEncoding, yamlEncodingV1_0_0dryRun); - }); - test('BuildOutput.toString', getBuildOutput().toString); test('BuildOutput.hashCode', () { @@ -202,11 +105,14 @@ version: 1.0.0'''; test('BuildOutput.readFromFile BuildOutput.writeToFile', () async { final outDir = tempUri.resolve('out_dir/'); + final outDirShared = tempUri.resolve('out_dir_shared/'); final packageRoot = tempUri.resolve('package_root/'); await Directory.fromUri(outDir).create(); + await Directory.fromUri(outDirShared).create(); await Directory.fromUri(packageRoot).create(); final config = BuildConfigImpl( outputDirectory: outDir, + outputDirectoryShared: outDirShared, packageName: 'dontcare', packageRoot: packageRoot, buildMode: BuildModeImpl.debug, @@ -223,11 +129,14 @@ version: 1.0.0'''; test('BuildOutput.readFromFile BuildOutput.writeToFile V1.1.0', () async { final outDir = tempUri.resolve('out_dir/'); + final outDirShared = tempUri.resolve('out_dir_shared/'); final packageRoot = tempUri.resolve('package_root/'); await Directory.fromUri(outDir).create(); + await Directory.fromUri(outDirShared).create(); await Directory.fromUri(packageRoot).create(); final config = BuildConfigImpl( outputDirectory: outDir, + outputDirectoryShared: outDirShared, packageName: 'dontcare', packageRoot: packageRoot, buildMode: BuildModeImpl.debug, @@ -253,7 +162,7 @@ version: 1.0.0'''; for (final version in ['9001.0.0', '0.0.1']) { test('BuildOutput version $version', () { expect( - () => HookOutputImpl.fromJsonString('version: $version'), + () => HookOutputImpl.fromJsonString('{"version": "$version"}'), throwsA(predicate( (e) => e is FormatException && @@ -264,56 +173,6 @@ version: 1.0.0'''; }); } - test('format exception', () { - expect( - () => HookOutputImpl.fromJsonString('''timestamp: 2022-11-10 13:25:01.000 -assets: - - name: foo - link_mode: dynamic - path: - path_type: - some: map - uri: path/to/libfoo.so - target: android_x64 -dependencies: [] -metadata: - key: value -version: 1.0.0'''), - throwsFormatException, - ); - expect( - () => HookOutputImpl.fromJsonString('''timestamp: 2022-11-10 13:25:01.000 -assets: - - name: foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_x64 -dependencies: - 1: foo -metadata: - key: value -version: 1.0.0'''), - throwsFormatException, - ); - expect( - () => HookOutputImpl.fromJsonString('''timestamp: 2022-11-10 13:25:01.000 -assets: - - name: foo - link_mode: dynamic - path: - path_type: absolute - uri: path/to/libfoo.so - target: android_x64 -dependencies: [] -metadata: - 123: value -version: 1.0.0'''), - throwsFormatException, - ); - }); - test('BuildOutput dependencies can be modified', () { final buildOutput = HookOutputImpl(); expect( diff --git a/pkgs/native_assets_cli/test/model/link_config_test.dart b/pkgs/native_assets_cli/test/model/link_config_test.dart index f28219c5d..ab09936c2 100644 --- a/pkgs/native_assets_cli/test/model/link_config_test.dart +++ b/pkgs/native_assets_cli/test/model/link_config_test.dart @@ -13,6 +13,8 @@ void main() async { late Uri tempUri; late Uri outDirUri; late Uri outDir2Uri; + late Uri outputDirectoryShared; + late Uri outputDirectoryShared2; const packageName = 'my_package'; late Uri packageRootUri; late Uri fakeClang; @@ -43,6 +45,10 @@ void main() async { await Directory.fromUri(outDirUri).create(); outDir2Uri = tempUri.resolve('out2/'); await Directory.fromUri(outDir2Uri).create(); + outputDirectoryShared = tempUri.resolve('out_shared1/'); + await Directory.fromUri(outputDirectoryShared).create(); + outputDirectoryShared2 = tempUri.resolve('out_shared2/'); + await Directory.fromUri(outputDirectoryShared2).create(); packageRootUri = tempUri.resolve('$packageName/'); await Directory.fromUri(packageRootUri).create(); fakeClang = tempUri.resolve('fake_clang'); @@ -66,6 +72,7 @@ void main() async { test('LinkConfig ==', () { final config1 = LinkConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -84,6 +91,7 @@ void main() async { final config2 = LinkConfigImpl( outputDirectory: outDir2Uri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -116,6 +124,7 @@ void main() async { test('LinkConfig fromConfig', () { final buildConfig2 = LinkConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: ArchitectureImpl.arm64, @@ -131,6 +140,7 @@ void main() async { 'dry_run': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, @@ -147,6 +157,7 @@ void main() async { test('LinkConfig.dryRun', () { final buildConfig2 = LinkConfigImpl.dryRun( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetOS: OSImpl.android, @@ -158,6 +169,7 @@ void main() async { 'dry_run': true, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', @@ -172,6 +184,7 @@ void main() async { test('LinkConfig toJson fromConfig', () { final buildConfig1 = LinkConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: packageRootUri, targetArchitecture: ArchitectureImpl.arm64, @@ -195,6 +208,7 @@ void main() async { final outDir = outDirUri; final buildConfig1 = LinkConfigImpl( outputDirectory: outDir, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -215,6 +229,7 @@ void main() async { 'build_mode': 'release', 'c_compiler': {'cc': fakeClang.toFilePath(), 'ld': fakeLd.toFilePath()}, 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'supported_asset_types': [NativeCodeAsset.type], @@ -262,6 +277,7 @@ void main() async { () => LinkConfigImpl.fromJson({ 'version': HookConfigImpl.latestVersion.toString(), 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_architecture': 'arm64', @@ -283,6 +299,7 @@ void main() async { expect( () => LinkConfigImpl.fromJson({ 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'version': HookConfigImpl.latestVersion.toString(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), @@ -304,6 +321,7 @@ void main() async { test('LinkConfig toString', () { final config = LinkConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -323,6 +341,7 @@ void main() async { test('LinkConfig fromArgs', () async { final buildConfig = LinkConfigImpl( outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageName: packageName, packageRoot: tempUri, targetArchitecture: ArchitectureImpl.arm64, @@ -348,6 +367,7 @@ void main() async { final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_root': tempUri.toFilePath(), 'target_os': 'linux', 'version': version, @@ -371,6 +391,7 @@ void main() async { final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'windows', @@ -391,6 +412,7 @@ void main() async { final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'windows', @@ -413,6 +435,7 @@ void main() async { final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'android', @@ -433,6 +456,7 @@ void main() async { final config = { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': tempUri.toFilePath(), 'target_os': 'windows', @@ -447,6 +471,7 @@ void main() async { final buildConfig = LinkConfigImpl.dryRun( packageName: packageName, outputDirectory: outDirUri, + outputDirectoryShared: outputDirectoryShared, packageRoot: tempUri, targetOS: OSImpl.windows, assets: assets, @@ -461,6 +486,7 @@ void main() async { 'dry_run': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), + 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, diff --git a/pkgs/native_assets_cli/test/validator/validator_test.dart b/pkgs/native_assets_cli/test/validator/validator_test.dart index 240d40688..5e6102d27 100644 --- a/pkgs/native_assets_cli/test/validator/validator_test.dart +++ b/pkgs/native_assets_cli/test/validator/validator_test.dart @@ -11,17 +11,17 @@ import 'package:test/test.dart'; void main() { late Uri tempUri; late Uri outDirUri; - late Uri outDir2Uri; + late Uri outDirSharedUri; late String packageName; late Uri packageRootUri; setUp(() async { tempUri = (await Directory.systemTemp.createTemp()).uri; - outDirUri = tempUri.resolve('out1/'); + outDirUri = tempUri.resolve('out/'); await Directory.fromUri(outDirUri).create(); - outDir2Uri = tempUri.resolve('out2/'); + outDirSharedUri = tempUri.resolve('out_shared/'); + await Directory.fromUri(outDirSharedUri).create(); packageName = 'my_package'; - await Directory.fromUri(outDir2Uri).create(); packageRootUri = tempUri.resolve('$packageName/'); await Directory.fromUri(packageRootUri).create(); }); @@ -33,6 +33,7 @@ void main() { test('linking not enabled', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -68,6 +69,7 @@ void main() { test('supported asset type', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -97,6 +99,7 @@ void main() { test('file exists', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -125,6 +128,7 @@ void main() { test('file not set', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -158,6 +162,7 @@ void main() { test('native code asset wrong linking $linkModePreference', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -195,6 +200,7 @@ void main() { test('native code wrong architecture', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -231,6 +237,7 @@ void main() { test('native code no architecture', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -266,6 +273,7 @@ void main() { test('native code asset wrong os', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -302,6 +310,7 @@ void main() { test('asset id in wrong package', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -331,6 +340,7 @@ void main() { test('duplicate asset id', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -367,6 +377,7 @@ void main() { test('link hook validation', () async { final config = LinkConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, @@ -396,6 +407,7 @@ void main() { test('duplicate dylib name', () async { final config = BuildConfig.build( outputDirectory: outDirUri, + outputDirectoryShared: outDirSharedUri, packageName: packageName, packageRoot: tempUri, targetArchitecture: Architecture.arm64, diff --git a/pkgs/native_toolchain_c/CHANGELOG.md b/pkgs/native_toolchain_c/CHANGELOG.md index 440213f96..7543f7510 100644 --- a/pkgs/native_toolchain_c/CHANGELOG.md +++ b/pkgs/native_toolchain_c/CHANGELOG.md @@ -1,6 +1,10 @@ -## 0.5.4-wip +## 0.5.5-wip -- Nothing yet. +- Address analyzer info diagnostic about multi-line if requiring a block body. + +## 0.5.4 + +- Bump `package:native_assets_cli` to `0.8.0`. ## 0.5.3 diff --git a/pkgs/native_toolchain_c/lib/native_toolchain_c.dart b/pkgs/native_toolchain_c/lib/native_toolchain_c.dart index ea6461625..fa001799d 100644 --- a/pkgs/native_toolchain_c/lib/native_toolchain_c.dart +++ b/pkgs/native_toolchain_c/lib/native_toolchain_c.dart @@ -6,7 +6,8 @@ library; export 'src/cbuilder/cbuilder.dart' show CBuilder; -export 'src/cbuilder/clinker.dart' show CLinker, LinkerOptions; +export 'src/cbuilder/clinker.dart' show CLinker; export 'src/cbuilder/language.dart' show Language; +export 'src/cbuilder/linker_options.dart' show LinkerOptions; export 'src/cbuilder/output_type.dart' show OutputType; export 'src/utils/env_from_bat.dart'; diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart index 142ec9c30..28d86d9a5 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart @@ -15,8 +15,6 @@ import 'linkmode.dart'; import 'output_type.dart'; import 'run_cbuilder.dart'; -export 'linker_options.dart'; - /// Specification for linking an artifact with a C linker. //TODO(mosuem): This is currently only implemented for linux. // See also https://github.com/dart-lang/native/issues/1376 diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart index f1241563f..b33a12199 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart @@ -64,7 +64,9 @@ class CompilerResolver { // TODO(dacoharkes): Support falling back on other tools. if (targetArch == hostArchitecture && targetOS == hostOS && - hostOS == OS.linux) return clang; + hostOS == OS.linux) { + return clang; + } if (targetOS == OS.macOS || targetOS == OS.iOS) return appleClang; if (targetOS == OS.android) return androidNdkClang; if (hostOS == OS.linux) { diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/linker_options.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/linker_options.dart index e3599e21d..c324a66f4 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/linker_options.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/linker_options.dart @@ -4,9 +4,7 @@ import 'dart:io'; -import '../native_toolchain/apple_clang.dart'; -import '../native_toolchain/clang.dart'; -import '../native_toolchain/gcc.dart'; +import '../native_toolchain/tool_likeness.dart'; import '../tool/tool.dart'; /// Options to pass to the linker. @@ -60,18 +58,15 @@ class LinkerOptions { linkerScript = _createLinkerScript(symbols); Iterable _toLinkerSyntax(Tool linker, List flagList) { - if (linker == clang) { + if (linker.isClangLike) { return flagList.map((e) => '-Wl,$e'); - } else if (isClangLikeLinker(linker)) { + } else if (linker.isLdLike) { return flagList; } else { throw UnsupportedError('Linker flags for $linker are not supported'); } } - static bool isClangLikeLinker(Tool tool) => - tool == appleLd || tool == gnuLinker || tool == lld; - static Uri? _createLinkerScript(Iterable? symbols) { if (symbols == null) return null; final tempDir = Directory.systemTemp.createTempSync(); diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart index 15954324e..3b31c92c4 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart @@ -7,12 +7,9 @@ import 'dart:math'; import 'package:logging/logging.dart'; import 'package:native_assets_cli/native_assets_cli.dart'; -import '../native_toolchain/apple_clang.dart'; -import '../native_toolchain/clang.dart'; -import '../native_toolchain/gcc.dart'; import '../native_toolchain/msvc.dart'; +import '../native_toolchain/tool_likeness.dart'; import '../native_toolchain/xcode.dart'; -import '../tool/tool.dart'; import '../tool/tool_instance.dart'; import '../utils/env_from_bat.dart'; import '../utils/run_process.dart'; @@ -114,7 +111,7 @@ class RunCBuilder { final toolInstance_ = linkerOptions != null ? await linker() : await compiler(); final tool = toolInstance_.tool; - if (isClangLikeCompiler(tool) || LinkerOptions.isClangLikeLinker(tool)) { + if (tool.isClangLike || tool.isLdLike) { await runClangLike(tool: toolInstance_); return; } else if (tool == cl) { @@ -124,9 +121,6 @@ class RunCBuilder { } } - static bool isClangLikeCompiler(Tool tool) => - tool == appleClang || tool == clang || tool == gcc; - Future runClangLike({required ToolInstance tool}) async { final isStaticLib = staticLibrary != null; Uri? archiver_; @@ -241,7 +235,7 @@ class RunCBuilder { installName!.toFilePath(), ], if (pic != null) - if (isClangLikeCompiler(toolInstance.tool)) ...[ + if (toolInstance.tool.isClangLike) ...[ if (pic!) ...[ if (dynamicLibrary != null) '-fPIC', // Using PIC for static libraries allows them to be linked into @@ -264,7 +258,7 @@ class RunCBuilder { // Tell the linker to generate a position-dependent executable. if (executable != null) '-no-pie', ], - ] else if (LinkerOptions.isClangLikeLinker(toolInstance.tool)) ...[ + ] else if (toolInstance.tool.isLdLike) ...[ if (pic!) ...[ if (executable != null) '--pie', ] else ...[ diff --git a/pkgs/native_toolchain_c/lib/src/native_toolchain/tool_likeness.dart b/pkgs/native_toolchain_c/lib/src/native_toolchain/tool_likeness.dart new file mode 100644 index 000000000..f3bc2ece6 --- /dev/null +++ b/pkgs/native_toolchain_c/lib/src/native_toolchain/tool_likeness.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import '../tool/tool.dart'; +import 'apple_clang.dart'; +import 'clang.dart'; +import 'gcc.dart'; + +extension ToolLikeness on Tool { + bool get isClangLike => this == appleClang || this == clang || this == gcc; + + bool get isLdLike => this == appleLd || this == gnuLinker || this == lld; +} diff --git a/pkgs/native_toolchain_c/pubspec.yaml b/pkgs/native_toolchain_c/pubspec.yaml index 3e7ef09b0..2a632ae7f 100644 --- a/pkgs/native_toolchain_c/pubspec.yaml +++ b/pkgs/native_toolchain_c/pubspec.yaml @@ -1,7 +1,7 @@ name: native_toolchain_c description: >- A library to invoke the native C compiler installed on the host machine. -version: 0.5.4-wip +version: 0.5.5-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c publish_to: none @@ -20,7 +20,7 @@ dependencies: glob: ^2.1.1 logging: ^1.1.1 meta: ^1.9.1 - # native_assets_cli: ^0.7.3 + # native_assets_cli: ^0.8.0 native_assets_cli: path: ../native_assets_cli/ pub_semver: ^2.1.3 diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index 28fa203ed..e8f9182d1 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -19,6 +19,7 @@ import '../helpers.dart'; void main() { test('build failure', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final addCOriginalUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); final addCUri = tempUri.resolve('add.c'); @@ -31,6 +32,7 @@ void main() { final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index a5558f939..021238663 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -108,8 +108,12 @@ Future buildLib( final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; + final tempUriShared = tempUri.resolve('shared/'); + await Directory.fromUri(tempUriShared).create(); + final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUriShared, packageName: name, packageRoot: tempUri, targetArchitecture: targetArchitecture, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index 5b67876f2..6f4b08599 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -55,6 +55,7 @@ void main() { ' ${installName ?? ''}' .trim(), () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final sourceUri = switch (language) { Language.c => packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'), @@ -64,6 +65,7 @@ void main() { }; final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: target, @@ -174,7 +176,15 @@ void main() { final tempUri = await tempDirForTest(); final out1Uri = tempUri.resolve('out1/'); await Directory.fromUri(out1Uri).create(); - final lib1Uri = await buildLib(out1Uri, target, iosVersion, linkMode); + final out2Uri = tempUri.resolve('out1/'); + await Directory.fromUri(out2Uri).create(); + final lib1Uri = await buildLib( + out1Uri, + out2Uri, + target, + iosVersion, + linkMode, + ); final otoolResult = await runProcess( executable: Uri.file('otool'), @@ -190,6 +200,7 @@ void main() { Future buildLib( Uri tempUri, + Uri tempUri2, Architecture targetArchitecture, int targetIOSVersion, LinkMode linkMode, @@ -199,6 +210,7 @@ Future buildLib( final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: targetArchitecture, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index 389c4f5ba..9a3e42769 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -31,12 +31,14 @@ void main() { for (final target in targets) { test('CBuilder $linkMode library $target', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: target, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index 6856d334b..79ad82bd2 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -39,6 +39,7 @@ void main() { for (final target in targets) { test('CBuilder $linkMode $language library $target', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final sourceUri = switch (language) { Language.c => packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'), @@ -50,6 +51,7 @@ void main() { final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: target, @@ -104,7 +106,15 @@ void main() { final tempUri = await tempDirForTest(); final out1Uri = tempUri.resolve('out1/'); await Directory.fromUri(out1Uri).create(); - final lib1Uri = await buildLib(out1Uri, target, macosVersion, linkMode); + final out2Uri = tempUri.resolve('out2/'); + await Directory.fromUri(out1Uri).create(); + final lib1Uri = await buildLib( + out1Uri, + out2Uri, + target, + macosVersion, + linkMode, + ); final otoolResult = await runProcess( executable: Uri.file('otool'), @@ -120,6 +130,7 @@ void main() { Future buildLib( Uri tempUri, + Uri tempUri2, Architecture targetArchitecture, int targetMacOSVersion, LinkMode linkMode, @@ -129,6 +140,7 @@ Future buildLib( final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: targetArchitecture, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index 0af64e8c9..a68fa3ac9 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -50,12 +50,14 @@ void main() { for (final target in targets) { test('CBuilder $linkMode library $target', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetOS: OS.windows, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index 08f91df54..77e35132b 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -33,6 +33,7 @@ void main() { test('CBuilder executable$suffix', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final helloWorldCUri = packageUri .resolve('test/cbuilder/testfiles/hello_world/src/hello_world.c'); if (!await File.fromUri(helloWorldCUri).exists()) { @@ -45,6 +46,7 @@ void main() { final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -104,6 +106,7 @@ void main() { test('CBuilder dylib$suffix', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; @@ -114,6 +117,7 @@ void main() { final buildConfig = dryRun ? BuildConfig.dryRun( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -122,6 +126,7 @@ void main() { ) : BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -199,6 +204,7 @@ void main() { test('CBuilder flags', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final definesCUri = packageUri.resolve('test/cbuilder/testfiles/defines/src/defines.c'); if (!await File.fromUri(definesCUri).exists()) { @@ -211,6 +217,7 @@ void main() { final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -256,6 +263,7 @@ void main() { test('CBuilder includes', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final includeDirectoryUri = packageUri.resolve('test/cbuilder/testfiles/includes/include'); final includesHUri = packageUri @@ -266,6 +274,7 @@ void main() { final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -299,6 +308,7 @@ void main() { test('CBuilder std', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; const std = 'c99'; @@ -308,6 +318,7 @@ void main() { final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -351,6 +362,7 @@ void main() { test('CBuilder compile c++', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final helloWorldCppUri = packageUri.resolve( 'test/cbuilder/testfiles/hello_world_cpp/src/hello_world_cpp.cc'); if (!await File.fromUri(helloWorldCppUri).exists()) { @@ -364,6 +376,7 @@ void main() { final buildConfig = BuildConfig.build( buildMode: BuildMode.release, outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -412,6 +425,7 @@ void main() { test('CBuilder cppLinkStdLib', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final helloWorldCppUri = packageUri.resolve( 'test/cbuilder/testfiles/hello_world_cpp/src/hello_world_cpp.cc'); if (!await File.fromUri(helloWorldCppUri).exists()) { @@ -425,6 +439,7 @@ void main() { final buildConfig = BuildConfig.build( buildMode: BuildMode.release, outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -483,6 +498,7 @@ Future testDefines({ bool? customDefineWithValue, }) async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final definesCUri = packageUri.resolve('test/cbuilder/testfiles/defines/src/defines.c'); if (!await File.fromUri(definesCUri).exists()) { @@ -492,6 +508,7 @@ Future testDefines({ final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index 6c81c9455..86be27864 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -22,6 +22,7 @@ import '../helpers.dart'; void main() { test('Config provided compiler', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final ar = [ ...await appleAr.defaultResolver!.resolve(logger: logger), ...await msvc.lib.defaultResolver!.resolve(logger: logger), @@ -42,6 +43,7 @@ void main() { ].firstOrNull?.uri; final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: 'dummy', packageRoot: tempUri, targetArchitecture: Architecture.current, @@ -65,8 +67,10 @@ void main() { test('No compiler found', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: 'dummy', packageRoot: tempUri, targetArchitecture: Architecture.arm64, diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index 4d08cc4a8..50f725994 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -25,6 +25,7 @@ void main() { test('CBuilder compile objective c', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final addMUri = packageUri.resolve('test/cbuilder/testfiles/add_objective_c/src/add.m'); if (!await File.fromUri(addMUri).exists()) { @@ -38,6 +39,7 @@ void main() { final buildConfig = BuildConfig.build( buildMode: BuildMode.release, outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: Architecture.current, diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index 763ba1e44..e215afb44 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -11,6 +11,7 @@ import '../helpers.dart'; Future buildTestArchive( Uri tempUri, + Uri tempUri2, OS os, Architecture architecture, ) async { @@ -27,6 +28,7 @@ Future buildTestArchive( final buildConfig = BuildConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: name, packageRoot: tempUri, targetArchitecture: architecture, diff --git a/pkgs/native_toolchain_c/test/clinker/objects_test.dart b/pkgs/native_toolchain_c/test/clinker/objects_test.dart index 39ed0e041..22f30777a 100644 --- a/pkgs/native_toolchain_c/test/clinker/objects_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/objects_test.dart @@ -29,10 +29,12 @@ Future main() async { test('link two objects', () async { final linkOutput = LinkOutput(); final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); - final uri = await buildTestArchive(tempUri, os, architecture); + final uri = await buildTestArchive(tempUri, tempUri2, os, architecture); final linkConfig = LinkConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: 'testpackage', packageRoot: tempUri, targetArchitecture: architecture, diff --git a/pkgs/native_toolchain_c/test/clinker/throws_test.dart b/pkgs/native_toolchain_c/test/clinker/throws_test.dart index ac11d53af..e69a39f9c 100644 --- a/pkgs/native_toolchain_c/test/clinker/throws_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/throws_test.dart @@ -21,6 +21,7 @@ Future main() async { 'throws on some platforms', () async { final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); final cLinker = CLinker.library( name: 'mylibname', @@ -30,6 +31,7 @@ Future main() async { () => cLinker.run( config: LinkConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: 'testpackage', packageRoot: tempUri, targetArchitecture: Architecture.x64, diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart index 198b81822..3abc2339f 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart @@ -54,12 +54,19 @@ Future runTests(List architectures) async { test('link test with CLinker ${clinker.name} and target $architecture', () async { final tempUri = await tempDirForTest(); - final testArchive = await buildTestArchive(tempUri, os, architecture); + final tempUri2 = await tempDirForTest(); + final testArchive = await buildTestArchive( + tempUri, + tempUri2, + os, + architecture, + ); final linkOutput = LinkOutput(); final config = LinkConfig.build( outputDirectory: tempUri, + outputDirectoryShared: tempUri2, packageName: 'testpackage', packageRoot: tempUri, targetArchitecture: architecture, diff --git a/pkgs/native_toolchain_c/test/helpers.dart b/pkgs/native_toolchain_c/test/helpers.dart index 88db4640a..0756ba198 100644 --- a/pkgs/native_toolchain_c/test/helpers.dart +++ b/pkgs/native_toolchain_c/test/helpers.dart @@ -118,7 +118,8 @@ extension on Uri { String get name => pathSegments.where((e) => e != '').last; } -String unparseKey(String key) => key.replaceAll('.', '__').toUpperCase(); +String unparseKey(String key) => + 'DART_HOOK_TESTING_${key.replaceAll('.', '__').toUpperCase()}'; /// Archiver provided by the environment. /// diff --git a/pkgs/objective_c/CHANGELOG.md b/pkgs/objective_c/CHANGELOG.md index 9d7d9429d..e4b7851fb 100644 --- a/pkgs/objective_c/CHANGELOG.md +++ b/pkgs/objective_c/CHANGELOG.md @@ -1,6 +1,9 @@ ## 3.0.0-wip - Add `NSInputStream` and `NSStream` to the core package. +- Add `UnimplementedOptionalMethodException`, which is thrown by the ObjC + bindings if an optional method is invoked, and the instance doesn't implement + the method. ## 2.0.0 diff --git a/pkgs/objective_c/lib/src/internal.dart b/pkgs/objective_c/lib/src/internal.dart index 963a62a21..5a9b7054d 100644 --- a/pkgs/objective_c/lib/src/internal.dart +++ b/pkgs/objective_c/lib/src/internal.dart @@ -18,6 +18,15 @@ final class DoubleReleaseError extends StateError { DoubleReleaseError() : super('Double release error'); } +final class UnimplementedOptionalMethodException implements Exception { + String clazz; + String method; + UnimplementedOptionalMethodException(this.clazz, this.method); + + @override + String toString() => 'Instance of $clazz does not implement $method'; +} + /// Only for use by ffigen bindings. Pointer registerName(String name) { final cstr = name.toNativeUtf8(); @@ -84,6 +93,20 @@ final msgSendStretPointer = final useMsgSendVariants = Abi.current() == Abi.iosX64 || Abi.current() == Abi.macosX64; +/// Only for use by ffigen bindings. +bool respondsToSelector( + Pointer obj, Pointer sel) => + _objcMsgSendRespondsToSelector(obj, _selRespondsToSelector, sel); +final _selRespondsToSelector = registerName('respondsToSelector:'); +final _objcMsgSendRespondsToSelector = msgSendPointer + .cast< + NativeFunction< + Bool Function(Pointer, Pointer, + Pointer aSelector)>>() + .asFunction< + bool Function(Pointer, Pointer, + Pointer)>(); + // _FinalizablePointer exists because we can't access `this` in the initializers // of _ObjCReference's constructor, and we have to have an owner to attach the // Dart_FinalizableHandle to. Ideally _ObjCReference would be the owner. diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart index b6af0d57a..c16a59139 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart @@ -39,6 +39,8 @@ class MethodDeclaration ReferredType? returnType; + bool isStatic; + MethodDeclaration({ required this.id, required this.name, @@ -47,5 +49,6 @@ class MethodDeclaration this.typeParams = const [], this.hasObjCAnnotation = false, this.statements = const [], + this.isStatic = false, }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart index addac25d4..e14dfbd9f 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart @@ -26,6 +26,8 @@ class PropertyDeclaration implements Declaration, ObjCAnnotatable { ReferredType type; + bool isStatic; + PropertyDeclaration({ required this.id, required this.name, @@ -34,6 +36,7 @@ class PropertyDeclaration implements Declaration, ObjCAnnotatable { this.hasObjCAnnotation = false, this.getter, this.setter, + this.isStatic = false, }); } diff --git a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart index 61e8bad2e..da822b9b9 100644 --- a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart @@ -80,6 +80,10 @@ List _generateClassMethods(ClassDeclaration declaration) { header.write('@objc '); } + if (method.isStatic) { + header.write('static '); + } + header.write( 'public func ${method.name}(${generateParameters(method.params)})', ); diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index 01dfc769c..690d6050f 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -10,12 +10,12 @@ InitializerDeclaration parseInitializerDeclaration( ) { return InitializerDeclaration( id: parseSymbolId(initializerSymbolJson), - params: _parseInitializerParams(initializerSymbolJson, symbolgraph), + params: parseInitializerParams(initializerSymbolJson, symbolgraph), hasObjCAnnotation: symbolHasObjcAnnotation(initializerSymbolJson), ); } -List _parseInitializerParams( +List parseInitializerParams( Json initializerSymbolJson, ParsedSymbolgraph symbolgraph, ) { diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_method_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_method_declaration.dart index 357186a6e..2d88aa475 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_method_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_method_declaration.dart @@ -13,14 +13,16 @@ import '../parse_declarations.dart'; MethodDeclaration parseMethodDeclaration( Json methodSymbolJson, - ParsedSymbolgraph symbolgraph, -) { + ParsedSymbolgraph symbolgraph, { + bool isStatic = false, +}) { return MethodDeclaration( id: parseSymbolId(methodSymbolJson), name: parseSymbolName(methodSymbolJson), returnType: _parseMethodReturnType(methodSymbolJson, symbolgraph), params: _parseMethodParams(methodSymbolJson, symbolgraph), hasObjCAnnotation: symbolHasObjcAnnotation(methodSymbolJson), + isStatic: isStatic, ); } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_property_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_property_declaration.dart index 6a75321f6..f1315e296 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_property_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_property_declaration.dart @@ -8,14 +8,16 @@ import '../parse_declarations.dart'; PropertyDeclaration parsePropertyDeclaration( Json propertySymbolJson, - ParsedSymbolgraph symbolgraph, -) { + ParsedSymbolgraph symbolgraph, { + bool isStatic = false, +}) { return PropertyDeclaration( id: parseSymbolId(propertySymbolJson), name: parseSymbolName(propertySymbolJson), type: _parsePropertyType(propertySymbolJson, symbolgraph), hasObjCAnnotation: symbolHasObjcAnnotation(propertySymbolJson), hasSetter: _propertyHasSetter(propertySymbolJson), + isStatic: isStatic, ); } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart index cc5269ce5..9c9237f57 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart @@ -42,8 +42,14 @@ Declaration parseDeclaration( parsedSymbol.declaration = switch (symbolType) { 'swift.class' => parseClassDeclaration(symbolJson, symbolgraph), 'swift.struct' => parseStructDeclaration(symbolJson, symbolgraph), - 'swift.method' => parseMethodDeclaration(symbolJson, symbolgraph), - 'swift.property' => parsePropertyDeclaration(symbolJson, symbolgraph), + 'swift.method' => + parseMethodDeclaration(symbolJson, symbolgraph, isStatic: false), + 'swift.type.method' => + parseMethodDeclaration(symbolJson, symbolgraph, isStatic: true), + 'swift.property' => + parsePropertyDeclaration(symbolJson, symbolgraph, isStatic: false), + 'swift.type.property' => + parsePropertyDeclaration(symbolJson, symbolgraph, isStatic: true), 'swift.init' => parseInitializerDeclaration(symbolJson, symbolgraph), _ => throw Exception( 'Symbol of type $symbolType is not implemented yet.', diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_method.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_method.dart index 503502a70..6eec1bac7 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_method.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_method.dart @@ -49,6 +49,7 @@ MethodDeclaration transformMethod( returnType: transformedReturnType, params: transformedParams, hasObjCAnnotation: true, + isStatic: originalMethod.isStatic, ); transformedMethod.statements = _generateMethodStatements( @@ -92,8 +93,10 @@ List _generateMethodStatements( final arguments = argumentsList.join(', '); - final originalMethodCall = - '${wrappedClassInstance.name}.${originalMethod.name}($arguments)'; + final methodSource = originalMethod.isStatic + ? wrappedClassInstance.type.name + : wrappedClassInstance.name; + final originalMethodCall = '$methodSource.${originalMethod.name}($arguments)'; if (originalMethod.returnType == null) { return [originalMethodCall]; diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_property.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_property.dart index 163b73f33..6655eeb37 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_property.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_property.dart @@ -22,6 +22,7 @@ PropertyDeclaration transformProperty( hasSetter: originalProperty.hasSetter, type: transformedType, hasObjCAnnotation: true, + isStatic: originalProperty.isStatic, ); final getterStatements = _generateGetterStatements( @@ -54,12 +55,14 @@ List _generateGetterStatements( UniqueNamer globalNamer, TransformationMap transformationMap, ) { - final wrappedInstanceProperty = - '${wrappedClassInstance.name}.${originalProperty.name}'; + final propertySource = originalProperty.isStatic + ? wrappedClassInstance.type.name + : wrappedClassInstance.name; + final wrappedProperty = '$propertySource.${originalProperty.name}'; final (wrappedValue, wrapperType) = maybeWrapValue( originalProperty.type, - wrappedInstanceProperty, + wrappedProperty, globalNamer, transformationMap, ); @@ -76,8 +79,10 @@ List _generateSetterStatements( UniqueNamer globalNamer, TransformationMap transformationMap, ) { - final wrappedInstanceProperty = - '${wrappedClassInstance.name}.${originalProperty.name}'; + final propertySource = originalProperty.isStatic + ? wrappedClassInstance.type.name + : wrappedClassInstance.name; + final wrappedProperty = '$propertySource.${originalProperty.name}'; final (unwrappedValue, unwrappedType) = maybeUnwrapValue( transformedProperty.type, @@ -86,5 +91,5 @@ List _generateSetterStatements( assert(unwrappedType.id == originalProperty.type.id); - return ['$wrappedInstanceProperty = $unwrappedValue']; + return ['$wrappedProperty = $unwrappedValue']; } diff --git a/pkgs/swift2objc/test/integration/classes_and_static_methods_input.swift b/pkgs/swift2objc/test/integration/classes_and_static_methods_input.swift new file mode 100644 index 000000000..e50f2f352 --- /dev/null +++ b/pkgs/swift2objc/test/integration/classes_and_static_methods_input.swift @@ -0,0 +1,17 @@ +import Foundation + +public class MyClass { + static public func myMethod(label1 param1: Int, param2: MyOtherClass) -> MyOtherClass { + return MyOtherClass() + } + + static public func myMethod2() -> Void { + 1 + 1 + } + + static public func myMethod3() { + 1 + 1 + } +} + +public class MyOtherClass {} diff --git a/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift new file mode 100644 index 000000000..4a798ff59 --- /dev/null +++ b/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift @@ -0,0 +1,32 @@ +// Test preamble text + +import Foundation + +@objc public class MyOtherClassWrapper: NSObject { + var wrappedInstance: MyOtherClass + + init(_ wrappedInstance: MyOtherClass) { + self.wrappedInstance = wrappedInstance + } +} + +@objc public class MyClassWrapper: NSObject { + var wrappedInstance: MyClass + + init(_ wrappedInstance: MyClass) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper) -> MyOtherClassWrapper { + let result = MyClass.myMethod(label1: param1, param2: param2.wrappedInstance) + return MyOtherClassWrapper(result) + } + + @objc static public func myMethod2() -> Void { + return MyClass.myMethod2() + } + + @objc static public func myMethod3() { + MyClass.myMethod3() + } +} diff --git a/pkgs/swift2objc/test/integration/classes_and_static_properties_input.swift b/pkgs/swift2objc/test/integration/classes_and_static_properties_input.swift new file mode 100644 index 000000000..20942098a --- /dev/null +++ b/pkgs/swift2objc/test/integration/classes_and_static_properties_input.swift @@ -0,0 +1,31 @@ +import Foundation + +public class MyClass { + static public var customSetterVariable: MyOtherClass { + get { MyOtherClass() } + set { } + } + + static public var customGetterVariable: MyOtherClass { + get { MyOtherClass() } + } + + static public var customVariableProperty: MyOtherClass = MyOtherClass() + + static public let customConstantProperty: MyOtherClass = MyOtherClass() + + static public var representableSetterVariable: Int { + get { 1 } + set { } + } + + static public var representableGetterVariable: Int { + get { 1 } + } + + static public var representableVariableProperty: Int = 1 + + static public let representableConstantProperty: Int = 1 +} + +public class MyOtherClass {} diff --git a/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift b/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift new file mode 100644 index 000000000..cb6dd16c6 --- /dev/null +++ b/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift @@ -0,0 +1,79 @@ +// Test preamble text + +import Foundation + +@objc public class MyOtherClassWrapper: NSObject { + var wrappedInstance: MyOtherClass + + init(_ wrappedInstance: MyOtherClass) { + self.wrappedInstance = wrappedInstance + } +} + +@objc public class MyClassWrapper: NSObject { + var wrappedInstance: MyClass + + @objc public var customGetterVariable: MyOtherClassWrapper { + get { + MyOtherClassWrapper(MyClass.customGetterVariable) + } + } + + @objc public var customSetterVariable: MyOtherClassWrapper { + get { + MyOtherClassWrapper(MyClass.customSetterVariable) + } + set { + MyClass.customSetterVariable = newValue.wrappedInstance + } + } + + @objc public var customConstantProperty: MyOtherClassWrapper { + get { + MyOtherClassWrapper(MyClass.customConstantProperty) + } + } + + @objc public var customVariableProperty: MyOtherClassWrapper { + get { + MyOtherClassWrapper(MyClass.customVariableProperty) + } + set { + MyClass.customVariableProperty = newValue.wrappedInstance + } + } + + @objc public var representableGetterVariable: Int { + get { + MyClass.representableGetterVariable + } + } + + @objc public var representableSetterVariable: Int { + get { + MyClass.representableSetterVariable + } + set { + MyClass.representableSetterVariable = newValue + } + } + + @objc public var representableConstantProperty: Int { + get { + MyClass.representableConstantProperty + } + } + + @objc public var representableVariableProperty: Int { + get { + MyClass.representableVariableProperty + } + set { + MyClass.representableVariableProperty = newValue + } + } + + init(_ wrappedInstance: MyClass) { + self.wrappedInstance = wrappedInstance + } +} diff --git a/pkgs/swift2objc/test/integration/structs_and_static_methods_input.swift b/pkgs/swift2objc/test/integration/structs_and_static_methods_input.swift new file mode 100644 index 000000000..e1877b1e5 --- /dev/null +++ b/pkgs/swift2objc/test/integration/structs_and_static_methods_input.swift @@ -0,0 +1,17 @@ +import Foundation + +public struct MyStruct { + static public func myMethod(label1 param1: Int, param2: MyOtherStruct) -> MyOtherStruct { + return MyOtherStruct() + } + + static public func myMethod2() -> Void { + 1 + 1 + } + + static public func myMethod3() { + 1 + 1 + } +} + +public struct MyOtherStruct {} diff --git a/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift new file mode 100644 index 000000000..671a6088e --- /dev/null +++ b/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift @@ -0,0 +1,32 @@ +// Test preamble text + +import Foundation + +@objc public class MyOtherStructWrapper: NSObject { + var wrappedInstance: MyOtherStruct + + init(_ wrappedInstance: MyOtherStruct) { + self.wrappedInstance = wrappedInstance + } +} + +@objc public class MyStructWrapper: NSObject { + var wrappedInstance: MyStruct + + init(_ wrappedInstance: MyStruct) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper) -> MyOtherStructWrapper { + let result = MyStruct.myMethod(label1: param1, param2: param2.wrappedInstance) + return MyOtherStructWrapper(result) + } + + @objc static public func myMethod2() -> Void { + return MyStruct.myMethod2() + } + + @objc static public func myMethod3() { + MyStruct.myMethod3() + } +} diff --git a/pkgs/swift2objc/test/integration/structs_and_static_properties_input.swift b/pkgs/swift2objc/test/integration/structs_and_static_properties_input.swift new file mode 100644 index 000000000..6d03463db --- /dev/null +++ b/pkgs/swift2objc/test/integration/structs_and_static_properties_input.swift @@ -0,0 +1,31 @@ +import Foundation + +public struct MyStruct { + static public var customSetterVariable: MyOtherStruct { + get { MyOtherStruct() } + set { } + } + + static public var customGetterVariable: MyOtherStruct { + get { MyOtherStruct() } + } + + static public var customVariableProperty: MyOtherStruct = MyOtherStruct() + + static public let customConstantProperty: MyOtherStruct = MyOtherStruct() + + static public var representableSetterVariable: Int { + get { 1 } + set { } + } + + static public var representableGetterVariable: Int { + get { 1 } + } + + static public var representableVariableProperty: Int = 1 + + static public let representableConstantProperty: Int = 1 +} + +public struct MyOtherStruct {} diff --git a/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift b/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift new file mode 100644 index 000000000..ed417f169 --- /dev/null +++ b/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift @@ -0,0 +1,79 @@ +// Test preamble text + +import Foundation + +@objc public class MyOtherStructWrapper: NSObject { + var wrappedInstance: MyOtherStruct + + init(_ wrappedInstance: MyOtherStruct) { + self.wrappedInstance = wrappedInstance + } +} + +@objc public class MyStructWrapper: NSObject { + var wrappedInstance: MyStruct + + @objc public var customGetterVariable: MyOtherStructWrapper { + get { + MyOtherStructWrapper(MyStruct.customGetterVariable) + } + } + + @objc public var customSetterVariable: MyOtherStructWrapper { + get { + MyOtherStructWrapper(MyStruct.customSetterVariable) + } + set { + MyStruct.customSetterVariable = newValue.wrappedInstance + } + } + + @objc public var customConstantProperty: MyOtherStructWrapper { + get { + MyOtherStructWrapper(MyStruct.customConstantProperty) + } + } + + @objc public var customVariableProperty: MyOtherStructWrapper { + get { + MyOtherStructWrapper(MyStruct.customVariableProperty) + } + set { + MyStruct.customVariableProperty = newValue.wrappedInstance + } + } + + @objc public var representableGetterVariable: Int { + get { + MyStruct.representableGetterVariable + } + } + + @objc public var representableSetterVariable: Int { + get { + MyStruct.representableSetterVariable + } + set { + MyStruct.representableSetterVariable = newValue + } + } + + @objc public var representableConstantProperty: Int { + get { + MyStruct.representableConstantProperty + } + } + + @objc public var representableVariableProperty: Int { + get { + MyStruct.representableVariableProperty + } + set { + MyStruct.representableVariableProperty = newValue + } + } + + init(_ wrappedInstance: MyStruct) { + self.wrappedInstance = wrappedInstance + } +} diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_input.json b/pkgs/swift2objc/test/unit/parse_initializer_param_input.json new file mode 100644 index 000000000..d5fbdfd6d --- /dev/null +++ b/pkgs/swift2objc/test/unit/parse_initializer_param_input.json @@ -0,0 +1,73 @@ +[ + { + "testName": "Two params with one internal name", + "inputJson": { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "outerLabel" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "representableProperty" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ", " }, + { "kind": "externalParam", "spelling": "customProperty" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] + }, + "outputParams": [ + { + "name": "outerLabel", + "internalName": "representableProperty", + "typeId": "s:Si" + }, + { + "name": "customProperty", + "typeId": "s:Si" + } + ] + }, + { + "testName": "One param", + "inputJson": { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "property" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] + }, + "outputParams": [ + { + "name": "property", + "typeId": "s:Si" + } + ] + }, + { + "testName": "No params", + "inputJson": { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "()" } + ] + }, + "outputParams": [] + } +] diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart b/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart new file mode 100644 index 000000000..05693aa35 --- /dev/null +++ b/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart @@ -0,0 +1,204 @@ +import 'dart:convert'; + +import 'package:swift2objc/src/ast/_core/interfaces/declaration.dart'; +import 'package:swift2objc/src/ast/_core/shared/parameter.dart'; +import 'package:swift2objc/src/ast/declarations/built_in/built_in_declaration.dart'; +import 'package:swift2objc/src/parser/_core/json.dart'; +import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; +import 'package:swift2objc/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart'; +import 'package:test/test.dart'; + +void main() { + final parsedSymbols = { + for (final decl in BuiltInDeclaration.values) + decl.id: ParsedSymbol(json: Json(null), declaration: decl) + }; + final emptySymbolgraph = ParsedSymbolgraph(parsedSymbols, {}); + group('Valid json', () { + void expectEqualParams( + List actualParams, + List expectedParams, + ) { + expect(actualParams.length, expectedParams.length); + + for (var i = 0; i < actualParams.length; i++) { + final actualParam = actualParams[i]; + final expectedParam = expectedParams[i]; + + expect(actualParam.name, expectedParam.name); + expect(actualParam.internalName, expectedParam.internalName); + expect(actualParam.type.id, expectedParam.type.id); + } + } + + test('Two params with one internal name', () { + final json = Json(jsonDecode( + ''' + { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "outerLabel" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "internalLabel" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ", " }, + { "kind": "externalParam", "spelling": "singleLabel" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] + } + ''', + )); + + final outputParams = parseInitializerParams(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'outerLabel', + internalName: 'internalLabel', + type: BuiltInDeclaration.swiftInt.asDeclaredType, + ), + Parameter( + name: 'singleLabel', + type: BuiltInDeclaration.swiftInt.asDeclaredType, + ), + ]; + + expectEqualParams(outputParams, expectedParams); + }); + test('One param', () { + final json = Json(jsonDecode( + ''' + { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] + } + ''', + )); + + final outputParams = parseInitializerParams(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'parameter', + type: BuiltInDeclaration.swiftInt.asDeclaredType, + ), + ]; + + expectEqualParams(outputParams, expectedParams); + }); + + test('No params', () { + final json = Json(jsonDecode( + ''' + { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "()" } + ] + } + ''', + )); + + final outputParams = parseInitializerParams(json, emptySymbolgraph); + + expectEqualParams(outputParams, []); + }); + }); + + group('Invalid json', () { + test('Parameter with no outer label', () { + final json = Json(jsonDecode( + ''' + { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "internalParam", "spelling": "internalLabel" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] + } + ''', + )); + + expect( + () => parseInitializerParams(json, emptySymbolgraph), + throwsA(isA()), + ); + }); + + test('Parameter with no type', () { + final json = Json(jsonDecode( + ''' + { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "outerLabel" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "internalLabel" }, + { "kind": "text", "spelling": ")" } + ] + } + ''', + )); + + expect( + () => parseInitializerParams(json, emptySymbolgraph), + throwsA(isA()), + ); + }); + + test('Parameter with just a type (no label)', () { + final json = Json(jsonDecode( + ''' + { + "declarationFragments": [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] + } + ''', + )); + + expect( + () => parseInitializerParams(json, emptySymbolgraph), + throwsA(isA()), + ); + }); + }); +}