I have created a library that have the following 2 annotations:
@Target(ElementType.TYPE)
@Retention(AnnotationRetention.RUNTIME)
annotation class PushNotificationHandler
@Target(ElementType.METHOD)
@Retention(AnnotationRetention.RUNTIME)
annotation class PushNotificationDispatcher
And this the following class:
data class PushNotification(
val sender: String,
val body: String
)
There is an application that uses the library and have the following class
@PushNotificationHandler
class PushHandler {
@PushNotificationDispatcher
@Throws(IOException::class)
fun dispatch(pushNotification: PushNotification) {
...
}
}
I want to be able to find from the library all classes that are annotated with the PushNotificationHandler
annotation and be able to call all methods that are annotated with the PushNotificationDispatcher
annotation.
In short i'm trying to mimic Spring's RestController and PostMapping.