鴻蒙OS ReflectiveOperationException

2022-05-31 17:17 更新

ReflectiveOperationException

java.lang.Object

|---java.lang.Throwable

|---|---java.lang.Exception

|---|---|---java.lang.ReflectiveOperationException

public class ReflectiveOperationException
extends Exception

核心反射中反射操作拋出的常見(jiàn)異常超類。

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
ReflectiveOperationException() 構(gòu)造一個(gè)以 null 作為其詳細(xì)消息的新異常。
ReflectiveOperationException(String message) 使用指定的詳細(xì)消息構(gòu)造一個(gè)新異常。
ReflectiveOperationException(String message, Throwable cause) 使用指定的詳細(xì)消息和原因構(gòu)造一個(gè)新異常。
ReflectiveOperationException(Throwable cause) 構(gòu)造一個(gè)具有指定原因的新異常和 (cause==null ? null : cause.toString()) 的詳細(xì)消息(通常包含原因的類和詳細(xì)消息)。

方法總結(jié)

從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
從類 java.lang.Throwable 繼承的方法
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

構(gòu)造函數(shù)詳細(xì)信息

ReflectiveOperationException

public ReflectiveOperationException()

構(gòu)造一個(gè)以 null 作為其詳細(xì)消息的新異常。 原因未初始化,隨后可能通過(guò)調(diào)用 Throwable.initCause(java.lang.Throwable) 進(jìn)行初始化。

ReflectiveOperationException

public ReflectiveOperationException(String message)

使用指定的詳細(xì)消息構(gòu)造一個(gè)新異常。 原因未初始化,隨后可能通過(guò)調(diào)用 Throwable.initCause(java.lang.Throwable) 進(jìn)行初始化。

參數(shù):

參數(shù)名稱 參數(shù)描述
message 詳細(xì)信息。 保存詳細(xì)消息以供 Throwable.getMessage() 方法稍后檢索。

ReflectiveOperationException

public ReflectiveOperationException(String message, Throwable cause)

使用指定的詳細(xì)消息和原因構(gòu)造一個(gè)新異常。

請(qǐng)注意,與原因相關(guān)的詳細(xì)消息不會(huì)自動(dòng)合并到此異常的詳細(xì)消息中。

參數(shù):

參數(shù)名稱 參數(shù)描述
message 詳細(xì)消息(保存以供 Throwable.getMessage() 方法稍后檢索)。
cause 原因(由 Throwable.getCause() 方法保存以供以后檢索)。 (允許使用空值,表示原因不存在或未知。)

ReflectiveOperationException

public ReflectiveOperationException(Throwable cause)

構(gòu)造一個(gè)具有指定原因的新異常和 (cause==null ? null : cause.toString()) 的詳細(xì)消息(通常包含原因的類和詳細(xì)消息)。

參數(shù):

參數(shù)名稱 參數(shù)描述
cause 原因(由 Throwable.getCause() 方法保存以供以后檢索)。 (允許使用空值,表示原因不存在或未知。)
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)