How to generate inner class in javapoet in java
Asked Answered
S

1

6

Is there a any way to generate inner classes in javapoet library. I can generate classes with constructors and methods. But i can't figure out how to create inner classes

Spartacus answered 14/12, 2015 at 15:59 Comment(0)
T
7

Use the TypeSpec.Builder#addType method. See nestedClasses() test in TypeSpecTest.java

Teratogenic answered 14/12, 2015 at 20:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.