Class JVMBridgeException
Java Exception base class
public class JVMBridgeException : Exception, ISerializable, _Exception, IJVMBridgeCore
- Inheritance
-
JVMBridgeException
- Implements
- Derived
-
JVMBridgeException<TException>
- Inherited Members
- Extension Methods
Constructors
JVMBridgeException()
Initializes a new instance of the Exception class.
public JVMBridgeException()
JVMBridgeException(string)
Initializes a new instance of the Exception class with a specified error message.
public JVMBridgeException(string message)
Parameters
messagestringThe message that describes the error.
JVMBridgeException(string, Exception)
Initializes a new instance of the Exception class with a specified error message and a reference to the inner exception that is the cause of this exception.
public JVMBridgeException(string message, Exception innerException)
Parameters
messagestringThe error message that explains the reason for the exception.
innerExceptionExceptionThe exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.
Properties
BridgeClassName
Java class name of the exception
public virtual string BridgeClassName { get; }
Property Value
BridgeInstance
The instance of BridgeClassName
public IJavaObject BridgeInstance { get; protected set; }
Property Value
DynBridgeInstance
The dynamic accessor to BridgeInstance
public dynamic DynBridgeInstance { get; }
Property Value
- dynamic
StackTrace
Gets a string representation of the immediate frames on the call stack.
public override string StackTrace { get; }
Property Value
- string
A string that describes the immediate frames of the call stack.
Methods
BiThrow<TException>(params object[])
Initialize and throw an instance of TException in JVM and then in CLR
public static void BiThrow<TException>(params object[] args) where TException : JVMBridgeException
Parameters
argsobject[]The arguments of the
TExceptionconstructor
Type Parameters
TExceptionA Type extending JVMBridgeException
CreateWithSignature<TException>(string, params object[])
Used to create instance of TException
public static TException CreateWithSignature<TException>(string signature, params object[] args) where TException : JVMBridgeException
Parameters
signaturestringThe JNI constructor signature to be used
argsobject[]The arguments of constructor
Returns
- TException
A Java instance of
TException
Type Parameters
TExceptionA Type extending JVMBridgeException
Remarks
You cannot use throw on the returned TException to raise an exception to Java context. This is a special method to allocate an exception in Java context. It avoids reflection problems with the behavior used to report back in .NET the exceptions raised from Java methods.
Create<TException>(params object[])
Used to create instance of TException
public static TException Create<TException>(params object[] args) where TException : JVMBridgeException
Parameters
argsobject[]The arguments of constructor
Returns
- TException
A Java instance of
TException
Type Parameters
TExceptionA Type extending JVMBridgeException
Remarks
You cannot use throw on the returned TException to raise an exception to Java context. This is a special method to allocate an exception in Java context. It avoids reflection problems with the behavior used to report back in .NET the exceptions raised from Java methods.
IExecute(string, params object[])
Executes an instance method
public object IExecute(string methodName, params object[] args)
Parameters
Returns
- object
The result of execution. Void functions returns null.
IExecuteArray<TArrayType>(string, params object[])
Execute the method and build the result as an array of TArrayType
public TArrayType[] IExecuteArray<TArrayType>(string methodName, params object[] args)
Parameters
Returns
- TArrayType[]
An array of
TArrayType
Type Parameters
TArrayTypeThe expected Type of the resulting array
IExecuteWithSignature(string, string, params object[])
Executes an instance method
public object IExecuteWithSignature(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.
IExecuteWithSignatureArray<TArrayType>(string, string, params object[])
Execute the method and build the result as an array of TArrayType
public TArrayType[] IExecuteWithSignatureArray<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
IExecuteWithSignature<TReturn>(string, string, params object[])
Executes an instance method
public TReturn IExecuteWithSignature<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 result of execution. Void functions returns default.
Type Parameters
TReturnThe return type expected: class implementing IJVMBridgeBase, IJavaObject, Enum, primitive types or array of primitives types
IExecuteWithSignature<TNewClass, TReturn>(string, string, params object[])
Executes an instance method
public TReturn IExecuteWithSignature<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 result of execution. Void functions returns default.
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type expected: class implementing IJVMBridgeBase, IJavaObject, Enum, primitive types or array of primitives types
IExecuteWithSignature<TNewClass, TReturn, TConverter>(string, string, params object[])
Executes an instance method
public TReturn IExecuteWithSignature<TNewClass, TReturn, TConverter>(string methodName, string signature, params object[] args) where TNewClass : IJVMBridgeBase, TReturn 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 result of execution. Void functions returns default.
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type expected: class implementing IJVMBridgeBase, IJavaObject, Enum, primitive types or array of primitives types
TConverterThe converter to be used to convert from
TNewClasstoTReturn
IExecute<TReturn>(string, params object[])
Executes an instance method
public TReturn IExecute<TReturn>(string methodName, params object[] args)
Parameters
Returns
- TReturn
The result of execution. Void functions returns default.
Type Parameters
TReturnThe return type expected: class implementing IJVMBridgeBase, IJavaObject, Enum, primitive types or array of primitives types
IExecute<TNewClass, TReturn>(string, params object[])
Executes an instance method
public TReturn IExecute<TNewClass, TReturn>(string methodName, params object[] args) where TNewClass : IJVMBridgeBase, TReturn
Parameters
Returns
- TReturn
The result of execution. Void functions returns default.
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type expected: class implementing IJVMBridgeBase, IJavaObject, Enum, primitive types or array of primitives types
IExecute<TNewClass, TReturn, TConverter>(string, params object[])
Executes an instance method
public TReturn IExecute<TNewClass, TReturn, TConverter>(string methodName, params object[] args) where TNewClass : IJVMBridgeBase, TReturn where TConverter : IJVMBridgeBaseConvert<TNewClass, TReturn>, new()
Parameters
Returns
- TReturn
The result of execution. Void functions returns default.
Type Parameters
TNewClassThe argument type to be used
TReturnThe return type expected: class implementing IJVMBridgeBase, IJavaObject, Enum, primitive types or array of primitives types
TConverterThe converter to be used to convert from
TNewClasstoTReturn
IsInstanceOf(IJavaType)
Verify if this IJavaObject is an instance of clazz
public bool IsInstanceOf(IJavaType clazz)
Parameters
Returns
- bool
true if this IJavaObject is an instance of
clazz, otherwise false
IsInstanceOf<T>()
Verify if this IJavaObject is an instance of T
public bool IsInstanceOf<T>() where T : IJVMBridgeBase
Returns
- bool
true if this IJavaObject is an instance of
T, otherwise false
Type Parameters
TA type implementing IJVMBridgeBase
New(IJavaObject)
Initialize a new JVMBridgeException class
public static JVMBridgeException New(IJavaObject javaObject)
Parameters
javaObjectIJavaObjectThe remote IJavaObject to be used
Returns
- JVMBridgeException
An newly initialized JVMBridgeException
New<TException>(IJavaObject)
Initialize a new TException class
public static TException New<TException>(IJavaObject javaObject) where TException : JVMBridgeException
Parameters
javaObjectIJavaObjectThe remote IJavaObject to be used
Returns
- TException
An newly initialized
TException
Type Parameters
TExceptionAn exception class inherited from JVMBridgeException<TException>
Throw<TException>(params object[])
Initialize and throw an instance of TException in JVM
public static void Throw<TException>(params object[] args) where TException : JVMBridgeException
Parameters
argsobject[]The arguments of the
TExceptionconstructor
Type Parameters
TExceptionA Type extending JVMBridgeException