Lets say my annotation processor's process function looks like below
override fun process(
annotations: MutableSet<out TypeElement>,
roundEnv: RoundEnvironment
): Boolean {
try {
roundEnv.getElementsAnnotatedWith(CustomAnnotation::class.java)
.mapNotNull {
if (it.kind != ElementKind.INTERFACE) {
printError(
"Only interfaces can be annotated with " +
MapperConfig::class.java.simpleName
)
null
} else {
it as TypeElement
}
}.forEach {
processMapperConfigInterface(it, roundEnv)
}
} catch (ex: Exception) {
messager.printError(ex.message!!)
}
return true
}
roundEnv.getElementsAnnotatedWith
returns me tthe java Elements without any kotlin type information, how do I use annotation processing to get proper kotlin type information instead?