jeudi 2 juin 2016

How to find methods with an annotation in a class?

Given an annotation

@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
annotation class MyAnnotation

How to find methods with this annotation?

This is how far I got:

val cls = myObject.javaClass.kotlin
val found = cls.memberFunctions.filter { it.annotations.contains( ??? ) }





Aucun commentaire:

Enregistrer un commentaire