Language

JniRuntime.ReflectionJniValueManager.CreateValueCore Method

Definition

Overloads

Name Description
CreateValueCore(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a managed value using peer, proxy, or selected value-marshaler conversion.

CreateValueCore<T>(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a typed managed value after validating the requested target type.

CreateValueCore(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a managed value using peer, proxy, or selected value-marshaler conversion.

protected override object? CreateValueCore(ref Java.Interop.JniObjectReference reference, Java.Interop.JniObjectReferenceOptions options, Type? targetType = default);
override this.CreateValueCore : JniObjectReference * Java.Interop.JniObjectReferenceOptions * Type -> obj

Parameters

reference
JniObjectReference

The source JNI reference to convert.

options
JniObjectReferenceOptions

Source-reference transfer options.

targetType
Type

The optional managed target type; otherwise, the runtime type is used.

Returns

The converted value, or null for a zero JNI reference.

Remarks

A known managed proxy can be unwrapped and converted with Convert.ChangeType.

Applies to

CreateValueCore<T>(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a typed managed value after validating the requested target type.

protected override T CreateValueCore<T>(ref Java.Interop.JniObjectReference reference, Java.Interop.JniObjectReferenceOptions options, Type? targetType = default);
override this.CreateValueCore : JniObjectReference * Java.Interop.JniObjectReferenceOptions * Type -> 'T

Type Parameters

T

The managed result type.

Parameters

reference
JniObjectReference

The source JNI reference to convert.

options
JniObjectReferenceOptions

Source-reference transfer options.

targetType
Type

The requested compatible runtime target, or typeof(T) when null.

Returns

T

The converted typed value, or default(T) for a zero reference.

Remarks

A targetType not assignable to T causes ArgumentException.

Applies to