Java找出.class导入的内容 [英] Java find out what imports a .class has

查看:80
本文介绍了Java找出.class导入的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法找出一个班级有什么进口?

Is there a way to find out what imports a class has?

问题:让乔恩·斯凯特(Jon Skeet)说您不能使用反射来做到这一点,但是

In this question: Jon Skeet says that you can't do this using reflection, but


如果要查找已编译代码中使用的所有类型,
会稍有不同。您可能希望将BCEL视为分析字节码的
方式。

If you want to find all the types used within the compiled code, that's a slightly different matter. You may want to look at BCEL as a way of analyzing bytecode.

这就是我想知道的

推荐答案

这是 ASM字节码操作框架解释了如何读取类依赖项和ASM。

这篇关于Java找出.class导入的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆