注释处理器不适用于Eclipse

时间:2018-07-11 11:28:37

标签: eclipse annotation-processing annotation-processor

我创建了处理器,现在我只将伪数据写入文件中,如下所示:

public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
{

    PrintWriter writer;
    try {
        writer = new PrintWriter("test.txt", "UTF-8");
        writer.println("The first line");
        writer.println("The second line");
        writer.close();
    } catch (FileNotFoundException | UnsupportedEncodingException e) {
        e.printStackTrace();
    }
return true;
}

META-INF / services如下:

com.processors.MyProcessor

我有如下注释界面:

public @interface ArticleAnnotation {
}

我已经配置了eclipse以使用注释处理器,并将提取的处理器jar文件添加到了路径

但是当我构建项目时什么也没产生。

0 个答案:

没有答案
相关问题