01/21/2022, 8:45 PM
Hey folks I’m having issues with annotations on annotation members
Basically there is an annotation written in Java with
Intellij complains I can’t put the annotation on the property
So I have to put it on the getter with
, however then the annotation is not present on the property itself any longer
So basically my question is how can I get the annotation to be present in KSP on the property itself


01/21/2022, 9:39 PM
It should be on property.getter if you do that
👍 2


01/22/2022, 7:02 AM
Yeah it is, but that isn’t ideal. I would like to change it so the annotation is present on the property itself
I don’t know what Java ElementType target combined with any or no use site target would allow for that
Unfortunately it seems if the annotation is written in Java I have to handle that behavior differently than if the annotation is written in Kotlin
There doesn’t seem to be any Java ElementType target that allows for the annotation to target the property


01/22/2022, 8:44 AM
There isn't - properties aren't a concept that exist in Java. You have to use something Java understands (i.e. method/field/parameter) or convert the annotation to Kotlin.