Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 java 代码,它获取函数名称、它们的返回类型、它们的参数以及 java 类的静态变量。现在,我一直在获取 java 类中方法的局部变量的名称和数据类型。如果你们能帮助我,那就太好了...
提取局部变量名称及其类型的唯一方法是在字节码中举例说明调试信息(假设它在那里)。您可以使用 ASM 之类的工具来检查字节码。它比使用反射要困难得多,因此很少这样做。;)