当前位置:网站首页>Get the absolute path of the class according to the bytecode
Get the absolute path of the class according to the bytecode
2022-04-23 08:35:00 【Silence, your name】
Applicable to current module or incoming module .
Not applicable to third parties jar package
/**
* Get the absolute path of the class according to the bytecode
*
* @param clazz clazz
* @return classRealPath
*/
private static String getClassRealPath(Class<?> clazz) {
String classPath = clazz.getName().replace(".", "/") + ".class";
String classRealPath = Objects.requireNonNull(clazz.getResource("/" + classPath)).getPath();
classRealPath = classRealPath.replace("target/classes", "src/main/java");
classRealPath = classRealPath.replace(".class", ".java");
classRealPath = StrUtil.replace(classRealPath, "/", "\\");
return classRealPath.substring(1);
}

版权声明
本文为[Silence, your name]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230810200236.html
边栏推荐
- Stm32f103zet6 [development of standard library functions] - Introduction to library functions
- 四张图弄懂matplotlib的一些基本用法
- 关于cin,scanf和getline,getchar,cin.getline的混合使用
- 二维01背包
- flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
- QT reading and writing XML files
- RPC过程
- Campus transfer second-hand market source code download
- An example of network communication based on TCP / IP protocol -- file transmission
- 记录:js删除数组中某一项或几项的几种方法
猜你喜欢

通过实现参数解析器HandlerMethodArgumentResolver接口来自定义注解

程序,进程,线程;内存结构图;线程的创建和启动;Thread的常用方法

Transformer XL: attention language modelsbbeyond a fixed length context paper summary

一个必看的微信小程序开发指南1-基础知识了解

HAL库的RCC简介

00后最关注的职业:公务员排第二,第一是?

跨域配置报错: When allowCredentials is true, allowedOrigins cannot contain the special value “*“

【深度好文】Flink SQL流批⼀体化技术详解(一)

Overview of bus structure

作文以记之 ~ 二叉树的后序遍历
随机推荐
synchronized 实现原理
Search the complete navigation program source code
洋桃電子STM32物聯網入門30步筆記一、HAL庫和標准庫的區別
colorui 解决底部导航遮挡内容问题
ATSS(CVPR2020)
Navicat remote connection MySQL
面了一圈,整理了这套面试题。。
The annotation is self-defined by implementing the parameter parser handlermethodargumentresolver interface
Copy array in JS
Overview of bus structure
项目上传部分
Green apple film and television system source code film and television aggregation film and television navigation film and television on demand website source code
使用JWT生成与解析Token
jsp页面编码
PgSQL wants to implement all kinds of column sub query operations of MySQL
监控智能回放是什么,如何使用智能回放查询录像
ansible自动化运维详解(一)ansible的安装部署、参数使用、清单管理、配置文件参数及用户级ansible操作环境构建
【深度好文】Flink SQL流批⼀体化技术详解(一)
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
[C语言] 文件操作《一》