[英]auto-generate code for delegation/encapsulation class (in Intellij)
我的問題:
我有:
public class Bla {
static {
System.loadLibrary("blaNative");
}
public static native T3 method1(T1 p1, T2 p2);
public static native T6 method2(T4 p4, T5 p5);
...
hundreds of other native methods here
...
}
我想自動生成:
public class BlaWrapper implements BlaInterface {
public T3 method1(T1 p1, T2 p2) {
return Bla.method1(p1,p2);
}
public T6 method2(T4 p4, T5 p5) {
return Bla.method2(p4,p5);
}
...
hundreds of other methods here
...
}
public interface BlaInterface {
public T3 method1(T1 p1, T2 p2);
public T6 method2(T4 p4, T5 p5);
...
hundreds of other methods here
...
}
注意:生成 BlaInterface 很簡單。
非常感謝您的時間和專業知識
此致
以防萬一其他人遇到同樣的問題:
劇透警報:秘訣是 intellij 菜單中的“代碼->覆蓋方法”:
瞧::-)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.