Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javapoet how do I create a static import

Tags:

java

javapoet

How do I create a static import using JavaPoet?

The code I'm trying to generate looks like this:

import static com.test.Types.*;
like image 939
Dan Avatar asked Nov 16 '25 05:11

Dan


1 Answers

For the record: static import is supported since 1.5.0

See JavaFileTest for example usages.

like image 161
Sormuras Avatar answered Nov 18 '25 19:11

Sormuras



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!