I am trying to annotate the annotation values @TemplateMapping
. (Java/Kotlin)
when it is literal String I can easily.
but I am having difficulty annotate when you have a variable by reference (TEMPLATE_REF
).
I need support so that you can refer to TEMPLATE_REF
and annotate your string.
<annotator language="UAST" order="first"
implementationClass="dev.TemplateVariableAnnotator"/>
class KtTemplate {
@TemplateMapping("{{name}} - {{version}}")
fun literalOk(name: String, version: String) {
/*...*/
}
@TemplateMapping(TEMPLATE_REF)
fun referenceFail(name: String, version: String) {
/*...*/
}
companion object {
const val TEMPLATE_REF: String = "{{name}} - {{version}}"
}
}
The effect should be the same for TEMPLATE_REF