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
ConstructorsConstructorDescriptionDefaultGeneratedTypeContext(String packageName, Function<String, GeneratedType> generatedTypeFactory) Create a context targeting the specified package name and using the specified factory to create aGeneratedTypeper requested package name. -
Method Summary
Modifier and TypeMethodDescriptiongetGeneratedType(String packageName) Return aGeneratedTypefor the specified package.Return the mainGeneratedType.booleanhasGeneratedType(String packageName) Specify if aGeneratedTypefor the specified package name is registered.Return theRuntimeHintsinstance to use to contribute hints for generated types.List<org.springframework.javapoet.JavaFile>Return the list ofJavaFileof 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 aGeneratedTypeper requested package name.- Parameters:
packageName- the main package namegeneratedTypeFactory- the factory to use to create aGeneratedTypebased on a package name.
-
-
Method Details
-
runtimeHints
Description copied from interface:GeneratedTypeContextReturn theRuntimeHintsinstance to use to contribute hints for generated types.- Specified by:
runtimeHintsin interfaceGeneratedTypeContext- Returns:
- the runtime hints
-
getGeneratedType
Description copied from interface:GeneratedTypeContextReturn aGeneratedTypefor the specified package. If it does not exist, it is created.- Specified by:
getGeneratedTypein interfaceGeneratedTypeContext- Parameters:
packageName- the package name to use- Returns:
- a generated type
-
getMainGeneratedType
Description copied from interface:GeneratedTypeContextReturn the mainGeneratedType.- Specified by:
getMainGeneratedTypein interfaceGeneratedTypeContext- Returns:
- the generated type for the target package
-
hasGeneratedType
Specify if aGeneratedTypefor the specified package name is registered.- Parameters:
packageName- the package name to use- Returns:
trueif a type is registered for that package
-
toJavaFiles
Return the list ofJavaFileof known generated type.- Returns:
- the java files of bootstrap classes in this instance
-