当前位置:网站首页>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
边栏推荐
- Queue (C language / linked list)
- okcc呼叫中心外呼系统智能系统需要用多大的盘存录音?
- Let the earth have less "carbon" and rest on the road
- Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam
- 记录:js删除数组中某一项或几项的几种方法
- Overview of bus structure
- 四张图弄懂matplotlib的一些基本用法
- RPC procedure
- jsp页面编码
- Asan minimalism
猜你喜欢
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
396. Rotate Function
PgSQL wants to implement all kinds of column sub query operations of MySQL
Search the complete navigation program source code
There are some problems when using numeric type to query string type fields in MySQL
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
The annotation is self-defined by implementing the parameter parser handlermethodargumentresolver interface
分布式消息中间件框架选型-数字化架构设计(7)
测试你的机器学习流水线
vmware 搭建ES8的常见错误
随机推荐
Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam
Harbor企业级镜像管理系统实战
00后最关注的职业:公务员排第二,第一是?
Flink SQL实现流批一体
线程的调度(优先级)
One click cleanup of pycharm and jupyter cache files under the project
【深度好文】Flink SQL流批⼀体化技术详解(一)
PgSQL wants to implement all kinds of column sub query operations of MySQL
Use of applicationreadyevent
Generate and parse tokens using JWT
通过实现参数解析器HandlerMethodArgumentResolver接口来自定义注解
[C语言] 文件操作《一》
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
Situational leaders - Chapter 7, solving performance problems
'bully' Oracle enlarged its move again, and major enterprises deleted JDK overnight...
QT reads all files under the path or files of the specified type (including recursion, judging whether it is empty and creating the path)
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
JSP page coding
Campus transfer second-hand market source code download
洋桃电子STM32物联网入门30步笔记三、CubeMX图形化编程、设置开发板上的IO口