-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java.Interop] Move JniRuntime type-related methods to JniTypeManager
In keeping with the principal of commit 6a42bb8 -- reduce API surface area, or at least organize into reasonable sections -- move the 5 JniRuntime methods that deal with JNI type signature :: System.Type mapping and move them into the new (nested) JniRuntime.JniTypeManager type. An instance of JniRuntime.JniTypeManager is available from the new JniRuntime.TypeManager property, permitting use such as: JniTypeSignature signature = runtime.TypeManager.GetTypeSignature ("[I"); Type type = runtime.TypeManager.GetType (signature); Additionally, since type mapping is always "iffy" [0], add additional JniRuntime.JniTypeManager method overloads which permit returning more than one possible mapping: partial class JniTypeManager { public IEnumerable<JniTypeSignature> GetTypeSignatures (Type type); public IEnumerable<Type> GetTypes (JniTypeSignature typeSignature); } Convenience "overloads" which return a single mapping are also present, which merely return .FirstOrDefault() on the above methods. [0]: How should an `int[]` marshal to Java? (a) As an `int[]`, a'la Xamarin.Android (b) As a JavaInt32Array (c) As a JavaPrimitiveArray<int> (d) As a JavaObjectArray<int> All of these are plausible, depending on the situation, and we should arguably support *all* of them, but means that the mapping is inherently ambiguous.
- Loading branch information
Showing
19 changed files
with
740 additions
and
629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.