Click or drag to resize

IJavaObjectGetFieldTReturn(String) Method

Reads the value of an instance field on the underlying JVM object and casts it to TReturn.

Namespace: MASES.JCOBridge.C2JBridge.JVMInterop
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.6.10.261112-5ffe0920c00dbac056780af7ab9b1978b26ef4a5
Syntax
TReturn GetField<TReturn>(
	string fieldName
)

Parameters

fieldName  String
The name of the Java instance field to read.

Type Parameters

TReturn
The expected field type. Supported types: IJavaObject or any derived interface/class, .NET primitive types, Enum, and arrays of primitive types.

Return Value

TReturn
The field value cast to TReturn.
Exceptions
ExceptionCondition
InvalidOperationException Thrown if no field named fieldName is found on the underlying Java class.
InvalidCastException Thrown if the actual field value cannot be cast to TReturn.
See Also