Class JVMBridgeBase<TClass>
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
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
Returns
IsAssignableFrom(string)
Verify if this IJVMBridgeBase is assignable from clazz
public bool IsAssignableFrom(string clazz)
Parameters
clazz
stringThe class name to be checked
Returns
IsAssignableFrom<T>()
Verify if this IJVMBridgeBase is assignable from T
public bool IsAssignableFrom<T>() where T : IJVMBridgeBase, new()
Returns
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
stringThe 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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
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
TypeThe Type implementing IJVMBridgeBase to be instantiated
clazz
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
methodName
stringThe 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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
stringThe instance method to be invoked
signature
stringMethod 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
clazz
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
methodName
stringThe instance method to be invoked
signature
stringMethod 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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe method to execute
signature
stringMethod 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
stringThe method to execute
signature
stringMethod 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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
stringThe instance method to be invoked
signature
stringMethod 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
clazz
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
methodName
stringThe instance method to be invoked
signature
stringMethod 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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
stringThe instance method to be invoked
signature
stringMethod 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
clazz
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
toTReturn
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
TypeThe Type implementing IJVMBridgeBase to be instantiated
methodName
stringThe instance method to be invoked
signature
stringMethod 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
toTReturn
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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe instance method to be invoked
signature
stringMethod 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
toTReturn
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
stringThe instance method to be invoked
signature
stringMethod 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
toTReturn
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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
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
TypeThe Type implementing IJVMBridgeBase to be instantiated
clazz
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
TypeThe Type implementing IJVMBridgeBase to be instantiated
methodName
stringThe 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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
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
TypeThe Type implementing IJVMBridgeBase to be instantiated
clazz
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
toTReturn
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
TypeThe Type implementing IJVMBridgeBase to be instantiated
methodName
stringThe 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
toTReturn
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
IJavaTypeThe IJavaType where the method shall be executed
methodName
stringThe 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
toTReturn
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
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
toTReturn
SGetField(IJavaType, string)
Gets the value of a static field on clazz
identified by fieldName
public static object SGetField(IJavaType clazz, string fieldName)
Parameters
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
stringThe 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
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
stringThe 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
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
stringThe 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
IJavaTypeThe IJavaType where the field shall be set
fieldName
stringThe field name to set
val
objectThe 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
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
IJavaTypeThe IJavaType where the field shall be set
fieldName
stringThe field name to set
val
TValueThe 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
stringThe field name to set
val
TValueThe value to set on the field
Type Parameters
TValue
A type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types