Language

JniEnvironment.StaticFields.GetStaticFieldID Method

Definition

Overloads

Name Description
GetStaticFieldID(JniObjectReference, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Looks up a JNI static field ID using null-terminated UTF-8 name and signature spans. Use with "fieldName"u8 literals to avoid string marshalling overhead.

GetStaticFieldID(JniObjectReference, String, String)

Resolves a JNI static field identifier.

GetStaticFieldID(JniObjectReference, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Looks up a JNI static field ID using null-terminated UTF-8 name and signature spans. Use with "fieldName"u8 literals to avoid string marshalling overhead.

public static Java.Interop.JniFieldInfo GetStaticFieldID(Java.Interop.JniObjectReference type, ReadOnlySpan<byte> name, ReadOnlySpan<byte> signature);
static member GetStaticFieldID : Java.Interop.JniObjectReference * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> Java.Interop.JniFieldInfo

Parameters

type
JniObjectReference

A valid reference to the Java class used for field lookup.

name
ReadOnlySpan<Byte>

The zero-terminated Java field name encoded as modified UTF-8.

signature
ReadOnlySpan<Byte>

The zero-terminated JNI field descriptor encoded as modified UTF-8.

Returns

Valid JNI field information for the static field.

Remarks

Both spans must include terminating zero bytes. Their bytes are passed to JNI without transcoding or length arguments. A pending Java exception from lookup is converted to a managed exception.

Applies to

GetStaticFieldID(JniObjectReference, String, String)

Resolves a JNI static field identifier.

public static Java.Interop.JniFieldInfo GetStaticFieldID(Java.Interop.JniObjectReference type, string name, string signature);
static member GetStaticFieldID : Java.Interop.JniObjectReference * string * string -> Java.Interop.JniFieldInfo

Parameters

type
JniObjectReference

A valid reference to the Java class used for field lookup.

name
String

The Java field name.

signature
String

The JNI field descriptor.

Returns

Valid JNI field information for the static field.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to