JniRuntime.ReflectionJniValueManager.CreatePeer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Finds and constructs a compatible managed wrapper for a Java object.
public override Java.Interop.IJavaPeerable? CreatePeer(ref Java.Interop.JniObjectReference reference, Java.Interop.JniObjectReferenceOptions transfer, Type? targetType);
override this.CreatePeer : JniObjectReference * Java.Interop.JniObjectReferenceOptions * Type -> Java.Interop.IJavaPeerable
Parameters
- reference
- JniObjectReference
The JNI reference whose Java type is checked before wrapper creation.
- transfer
- JniObjectReferenceOptions
Source-reference transfer options for activation.
- targetType
- Type
The requested peer type; null selects JavaObject.
Returns
The constructed replaceable peer, or null for a zero reference or incompatible Java type.
Remarks
Missing type mappings or activation constructors can throw instead of returning null.