Table of Contents

Interface IJavaType

Namespace
MASES.JCOBridge.C2JBridge.JVMInterop
Assembly
C2JBridge.dll

Generic interface for all types implemented

public interface IJavaType : IDisposable
Inherited Members
Extension Methods

Properties

IsArray

true if the IJavaType is an array

bool IsArray { get; }

Property Value

bool

IsPrimitiveConvertible

true if the IJavaType is primitive convertible, i.e. it is bool, byte, ... and string

bool IsPrimitiveConvertible { get; }

Property Value

bool

IsRawPrimitive

true if the IJavaType is a raw primitive type, i.e. it is boolean, byte, and so on

bool IsRawPrimitive { get; }

Property Value

bool

JniClassName

The name in the JNI form

string JniClassName { get; }

Property Value

string

Name

The type name

string Name { get; }

Property Value

string

SuperClass

The superclass IJavaType of this IJavaType

IJavaType SuperClass { get; }

Property Value

IJavaType

Methods

GetField(string)

Gets a static field

object GetField(string fieldName)

Parameters

fieldName string

The field name to get

Returns

object

The field value

GetField<TReturn>(string)

Gets a static field

TReturn GetField<TReturn>(string fieldName)

Parameters

fieldName string

The field name to get

Returns

TReturn

The field value

Type Parameters

TReturn

The return type expected: IJavaObject, Enum or primitive types

Invoke(string, params object[])

Invokes a static member on this IJavaType using methodName and search criteria based on args

object Invoke(string methodName, params object[] args)

Parameters

methodName string

The method to invoke

args object[]

The arguments to pass to the method

Returns

object

The return value of Invoke(string, params object[])

InvokeWithSignature(string, string, params object[])

Invokes a static member on this IJavaType using methodName and search criteria based on signature

object InvokeWithSignature(string methodName, string signature, params object[] args)

Parameters

methodName string

The method name to invoke

signature string

The method signature to be used

args object[]

The arguments to pass to the method

Returns

object

The return value of InvokeWithSignature(string, string, params object[])

InvokeWithSignature<TReturn>(string, string, params object[])

Invokes a static member on this IJavaType using methodName and search criteria based on signature

TReturn InvokeWithSignature<TReturn>(string methodName, string signature, params object[] args)

Parameters

methodName string

The method name to invoke

signature string

The method signature to be used

args object[]

The arguments to pass to the method

Returns

TReturn

The return value of InvokeWithSignature<TReturn>(string, string, params object[])

Type Parameters

TReturn

The return type expected: IJavaObject, Enum, primitive types or array of primitives types

Invoke<TReturn>(string, params object[])

Invokes a static member on this IJavaType using methodName and search criteria based on args

TReturn Invoke<TReturn>(string methodName, params object[] args)

Parameters

methodName string

The method to invoke

args object[]

The arguments to pass to the method

Returns

TReturn

The return value of Invoke<TReturn>(string, params object[])

Type Parameters

TReturn

The return type expected: IJavaObject, Enum, primitive types or array of primitives types

New(params object[])

Creates a new object of this IJavaType with search criteria based on args

IJavaObject New(params object[] args)

Parameters

args object[]

The arguments for the constructor

Returns

IJavaObject

An instance of IJavaObject

NewWithSignature(string, params object[])

Creates a new object of this IJavaType with search criteria based on signature

IJavaObject NewWithSignature(string signature, params object[] args)

Parameters

signature string

The constructor signature to be used

args object[]

The arguments for the constructor

Returns

IJavaObject

An instance of IJavaObject

SetField(string, object)

Sets a static field

void SetField(string fieldName, object val)

Parameters

fieldName string

The field name

val object

The value to set on the field