Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 KAPT 为每个数据类生成代码。有没有使用javax.lang.modelAPI 识别数据类的可靠方法?
javax.lang.model
在您的 kapt 处理代码中,可以过滤数据类
.getElementsAnnotatedWith(YourAnnotation::class) .filter { it::class.isData } .forEach { yourAction() }