square / javapoet

A Java API for generating .java source files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Is there any way to convert Java source or AST into JavaPoet code?

seanghay opened this issue Β· comments

Or maybe AST -> JavaPoet.

I am doing a large codebase migration and I want minimize manual work.

I want to:

  1. Java Source -> JavaPoet source
  2. Modify JavaPoet source
  3. JavaPoet source -> Java Source back

StackOverflow is overrated πŸ˜„

No. I recommend the Spoon library for this: https://spoon.gforge.inria.fr/

If you're feeling adventurous you could also use IntelliJ PSI which is what the IntelliJ IDEA editor uses to manipulate your code.