hha*_*fez 7 java refactoring interface
我有一个定义API的具体类的集合,我想从API的实际实现中提取这些类的接口(即:基本上是类型层次结构和公共方法).
例如,如果API中的一个公共类是
public class Foo extends Bar {
/* some fields which I don't care about */
public void method() {
/* implementation here */
}
public void otherMethod() {
/* implementation goes here */
}
/* some non public methods which I don't care about */
}
Run Code Online (Sandbox Code Playgroud)
我想闯入一个接口和一个实现
即
public interface FooInterface extends BarInterface {
public void method();
public void otherMethod()
}
public class Foo implements FooInterface {
/* etc etc */
}
Run Code Online (Sandbox Code Playgroud)
和
有没有一种工具可以用来以自动方式进行这种分离,或者我将不得不推出自己的程序来完成这项工作?它需要是一种需要最少互动的工具.