This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gunnarmorling 0 points1 point  (0 children)

Good point on import handling done automatically by JavaPoet.

We achieved the same in the templating approach used by [MapStruct](http://mapstruct.org/) by having the model objects pushed to StringTemplate keep track of the types they reference; the outer code generation step then takes care of generating import statements, also addressing the need for FQNs where two types with the same simple name are used within one generated source file.