Since I want to generate Scala code from an annotated Scala class, I need to get the values from annotations of the class.
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 presentation compiler doesn't give me a value for tags. I'm accessing 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 value of tags?