1

I am writing an annotation Processor that generates Agenerated class from an annotated A class. I would like to be able to do something like

AgeneratedInst.getFoo().getBar()...

In order to do so I have to specify the return type which is the current class I am writing... Is there a way to do so?

Jason Aller
  • 3,391
  • 28
  • 37
  • 36
gropapa
  • 577
  • 6
  • 10

1 Answers1

2

I just figured out, maybe it's kinda weird but it works. I just have to specify a TypeName like this:

String generatedName = "Agenerated";
ClassName className = ClassName.get("", classsName);

then I use it as a return type for a method and it's ok

gropapa
  • 577
  • 6
  • 10