Since I want to generate Scala code from an annotated Scala class, I need to get values ββfrom class annotations.
public @interface TestAnnotation { public String name(); public String description(); public String[] tags() default { "Test" }; }
@TestAnnotation(name = "TestName", description = "TestDescription") class MyClass
My problem is that the Scala view compiler does not give me a value for tags . I access the values ββwith the following code:
import tools.nsc.interactive.Global._ val ast = ... val ans = ast.symbol.annotations // which returns me a List of AnnotationInfo ans.head.assocs // returns: List((name, "TestName"), (description, "TestDescription"))
So how can I get the default tags ?
scala
justwrote
source share