我是预处理器的新手,我正在尝试执行以下代码:
public class foo {
private Map<String, Runnable> reflectivelyInitializedMap;
private MyObject bar = new MyObject() {
@ExternalApi
private Runnable makePublic;
}
// I want to generate the following method:
public void makePublic(){
reflectivelyInitializedMap.get("makePublic").run();
}
}
我无法在预处理器中捕获内部注释字段“makePublic”。这甚至可能吗?
好吧,这似乎不可能。我做了以下事情:
public class foo {
private Map<String, Runnable> reflectivelyInitializedMap;
@ExternalApi("makePublic")
private MyObject bar = new MyObject() {
private Runnable makePublic;
}
// I want to generate the following method:
public void makePublic(){
reflectivelyInitializedMap.get("makePublic").run();
}
}