Package io.micronaut.sourcegen.javapoet
Class JavaFile.Builder
java.lang.Object
io.micronaut.sourcegen.javapoet.JavaFile.Builder
- Enclosing class:
- JavaFile
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddFileComment
(String format, Object... args) addStaticImport
(ClassName className, String... names) addStaticImport
(Class<?> clazz, String... names) addStaticImport
(Enum<?> constant) build()
skipJavaLangImports
(boolean skipJavaLangImports) Call this to omit imports for classes injava.lang
, such asjava.lang.String
.
-
Field Details
-
staticImports
-
-
Method Details
-
addFileComment
-
addStaticImport
-
addStaticImport
-
addStaticImport
-
skipJavaLangImports
Call this to omit imports for classes injava.lang
, such asjava.lang.String
.By default, JavaPoet explicitly imports types in
java.lang
to defend against naming conflicts. Suppose an (ill-advised) class is namedcom.example.String
. Whenjava.lang
imports are skipped, generated code incom.example
that referencesjava.lang.String
will getcom.example.String
instead. -
indent
-
build
-