Table of Contents

Class JVMBridgeBase<TClass>

Namespace
MASES.JCOBridge.C2JBridge
Assembly
C2JBridge.dll

Public entry point of JVMBridgeBase<TClass>

public abstract class JVMBridgeBase<TClass> : JVMBridgeBase, IDynamicMetaObjectProvider, IJVMBridgeCore, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeDefinition where TClass : IJVMBridgeBase, new()

Type Parameters

TClass

A class inherited from JVMBridgeBase<TClass>

Inheritance
JVMBridgeBase<TClass>
Implements
Derived
Inherited Members
Extension Methods

Examples

This is a basic example showing JVMBridgeBase<TClass> class usage

class TheClass : JVMBridgeBase<TheClass>
{
    public override string BridgeClassName => "org.company.TheClass";

    public TheClass()
    {
    }
}

Constructors

JVMBridgeBase(params object[])

Used to create instance of BridgeClassName

public JVMBridgeBase(params object[] args)

Parameters

args object[]

The arguments of constructor

Properties

BridgeClazz

The IJavaType of the implementing class

public static IJavaType BridgeClazz { get; }

Property Value

IJavaType

DynBridgeClazz

The dynamic accessor to BridgeClazz

public static dynamic DynBridgeClazz { get; }

Property Value

dynamic

Methods

Execute<T>(params T[])

Executes the code

public override void Execute<T>(params T[] args)

Parameters

args T[]

Possible arguments

Type Parameters

T

The argument type to be used

IsAssignableFrom(IJavaType)

Verify if this IJVMBridgeBase is assignable from clazz

public bool IsAssignableFrom(IJavaType clazz)

Parameters

clazz IJavaType

The IJavaType to be checked

Returns

bool

true if this IJavaType is assignable from clazz, otherwise false

IsAssignableFrom(string)

Verify if this IJVMBridgeBase is assignable from clazz

public bool IsAssignableFrom(string clazz)

Parameters

clazz string

The class name to be checked

Returns

bool

true if this class name is assignable from clazz, otherwise false

IsAssignableFrom<T>()

Verify if this IJVMBridgeBase is assignable from T

public bool IsAssignableFrom<T>() where T : IJVMBridgeBase, new()

Returns

bool

true if this IJavaType is assignable from T, otherwise false

Type Parameters

T

A type implementing IJVMBridgeBase

New(params object[])

Create a new instance of the TClass

public static TClass New(params object[] args)

Parameters

args object[]

Arguments to the constructor

Returns

TClass

The instantiated TClass

NewWithSignature(string, params object[])

Create a new instance of the TClass

public static TClass NewWithSignature(string signature, params object[] args)

Parameters

signature string

The JNI constructor signature to be used

args object[]

Arguments to the constructor

Returns

TClass

The instantiated TClass

SExecute(IJavaType, string, params object[])

Executes a static method

public static object SExecute(IJavaType clazz, string methodName, params object[] args)

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

object

The result of execution. Void functions returns null.

SExecute(string, params object[])

Executes a static method

public static object SExecute(string methodName, params object[] args)

Parameters

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

object

The result of execution. Void functions returns null.

SExecute(Type, IJavaType, string, params object[])

Executes a static method which returns a bridged class

public static IJVMBridgeBase SExecute(Type type, IJavaType clazz, string methodName, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

IJVMBridgeBase

A newly initialized type or null

SExecute(Type, string, params object[])

Executes a static method which returns a bridged class

public static IJVMBridgeBase SExecute(Type type, string methodName, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

IJVMBridgeBase

A newly initialized type or null

SExecuteArray<T>(IJavaType, string, params object[])

Execute the method and build the result as an array of T

public static T[] SExecuteArray<T>(IJavaType clazz, string methodName, params object[] args)

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The method to execute

args object[]

The aruments

Returns

T[]

An array of T

Type Parameters

T

The expected result Type

SExecuteArray<T>(string, params object[])

Execute the method and build the result as an array of T

public static T[] SExecuteArray<T>(string methodName, params object[] args)

Parameters

methodName string

The method to execute

args object[]

The aruments

Returns

T[]

An array of T

Type Parameters

T

The expected result Type

SExecuteWithSignature(IJavaType, string, string, params object[])

Executes a static method

public static object SExecuteWithSignature(IJavaType clazz, string methodName, string signature, params object[] args)

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

object

The result of execution. Void functions returns null.

SExecuteWithSignature(string, string, params object[])

Executes a static method

public static object SExecuteWithSignature(string methodName, string signature, params object[] args)

Parameters

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

object

The result of execution. Void functions returns null.

SExecuteWithSignature(Type, IJavaType, string, string, params object[])

Executes a static method which returns a bridged class

public static IJVMBridgeBase SExecuteWithSignature(Type type, IJavaType clazz, string methodName, string signature, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

IJVMBridgeBase

A newly initialized type or null

SExecuteWithSignature(Type, string, string, params object[])

Executes a static method which returns a bridged class

public static IJVMBridgeBase SExecuteWithSignature(Type type, string methodName, string signature, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

IJVMBridgeBase

A newly initialized type or null

SExecuteWithSignatureArray<T>(IJavaType, string, string, params object[])

Execute the method and build the result as an array of T

public static T[] SExecuteWithSignatureArray<T>(IJavaType clazz, string methodName, string signature, params object[] args)

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The method to execute

signature string

Method signature to use in search criteria

args object[]

The aruments

Returns

T[]

An array of T

Type Parameters

T

The expected result Type

SExecuteWithSignatureArray<T>(string, string, params object[])

Execute the method and build the result as an array of T

public static T[] SExecuteWithSignatureArray<T>(string methodName, string signature, params object[] args)

Parameters

methodName string

The method to execute

signature string

Method signature to use in search criteria

args object[]

The aruments

Returns

T[]

An array of T

Type Parameters

T

The expected result Type

SExecuteWithSignature<TReturn>(IJavaType, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TReturn>(IJavaType clazz, string methodName, string signature, params object[] args)

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The argument type to be used

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

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TReturn>(string methodName, string signature, params object[] args)

Parameters

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The argument type to be used

SExecuteWithSignature<TReturn>(Type, IJavaType, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TReturn>(Type type, IJavaType clazz, string methodName, string signature, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecuteWithSignature<TReturn>(Type, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TReturn>(Type type, string methodName, string signature, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecuteWithSignature<TNewClass, TReturn>(IJavaType, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TNewClass, TReturn>(IJavaType clazz, string methodName, string signature, params object[] args) where TNewClass : IJVMBridgeBase, TReturn

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecuteWithSignature<TNewClass, TReturn>(string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TNewClass, TReturn>(string methodName, string signature, params object[] args) where TNewClass : IJVMBridgeBase, TReturn

Parameters

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecuteWithSignature<TReturn, TConverter>(Type, IJavaType, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TReturn, TConverter>(Type type, IJavaType clazz, string methodName, string signature, params object[] args) where TConverter : IJVMBridgeBaseConvert<object, TReturn>, new()

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from instance of type to TReturn

SExecuteWithSignature<TReturn, TConverter>(Type, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TReturn, TConverter>(Type type, string methodName, string signature, params object[] args) where TConverter : IJVMBridgeBaseConvert<object, TReturn>, new()

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from instance of type to TReturn

SExecuteWithSignature<TNewClass, TReturn, TConverter>(IJavaType, string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TNewClass, TReturn, TConverter>(IJavaType clazz, string methodName, string signature, params object[] args) where TNewClass : IJVMBridgeBase where TConverter : IJVMBridgeBaseConvert<TNewClass, TReturn>, new()

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from TNewClass to TReturn

SExecuteWithSignature<TNewClass, TReturn, TConverter>(string, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecuteWithSignature<TNewClass, TReturn, TConverter>(string methodName, string signature, params object[] args) where TNewClass : IJVMBridgeBase where TConverter : IJVMBridgeBaseConvert<TNewClass, TReturn>, new()

Parameters

methodName string

The instance method to be invoked

signature string

Method signature to use in search criteria

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from TNewClass to TReturn

SExecute<TReturn>(IJavaType, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TReturn>(IJavaType clazz, string methodName, params object[] args)

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The argument type to be used

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

Executes a static method which returns a bridged class

public static TReturn SExecute<TReturn>(string methodName, params object[] args)

Parameters

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The argument type to be used

SExecute<TReturn>(Type, IJavaType, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TReturn>(Type type, IJavaType clazz, string methodName, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecute<TReturn>(Type, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TReturn>(Type type, string methodName, params object[] args)

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecute<TNewClass, TReturn>(IJavaType, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TNewClass, TReturn>(IJavaType clazz, string methodName, params object[] args) where TNewClass : IJVMBridgeBase, TReturn

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecute<TNewClass, TReturn>(string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TNewClass, TReturn>(string methodName, params object[] args) where TNewClass : IJVMBridgeBase, TReturn

Parameters

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

SExecute<TReturn, TConverter>(Type, IJavaType, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TReturn, TConverter>(Type type, IJavaType clazz, string methodName, params object[] args) where TConverter : IJVMBridgeBaseConvert<object, TReturn>, new()

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from instance of type to TReturn

SExecute<TReturn, TConverter>(Type, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TReturn, TConverter>(Type type, string methodName, params object[] args) where TConverter : IJVMBridgeBaseConvert<object, TReturn>, new()

Parameters

type Type

The Type implementing IJVMBridgeBase to be instantiated

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from instance of type to TReturn

SExecute<TNewClass, TReturn, TConverter>(IJavaType, string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TNewClass, TReturn, TConverter>(IJavaType clazz, string methodName, params object[] args) where TNewClass : IJVMBridgeBase where TConverter : IJVMBridgeBaseConvert<TNewClass, TReturn>, new()

Parameters

clazz IJavaType

The IJavaType where the method shall be executed

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from TNewClass to TReturn

SExecute<TNewClass, TReturn, TConverter>(string, params object[])

Executes a static method which returns a bridged class

public static TReturn SExecute<TNewClass, TReturn, TConverter>(string methodName, params object[] args) where TNewClass : IJVMBridgeBase where TConverter : IJVMBridgeBaseConvert<TNewClass, TReturn>, new()

Parameters

methodName string

The instance method to be invoked

args object[]

Possible arguments

Returns

TReturn

The initilized TReturn or null

Type Parameters

TNewClass

The argument type to be used

TReturn

The return type: in some condition can be helpful to return a different TReturn

TConverter

The converter to be used to convert from TNewClass to TReturn

SGetField(IJavaType, string)

Gets the value of a static field on clazz identified by fieldName

public static object SGetField(IJavaType clazz, string fieldName)

Parameters

clazz IJavaType

The IJavaType where the field shall be get

fieldName string

The field name to get

Returns

object

The field value

SGetField(string)

Gets the value of a static field identified by fieldName

public static object SGetField(string fieldName)

Parameters

fieldName string

The field name to get

Returns

object

The field value

SGetFieldArray<TReturn>(IJavaType, string)

Gets the value of a static field on clazz identified by fieldName

public static TReturn[] SGetFieldArray<TReturn>(IJavaType clazz, string fieldName)

Parameters

clazz IJavaType

The IJavaType where the field shall be get

fieldName string

The field name to get

Returns

TReturn[]

The field value

Type Parameters

TReturn

The return type expected: a type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types

SGetFieldArray<TReturn>(string)

Gets the value of a static field identified by fieldName

public static TReturn[] SGetFieldArray<TReturn>(string fieldName)

Parameters

fieldName string

The field name to get

Returns

TReturn[]

The field value

Type Parameters

TReturn

The return type expected: a type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types

SGetField<TReturn>(IJavaType, string)

Gets the value of a static field on clazz identified by fieldName

public static TReturn SGetField<TReturn>(IJavaType clazz, string fieldName)

Parameters

clazz IJavaType

The IJavaType where the field shall be get

fieldName string

The field name to get

Returns

TReturn

The field value

Type Parameters

TReturn

The return type expected: a type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types

SGetField<TReturn>(string)

Gets the value of a static field identified by fieldName

public static TReturn SGetField<TReturn>(string fieldName)

Parameters

fieldName string

The field name to get

Returns

TReturn

The field value

Type Parameters

TReturn

The return type expected: a type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types

SSetField(IJavaType, string, object)

Sets the value of a static field on clazz identified by fieldName

public static void SSetField(IJavaType clazz, string fieldName, object val)

Parameters

clazz IJavaType

The IJavaType where the field shall be set

fieldName string

The field name to set

val object

The value to set on the field

SSetField(string, object)

Sets the value of a static field identified by fieldName

public static void SSetField(string fieldName, object val)

Parameters

fieldName string

The field name to set

val object

The value to set on the field

SSetField<TValue>(IJavaType, string, TValue)

Sets the value of a static field on clazz identified by fieldName

public static void SSetField<TValue>(IJavaType clazz, string fieldName, TValue val)

Parameters

clazz IJavaType

The IJavaType where the field shall be set

fieldName string

The field name to set

val TValue

The value to set on the field

Type Parameters

TValue

A type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types

SSetField<TValue>(string, TValue)

Sets the value of a static field identified by fieldName

public static void SSetField<TValue>(string fieldName, TValue val)

Parameters

fieldName string

The field name to set

val TValue

The value to set on the field

Type Parameters

TValue

A type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types