Class DefaultGeneratedTypeContext
java.lang.Object
org.springframework.aot.generator.DefaultGeneratedTypeContext
- All Implemented Interfaces:
GeneratedTypeContext
Default
GeneratedTypeContext
implementation.- Since:
- 6.0
- Author:
- Stephane Nicoll
-
Constructor Summary
ConstructorDescriptionDefaultGeneratedTypeContext
(String packageName, Function<String, GeneratedType> generatedTypeFactory) Create a context targeting the specified package name and using the specified factory to create aGeneratedType
per requested package name. -
Method Summary
Modifier and TypeMethodDescriptiongetGeneratedType
(String packageName) Return aGeneratedType
for the specified package.Return the mainGeneratedType
.boolean
hasGeneratedType
(String packageName) Specify if aGeneratedType
for the specified package name is registered.Return theRuntimeHints
instance to use to contribute hints for generated types.List<org.springframework.javapoet.JavaFile>
Return the list ofJavaFile
of known generated type.
-
Constructor Details
-
DefaultGeneratedTypeContext
public DefaultGeneratedTypeContext(String packageName, Function<String, GeneratedType> generatedTypeFactory) Create a context targeting the specified package name and using the specified factory to create aGeneratedType
per requested package name.- Parameters:
packageName
- the main package namegeneratedTypeFactory
- the factory to use to create aGeneratedType
based on a package name.
-
-
Method Details
-
runtimeHints
Description copied from interface:GeneratedTypeContext
Return theRuntimeHints
instance to use to contribute hints for generated types.- Specified by:
runtimeHints
in interfaceGeneratedTypeContext
- Returns:
- the runtime hints
-
getGeneratedType
Description copied from interface:GeneratedTypeContext
Return aGeneratedType
for the specified package. If it does not exist, it is created.- Specified by:
getGeneratedType
in interfaceGeneratedTypeContext
- Parameters:
packageName
- the package name to use- Returns:
- a generated type
-
getMainGeneratedType
Description copied from interface:GeneratedTypeContext
Return the mainGeneratedType
.- Specified by:
getMainGeneratedType
in interfaceGeneratedTypeContext
- Returns:
- the generated type for the target package
-
hasGeneratedType
Specify if aGeneratedType
for the specified package name is registered.- Parameters:
packageName
- the package name to use- Returns:
true
if a type is registered for that package
-
toJavaFiles
Return the list ofJavaFile
of known generated type.- Returns:
- the java files of bootstrap classes in this instance
-