Inside an annotation processor that extends AbstractProcessor
I have:
override fun process(annotations: MutableSet<out TypeElement>, roundEnv: RoundEnvironment): Boolean {
roundEnv.getElementsAnnotatedWith(FxBean::class.java)
.forEach {
val className = it.simpleName.toString()
val metaDataClass = Class.forName("kotlin.Metadata").asSubclass(Annotation::class.java)
val isKotlinClass = it.getAnnotation(metaDataClass) != null
if (isKotlinClass) {
// Trying to get the list of methods
// of the data class with the @FxBean annotation.
val methods = roundEnv.rootElements.find {
it.simpleName.toString() == className // This is never true
}?.let {
val methods = mutableListOf<ExecutableElement>()
it.enclosedElements.forEach {
if (it is ExecutableElement) {
methods.add(it)
}
}
methods
}
}
}
return true
}
What am I missing? Is there a way to get the Element representing the data class with the @FxBean
annotation being processed?