JavaException Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| JavaException() |
Constructs a new throwable with null as its detail message. |
| JavaException(String) |
Constructs a new throwable with the specified detail message. |
| JavaException(JniObjectReference, JniObjectReferenceOptions) |
Reads the Java throwable details and initializes a managed exception peer. |
| JavaException(String, Exception) |
Creates a Java throwable with a message and retains a separate managed inner exception. |
| JavaException(JniObjectReference, JniObjectReferenceOptions, JniObjectReference) |
Constructs a peer while reading exception details from an alternate throwable. |
JavaException()
Constructs a new throwable with null as its detail message.
public JavaException();
Remarks
Constructs a new throwable with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to initCause(java.lang.Throwable). The fillInStackTrace() method is called to initialize the stack trace data in the newly created throwable.
Java reference for java.lang.Throwable.Throwable.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
JavaException(String)
Constructs a new throwable with the specified detail message.
public JavaException(string message);
new Java.Interop.JavaException : string -> Java.Interop.JavaException
Parameters
- message
- String
the detail message. The detail message is saved for later retrieval by the getMessage() method.
Remarks
Constructs a new throwable with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to initCause(java.lang.Throwable). The fillInStackTrace() method is called to initialize the stack trace data in the newly created throwable.
Java reference for java.lang.Throwable.Throwable.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
JavaException(JniObjectReference, JniObjectReferenceOptions)
Reads the Java throwable details and initializes a managed exception peer.
public JavaException(ref Java.Interop.JniObjectReference reference, Java.Interop.JniObjectReferenceOptions transfer);
new Java.Interop.JavaException : JniObjectReference * Java.Interop.JniObjectReferenceOptions -> Java.Interop.JavaException
Parameters
- reference
- JniObjectReference
The source JNI peer reference.
- transfer
- JniObjectReferenceOptions
Reference-transfer and peer-registration options passed to the runtime.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
JavaException(String, Exception)
Creates a Java throwable with a message and retains a separate managed inner exception.
public JavaException(string message, Exception innerException);
new Java.Interop.JavaException : string * Exception -> Java.Interop.JavaException
Parameters
- message
- String
The message stored in the managed exception and passed to the Java throwable constructor.
- innerException
- Exception
The managed inner exception. This overload does not pass it as the Java throwable cause.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
JavaException(JniObjectReference, JniObjectReferenceOptions, JniObjectReference)
Constructs a peer while reading exception details from an alternate throwable.
protected JavaException(ref Java.Interop.JniObjectReference reference, Java.Interop.JniObjectReferenceOptions transfer, Java.Interop.JniObjectReference throwableOverride);
new Java.Interop.JavaException : JniObjectReference * Java.Interop.JniObjectReferenceOptions * Java.Interop.JniObjectReference -> Java.Interop.JavaException
Parameters
- reference
- JniObjectReference
The reference used to construct this managed peer.
- transfer
- JniObjectReferenceOptions
Reference-transfer and peer-registration options for reference.
- throwableOverride
- JniObjectReference
The throwable used to read the message and cause; a valid override also supplies the Java stack trace.
Remarks
The override supplies message and cause independently of the peer reference. If it is invalid, stack-trace capture falls back to this peer's reference.