Package org.springframework.aot.generate
Class DefaultGenerationContext
java.lang.Object
org.springframework.aot.generate.DefaultGenerationContext
- All Implemented Interfaces:
GenerationContext
Default implementation of
GenerationContext
.- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
-
Constructor Summary
ConstructorDescriptionDefaultGenerationContext
(ClassNameGenerator classNameGenerator, GeneratedFiles generatedFiles, RuntimeHints runtimeHints) Create a newDefaultGenerationContext
instance backed by the specified items.DefaultGenerationContext
(GeneratedFiles generatedFiles) Create a newDefaultGenerationContext
instance backed by the specifiedgeneratedFiles
. -
Method Summary
Modifier and TypeMethodDescriptionReturn theGeneratedClasses
being used by the context.Return theClassNameGenerator
being used by the context.Return theGeneratedFiles
being used by the context.Return theRuntimeHints
being used by the context.void
Write any generated content out to the generated files.
-
Constructor Details
-
DefaultGenerationContext
Create a newDefaultGenerationContext
instance backed by the specifiedgeneratedFiles
.- Parameters:
generatedFiles
- the generated files
-
DefaultGenerationContext
public DefaultGenerationContext(ClassNameGenerator classNameGenerator, GeneratedFiles generatedFiles, RuntimeHints runtimeHints) Create a newDefaultGenerationContext
instance backed by the specified items.- Parameters:
classNameGenerator
- the class name generatorgeneratedFiles
- the generated filesruntimeHints
- the runtime hints
-
-
Method Details
-
getClassNameGenerator
Description copied from interface:GenerationContext
Return theClassNameGenerator
being used by the context. Allows new class names to be generated before they are added to thegenerated files
.- Specified by:
getClassNameGenerator
in interfaceGenerationContext
- Returns:
- the class name generator
- See Also:
-
getClassGenerator
Description copied from interface:GenerationContext
Return theGeneratedClasses
being used by the context. Allows a single generated class to be shared across multiple AOT processors. All generated classes are written at the end of AOT processing.- Specified by:
getClassGenerator
in interfaceGenerationContext
- Returns:
- the generated classes
-
getGeneratedFiles
Description copied from interface:GenerationContext
Return theGeneratedFiles
being used by the context. Used to write resource, java source or class bytecode files.- Specified by:
getGeneratedFiles
in interfaceGenerationContext
- Returns:
- the generated files
-
getRuntimeHints
Description copied from interface:GenerationContext
Return theRuntimeHints
being used by the context. Used to recordreflection
,resource
,serialization
andproxy
hints so that the application can run as a native image.- Specified by:
getRuntimeHints
in interfaceGenerationContext
- Returns:
- the runtime hints
-
writeGeneratedContent
public void writeGeneratedContent()Write any generated content out to the generated files.
-