Java ClassLoader setClassAssertionStatus()方法與示例

ClassLoader類setClassAssertionStatus()方法 (ClassLoader Class setClassAssertionStatus() method)

  • setClassAssertionStatus() method is available in java.lang package.

    setClassAssertionStatus()方法在java.lang包中可用。

  • setClassAssertionStatus() method is used to sets the assertion status for the named top-level class in this class loader or any nested classes contains in the class loader.

    setClassAssertionStatus()方法用于設置此類加載器中命名的頂級類或該類加載器中包含的任何嵌套類的斷言狀態。

  • setClassAssertionStatus() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.

    setClassAssertionStatus()方法是一個非靜態方法,只能通過類對象訪問,如果嘗試使用類名訪問該方法,則會收到錯誤消息。

  • setClassAssertionStatus() method does not throw an exception at the time of the set assertion status of the class.

    setClassAssertionStatus()方法在設置類的斷言狀態時不會引發異常。

Syntax:

句法:

    public void setClassAssertionStatus(String cl_name, boolean status);

Parameter(s):

參數:

  • String cl_name – represents the fully qualified name of the top-level class whose assertion status is to be set.

    字符串cl_name –表示要設置其聲明狀態的頂級類的全限定名稱。

  • boolean status – represents the status of assertions when the named class is to have assertion enabled. It returns true and when the named class is to have assertion disabled, it returns false.

    布爾狀態 –表示要啟用命名類時斷言的狀態。 它返回true,并且當命名類禁用斷言時,它返回false。

Return value:

返回值:

The return type of this method is void, it returns nothing.

此方法的返回類型為void ,不返回任何內容。

Example:

例:

// Java program to demonstrate the example 
// of void setClassAssertionStatus () method of ClassLoader 
public class setClassAssertionStatusOfClassLoader {
public static void main(String[] args) throws Exception {
// Load a class
Class cl = Class.forName("setClassAssertionStatusOfClassLoader");
// It returns the ClassLoader associated with the
// class Object
ClassLoader loader = cl.getClassLoader();
// Display loader
System.out.println("loader Class: " + loader.getClass());
// By using setClassAssertionStatus() method is to set the 
//desired status and sets the status to true
loader.setClassAssertionStatus("setClassAssertionStatusOfClassLoader", true);
}
}

Output

輸出量

loader Class: class jdk.internal.loader.ClassLoaders$AppClassLoader

翻譯自: https://www.includehelp.com/java/classloader-setclassassertionstatus-method-with-example.aspx

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/542513.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542513.shtml
英文地址,請注明出處:http://en.pswp.cn/news/542513.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

python怎么變各種顏色_python – 如何淡化顏色

有很多方法可以做到這一點.您如何選擇這取決于您是否重視速度和簡單性或感知均勻性.如果你需要它是真正統一的,你需要用顏色配置文件定義RGB顏色,你需要配置文件的原色,這樣你就可以轉換為XYZ,然后轉換到LAB,你可以操作L通道. 大多數情況下,您不需要這樣做,而是可以使用像Photo…

informatica中元數據管理

摘自: http://blog.itpub.net/28690368/viewspace-766528/ informaica是一個很強大的ETL工具,WORKFLOW MANAGER負責對ETL調度流程進行設計與管理和執行,informatica在資料庫中提供以下表來存儲調動流程的相關信息,以便WORKFLOW …

yii+php+當前目錄,Yii應用的目錄結構和入口腳本

以下是一個通過高級模版安裝后典型的Yii應用的目錄結構:~~~.├── backend├── common├── console├── environments├── frontend├── nbproject├── tests├── vendor├── composer.json├── composer.lock├── init├── init.bat├── …

8086 尋址方式_8086微處理器的不同尋址模式

8086 尋址方式Introduction: 介紹: Addressing mode tells us what is the type of the operand and the way they are accessed from the memory for execution of an instruction and how to fetch particular instruction from the memory. There are mainly 8 …

決策樹的value是什么意思_從零開始的機器學習實用指南(六):決策樹

類似SVM,決策樹也是非常多功能的機器學習算法,可以分類,回歸,甚至可以完成多輸出的任務,能夠擬合復雜的數據集(比如第二章的房價預測例子,雖然是過擬合了。)決策樹也是很多集成學習的…

Hive中生成隨機唯一標識ID的方法

2019獨角獸企業重金招聘Python工程師標準>>> HIVE中處理的數據往往比較多,在處理數據的時候希望給處理得到的數據一個ID標識,這時候可以用到UUID。 UUID的算法的核心思想是結合機器的網卡、當地時間、一個隨即數來生成UUID。從理論上講&#…

php從網頁獲得數據,php根據URL獲得網頁內容

php 中根據url來獲得網頁內容非常的方便,可以通過系統內置函數file_get_contents(),傳入url,即可返回網頁的內容,比如獲得百度首頁的內容代碼為:$html file_get_contents(http://www.baidu.com/);echo $html;就可以顯示出百度首頁的內容&…

2020知道python語言應用答案_2020知到Python語言應用答案章節期末答案

組合管理理論最早由哈維馬科維茲于1962年系統的提出,他開創了對投資進行整體管理的先 公司型基金和契約型基金的區別,下列不包括()。 A.資金的性質B.基金的營運依據C.基 我國(&#…

如何在Bootstrap中使用Jumbotron和頁面標頭類?

Introduction 介紹 In the previous article, we have learned how Responsive column, Nesting Columns and offset Columns work and how to use them? I hope now, you all are comfortable with the grid system; what is it, how to use it and how we can use it for c…

python中的數字類型格式與運算,python數字數據類型

python數字數據類型1. 數字在我們很小的時候,父母便開始教我們數數,從1數到10,聰明的孩子可以數的更多。python支持3中數值類型整型(int),通常稱之為整型或整數,這個概念與我們小學時學過的整數是相同的,py…

getprocaddress得到為0_基于ZU+系列MPSoC芯片的USB3.0/2.0接口硬件設計

本文主要介紹Zynq UltraScale MPSoC系列芯片的USB3.0/2.0接口硬件設計。ZU系列MPSoC要實現USB3.0/2.0的全部功能,需要同時使用MIO和GTR。因為GTR接口中的USB接口只支持USB3.0,對USB2.0的支持需要通過MIO接口外接USB PHY實現。ZU系列MPSoC包括兩個USB接口…

如何設置單詞第一個字母大寫_大寫一行中每個單詞的第一個和最后一個字母

如何設置單詞第一個字母大寫Problem statement: 問題陳述: Given an input line, capitalize first and last letter of each word in the given line. Its provided that the input line is in lowercase. 給定輸入行, 將給定行中每個單詞的第一個和最…

php如何編造簡歷,在簡歷里編造內容需要注意哪些問題?

在個人簡歷里編造內容可得有一定依據才行,總得為自己后期做個準備工作是不是?你編造的東西不只是給企業看一看而已,企業還會對這些內容作出進一步的判斷,并且可能就其對你進行提問,如果你答不出來而曝光自己是在欺騙企…

Java LinkedList公共對象pollLast()方法(帶示例)

LinkedList公共對象pollLast()方法 (LinkedList public Object pollLast() method) This method is available in package java.util.LinkedList.pollLast(). 軟件包java.util.LinkedList.pollLast()中提供了此方法。 This method is used to retrieves the last or ending ele…

python編寫學生成績排序_Python實現按學生年齡排序的實際問題詳解

前言 本文主要給大家了關于利用Python按學生年齡排序的相關內容,分享出來供大家參考學習,下面話不多說了,來一起看看詳細的介紹: 問題:定義一個Class:包含姓名name、性別gender、年齡age,需要按…

前方危險-讓很多“高逼格”高管深刻反思的文章

在很多的時候,現實會讓我們每個人迷惑,周邊的人和事可以讓人極度的膨脹,你可以想吃了迷藥一樣,分不清是現實還是虛幻。很久以前,在公司的一次會議上,某主管告訴我們說,“他一個同事,…

oracle實例的概念組成,oracle體系結構的兩個基本概念:數據庫和實例

您可能感興趣的話題:oracle核心提示:要了解oracle體系結構必須先了解兩個基本的概念: 數據庫和實例.要了解oracle體系結構必須先了解兩個基本的概念: 數據庫和實例.一: 數據庫數據庫(database)是一個數據集合.無論數據庫是采用關系結構還是面向對象結構,…

c#二維數據最大最小值_C#| 打印類型,各種數據類型的最大值和最小值

c#二維數據最大最小值In the below example – we are printing types, min value, max value of various data types in C#, like integer data types, floating point data types, Boolean data type, Reference types, Nullable types. 在下面的示例中-我們正在打印C&#x…

自定義taglib引入失敗_小程序拼團總失敗?看看微信官方和開發者們怎么說

閱讀時間:6m最懂小程序生態商業的自媒體可怕... 剛過國慶,南方還在短袖短裙,北方竟然都下雪了!什么叫一天之內感受四季?曉程序觀察(yinghoo-tech)的小伙伴們算是深刻體驗了,穿著短袖上飛機,抵達…

微信公眾平臺開發5:翻譯功能

思路分析首先對用戶發送過來的消息進行判斷,判斷消息里是否含有“翻譯”關鍵字,如果有,則提取翻譯內容,然后調用網絡上開放的翻譯API 進行翻譯。我們用有道翻譯API:http://fanyi.youdao.com/openapi?pathdata-mode記下…