Package org.springframework.aot.generate
Class GeneratedClasses
java.lang.Object
org.springframework.aot.generate.GeneratedClasses
A managed collection of generated classes. This class is stateful so the
same instance should be used for all class generation.
- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionGeneratedClasses
(ClassNameGenerator classNameGenerator) Create a new instance using the specified naming conventions. -
Method Summary
Modifier and TypeMethodDescriptionforFeature
(String featureName) Prepare aGeneratedClass
for the specifiedfeatureName
and no particular component.forFeatureComponent
(String featureName, Class<?> component) void
writeTo
(GeneratedFiles generatedFiles) Write thegenerated classes
using the givenGeneratedFiles
instance.
-
Constructor Details
-
GeneratedClasses
Create a new instance using the specified naming conventions.- Parameters:
classNameGenerator
- the class name generator to use
-
-
Method Details
-
forFeatureComponent
- Parameters:
featureName
- the name of the feature to associate with the generated classcomponent
- the target component- Returns:
- a
GeneratedClasses.Builder
for further configuration
-
forFeature
Prepare aGeneratedClass
for the specifiedfeatureName
and no particular component. This should be used for high-level code generation that are widely applicable and for entry points.- Parameters:
featureName
- the name of the feature to associate with the generated class- Returns:
- a
GeneratedClasses.Builder
for further configuration
-
writeTo
Write thegenerated classes
using the givenGeneratedFiles
instance.- Parameters:
generatedFiles
- where to write the generated classes- Throws:
IOException
- on IO error
-