Class JVMBridgeBase<TClass>
Public entry point of JVMBridgeBase<TClass>
public abstract class JVMBridgeBase<TClass> : JVMBridgeBase, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBase>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeDefinition where TClass : IJVMBridgeBase, new()
Type Parameters
TClassA 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(IJVMBridgeBaseInitializer)
Initializer used internally
public JVMBridgeBase(IJVMBridgeBaseInitializer initializer)
Parameters
initializerIJVMBridgeBaseInitializerAn instance of IJVMBridgeBaseInitializer
Remarks
Shall be available in any class inherited from JVMBridgeBase
JVMBridgeBase(params object[])
Used to create instance of IJVMBridgeBase
public JVMBridgeBase(params object[] args)
Parameters
argsobject[]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
argsT[]Possible arguments
Type Parameters
TThe 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
clazzstringThe 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
TA type implementing IJVMBridgeBase
New(params object[])
Create a new instance of the TClass
public static TClass New(params object[] args)
Parameters
argsobject[]Arguments to the constructor
Returns
- TClass
The instantiated
TClass
NewAndWrapsDirect<TNewClass>(string, params object[])
Wraps a new instance of the TNewClass after execution of New(string, params object[])
public static TNewClass NewAndWrapsDirect<TNewClass>(string className, params object[] args) where TNewClass : IJVMBridgeBase, new()
Parameters
classNamestringThe class name in the dot or slash form (example are java.lang.Boolean or java/lang/Boolean)
argsobject[]The argument for the class constructor
Returns
- TNewClass
The instantiated
TNewClass
Type Parameters
TNewClassThe class implementing IJVMBridgeBase
NewWithSignature(string, params object[])
Create a new instance of the TClass
public static TClass NewWithSignature(string signature, params object[] args)
Parameters
signaturestringThe JNI constructor signature to be used
argsobject[]Arguments to the constructor
Returns
- TClass
The instantiated
TClass
NewWithSignatureAndWrapsDirect<TNewClass>(string, string, params object[])
Wraps a new instance of the TNewClass after execution of NewWithSignature(string, string, params object[])
public static TNewClass NewWithSignatureAndWrapsDirect<TNewClass>(string className, string signature, params object[] args) where TNewClass : IJVMBridgeBase, new()
Parameters
classNamestringThe class name in the dot or slash form (example are java.lang.Boolean or java/lang/Boolean)
signaturestringThe JNI constructor signature to be used
argsobject[]The argument for the class constructor
Returns
- TNewClass
The instantiated
TNewClass
Type Parameters
TNewClassThe class implementing IJVMBridgeBase
SExecute(IJavaType, string, params object[])
Executes a static method
public static object SExecute(IJavaType clazz, string methodName, params object[] args)
Parameters
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- IJVMBridgeBase
A newly initialized
typeor 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- IJVMBridgeBase
A newly initialized
typeor null
SExecuteArray<TArrayType>(IJavaType, string, params object[])
Execute the method and build the result as an array of TArrayType
public static TArrayType[] SExecuteArray<TArrayType>(IJavaType clazz, string methodName, params object[] args)
Parameters
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe method to execute
argsobject[]The aruments
Returns
- TArrayType[]
An array of
TArrayType
Type Parameters
TArrayTypeThe expected Type of the resulting array
SExecuteArray<TArrayType>(string, params object[])
Execute the method and build the result as an array of TArrayType
public static TArrayType[] SExecuteArray<TArrayType>(string methodName, params object[] args)
Parameters
Returns
- TArrayType[]
An array of
TArrayType
Type Parameters
TArrayTypeThe expected Type of the resulting array
SExecuteWithSignature(IJavaType, string, string, params object[])
Executes a static method
public static object SExecuteWithSignature(IJavaType clazz, string methodName, string signature, params object[] args)
Parameters
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]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
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- IJVMBridgeBase
A newly initialized
typeor 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- IJVMBridgeBase
A newly initialized
typeor null
SExecuteWithSignatureArray<TArrayType>(IJavaType, string, string, params object[])
Execute the method and build the result as an array of TArrayType
public static TArrayType[] SExecuteWithSignatureArray<TArrayType>(IJavaType clazz, string methodName, string signature, params object[] args)
Parameters
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe method to execute
signaturestringMethod signature to use in search criteria
argsobject[]The aruments
Returns
- TArrayType[]
An array of
TArrayType
Type Parameters
TArrayTypeThe expected Type of the resulting array
SExecuteWithSignatureArray<TArrayType>(string, string, params object[])
Execute the method and build the result as an array of TArrayType
public static TArrayType[] SExecuteWithSignatureArray<TArrayType>(string methodName, string signature, params object[] args)
Parameters
methodNamestringThe method to execute
signaturestringMethod signature to use in search criteria
argsobject[]The aruments
Returns
- TArrayType[]
An array of
TArrayType
Type Parameters
TArrayTypeThe expected Type of the resulting array
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
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe 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
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from instance of
typetoTReturn
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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from instance of
typetoTReturn
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
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from
TNewClasstoTReturn
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
methodNamestringThe instance method to be invoked
signaturestringMethod signature to use in search criteria
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from
TNewClasstoTReturn
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
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
TReturnor null
Type Parameters
TReturnThe 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe 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
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe 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
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe 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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from instance of
typetoTReturn
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
typeTypeThe Type implementing IJVMBridgeBase to be instantiated
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from instance of
typetoTReturn
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
clazzIJavaTypeThe IJavaType where the method shall be executed
methodNamestringThe instance method to be invoked
argsobject[]Possible arguments
Returns
- TReturn
The initilized
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from
TNewClasstoTReturn
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
TReturnor null
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type: in some condition can be helpful to return a different
TReturnTConverterThe converter to be used to convert from
TNewClasstoTReturn
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
fieldNamestringThe 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
TReturnThe 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
fieldNamestringThe field name to get
Returns
- TReturn[]
The field value
Type Parameters
TReturnThe 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
TReturnThe 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
fieldNamestringThe field name to get
Returns
- TReturn
The field value
Type Parameters
TReturnThe 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
clazzIJavaTypeThe IJavaType where the field shall be set
fieldNamestringThe field name to set
valobjectThe 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
clazzIJavaTypeThe IJavaType where the field shall be set
fieldNamestringThe field name to set
valTValueThe value to set on the field
Type Parameters
TValueA 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
fieldNamestringThe field name to set
valTValueThe value to set on the field
Type Parameters
TValueA type inherited from IJVMBridgeBase, IJavaObject, Enum or primitive types