I'm tryng to parse a java file to add annotation to the classes. I have a class like
Class A{
}
And i want it to become like
@Foo(Bar)
ClassA{
}
At the moment i'm using a visitor with like:
public void visit(ClassOrInterfaceDeclaration n, Object arg){
n.addAnnotation("Foo");
SingleMemberAnnotationExpr expr=(SingleMemberAnnotationExpr)n.getAnnotation(0);
}
Now i have the annotation but i don't get how you set the value