Is it possible to pass a value from a meta annotation?

Viewed 99

Let's say I have an annotation like this:

@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
@EnumSource(value = MyEnum::class, mode = EnumSource.Mode.EXCLUDE)
annotation class TestEachValue

Is is possible to pass a value from my annotation class to one of the annotations on it? Something like:

@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
@EnumSource(value = MyEnum::class, mode = EnumSource.Mode.EXCLUDE, names=excludes_from_below)
annotation class TestEachValue(val excludes: Array<String>)

I would be willing to wrap the value in an annotation if that helps. Or maybe Kotlin has some magic comparable to the inline keyword? Any advice on how this can be done nicely would be greatly appreciated.

0 Answers
Related