Package org.springframework.aot.generate

# Interface GenerationContext

All Known Implementing Classes:
  `DefaultGenerationContext`

public interface GenerationContext
Central interface used for code generation.

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 Type
Method
Description
`GeneratedClasses`
`getGeneratedClasses()`
Get the `GeneratedClasses` used by the context.
`GeneratedFiles`
`getGeneratedFiles()`
Get the `GeneratedFiles` used by the context.
`RuntimeHints`
`getRuntimeHints()`
Get the `RuntimeHints` used by the context.
`GenerationContext`
`withName(String name)`
Create a new `GenerationContext` instance using the specified name to qualify generated assets for a dedicated round of code generation.

## Method Details

### getGeneratedClasses

GeneratedClasses getGeneratedClasses()
Get the `GeneratedClasses` used by the context.

All generated classes are written at the end of AOT processing.

Returns:
  the generated classes

### getGeneratedFiles

GeneratedFiles getGeneratedFiles()
Get the `GeneratedFiles` used by the context.

Used to write resource, java source, or class bytecode files.

Returns:
  the generated files

### getRuntimeHints

RuntimeHints getRuntimeHints()
Get the `RuntimeHints` used 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

GenerationContext withName(String name)
Create a new `GenerationContext` instance 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 `GenerationContext` for the specified name