We've already seen several examples of how annotations can be used to control how code is generated, and how that generated code can improve the interop between Java and Kotlin. Sometimes, we need to have greater control over how annotations are applied to the Java elements generated. For these situations, we can specify a user-site target for the annotation.
Use-site annotation targets
What are use-site targets?
Use-site targets give us control over how annotations are applied to the Java code that's generated by the Kotlin compiler. They can help us indicate whether an annotation should be applied to a generated field, a generated getter/setter, or a number of other Java targets. In most situations, these use-sites...