Class CompilationUnit<T extends TypeDeclaration>
java.lang.Object
io.spring.initializr.generator.language.CompilationUnit<T>
- Type Parameters:
T
- the concrete type declaration supported by the compilation unit
- Direct Known Subclasses:
GroovyCompilationUnit
,JavaCompilationUnit
,KotlinCompilationUnit
A compilation unit that represents an individual source file.
- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorsConstructorDescriptionCompilationUnit
(String packageName, String name) Create a new instance with the package to use and the name of the type. -
Method Summary
Modifier and TypeMethodDescriptioncreateTypeDeclaration
(String name) protected abstract T
getName()
Return the name of the source file.Return the package name in which the file should reside.
-
Constructor Details
-
CompilationUnit
Create a new instance with the package to use and the name of the type.- Parameters:
packageName
- the package in which the source file should be locatedname
- the name of the file
-
-
Method Details
-
getPackageName
Return the package name in which the file should reside.- Returns:
- the package name
-
getName
Return the name of the source file.- Returns:
- the name of the source file
-
createTypeDeclaration
-
getTypeDeclarations
-
doCreateTypeDeclaration
-