小编Atr*_*idA的帖子

如何使用 AnnotationProcessor 在具有特定包的 java(生成)目录中编写 kotlin 文件

我正在使用注释处理来生成一些代码,我需要在特定包中创建 kotlin 文件这是我的代码

@AutoService(Processor.class)
@IncrementalAnnotationProcessor(IncrementalAnnotationProcessorType.DYNAMIC)
@SuppressWarnings("NullAway")
public final class MyProcessor extends AbstractProcessor {
 
   @Override
   public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) {
     ....
   }

   private void writeKotlinFile(String pack, String fileName, String fileContent, Element it) {
     .....
       
    }
}
Run Code Online (Sandbox Code Playgroud)

android kotlin

5
推荐指数
1
解决办法
46
查看次数

标签 统计

android ×1

kotlin ×1