It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                7年前关闭。
            
                    
仅解析Java源文件?

或有其他解决方案?

最佳答案

发现paranamer项目可以解决此问题。

用例:

   方法method = Foo.class.getMethod(...);
   Paranamer paranamer = new CachingParanamer();
   String [] parameterNames = paranamer.lookupParameterNames(方法)


项目主页:http://paranamer.codehaus.org

关于java - 如何从Java类获取方法参数名称? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3151241/

10-11 11:18