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.mzph.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记下…