Confusion about @field:Annotation
Hi! Im trying to use JVM Reflection to get the Annotations.
By doing this:
clazz.javaClass.declaredFields.forEach {
it.trySetAccessible()
val annotations = it.getAnnotationsByType(MyAnnotation::class.java)
...
}
This always comes back as empty, unless i use it with @field:MyAnnotation, why do i need the field:?
1 post - 1 participant
Read full topic