Interface GenerationContext
- All Known Implementing Classes:
DefaultGenerationContext, TestGenerationContext
A generation context provides:
- Management of all generated classes, including naming convention support.
- Central management of all generated files.
- Support for recording runtime hints.
If a dedicated round of code generation is required while processing, it
is possible to create a specialized context using withName(String).
- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
-
Method Summary
Modifier and TypeMethodDescriptionGet theGeneratedClassesused by the context.Get theGeneratedFilesused by the context.Get theGeneratedResourcesused by the context.Get theRuntimeHintsused by the context.Create a newGenerationContextinstance using the specified name to qualify generated assets for a dedicated round of code generation.
-
Method Details
-
getGeneratedClasses
GeneratedClasses getGeneratedClasses()Get theGeneratedClassesused by the context.All generated classes are written at the end of AOT processing.
- Returns:
- the generated classes
-
getGeneratedResources
GeneratedResources getGeneratedResources()Get theGeneratedResourcesused by the context.All generated resources are written at the end of AOT processing.
- Returns:
- the generated resources
- Since:
- 7.1
-
getGeneratedFiles
GeneratedFiles getGeneratedFiles()Get theGeneratedFilesused by the context.Used to write Java source, resource, or class bytecode files. For Java source and resource files, use
getGeneratedClasses()andgetGeneratedResources(), respectively. Class bytecode files have no dedicated abstraction and must be written directly using this method.- Returns:
- the generated files
- See Also:
-
getRuntimeHints
RuntimeHints getRuntimeHints()Get theRuntimeHintsused by the context.Used to record reflection, resource, serialization, and proxy hints so that the application can run as a native image.
- Returns:
- the runtime hints
-
withName
Create a newGenerationContextinstance using the specified name to qualify generated assets for a dedicated round of code generation.If the specified name is already in use, a unique sequence is added to ensure the name is unique.
- Parameters:
name- the name to use- Returns:
- a specialized
GenerationContextfor the specified name
-