在使用框架开发过程中,要进行代码跟踪时,经常发现跟踪的是一个接口,此时应该怎么办呢,可以使用以下代码:
以下各个类是示例:
HttpEntity entity2 = response2.getEntity(); //public interface HttpEntity, 这是个接口
System.out.println(entity2.getClass()); // 这样输出后可以看到具体的实现类class org.apache.http.impl.execchain.ResponseEntityProxy
然后,按CTRL+SHIFT+H, 输入 ResponseEntityProxy就找到了这个类所在的jar包。