I am new to Kotlin and I want to do the following:
-
Annotate some functions with an annotation e.g "Executable"
-
At runtime, get all the functions with this annotation
- Inspect a property on the annotation and if it matches a condition, invoke the function
I have the following code
annotation class Executable(val name : String)
@Executable("doSomething")
fun stepDoSomething (param1 : String) {
println("I am a step that does something! I print $param1")
}
However, I am unclear on how to retrieve all functions with the Executable annotation at runtime and inspect them.
Thank you for your help!
Aucun commentaire:
Enregistrer un commentaire