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:
- 
Method SummaryModifier and TypeMethodDescriptionaddForFeature(String featureName, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Add a new generated class for the specifiedfeatureNameand no particular component.addForFeatureComponent(String featureName, Class<?> targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Add a new generated class for the specifiedfeatureNametargeting the specifiedcomponent.addForFeatureComponent(String featureName, org.springframework.javapoet.ClassName targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Add a new generated class for the specifiedfeatureNametargeting the specifiedcomponent.getOrAddForFeature(String featureName, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a generated class for the specifiedfeatureNameand no particular component.getOrAddForFeatureComponent(String featureName, Class<?> targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a generated class for the specifiedfeatureNametargeting the specifiedcomponent.getOrAddForFeatureComponent(String featureName, org.springframework.javapoet.ClassName targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a generated class for the specifiedfeatureNametargeting the specifiedcomponent.
- 
Method Details- 
getOrAddForFeaturepublic GeneratedClass getOrAddForFeature(String featureName, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a generated class for the specifiedfeatureNameand no particular component. If this method has previously been called with the givenfeatureNamethe existing class will be returned, otherwise a new class will be generated.- Parameters:
- featureName- the name of the feature to associate with the generated class
- type- a- Consumerused to build the type
- Returns:
- an existing or newly generated class
 
- 
getOrAddForFeatureComponentpublic GeneratedClass getOrAddForFeatureComponent(String featureName, org.springframework.javapoet.ClassName targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a generated class for the specifiedfeatureNametargeting the specifiedcomponent. If this method has previously been called with the givenfeatureName/targetthe existing class will be returned, otherwise a new class will be generated, otherwise a new class will be generated.- Parameters:
- featureName- the name of the feature to associate with the generated class
- targetComponent- the target component
- type- a- Consumerused to build the type
- Returns:
- an existing or newly generated class
 
- 
getOrAddForFeatureComponentpublic GeneratedClass getOrAddForFeatureComponent(String featureName, Class<?> targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a generated class for the specifiedfeatureNametargeting the specifiedcomponent. If this method has previously been called with the givenfeatureName/targetthe existing class will be returned, otherwise a new class will be generated, otherwise a new class will be generated.- Parameters:
- featureName- the name of the feature to associate with the generated class
- targetComponent- the target component
- type- a- Consumerused to build the type
- Returns:
- an existing or newly generated class
 
- 
addForFeaturepublic GeneratedClass addForFeature(String featureName, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Add a new generated class for the specifiedfeatureNameand no particular component.- Parameters:
- featureName- the name of the feature to associate with the generated class
- type- a- Consumerused to build the type
- Returns:
- the newly generated class
 
- 
addForFeatureComponentpublic GeneratedClass addForFeatureComponent(String featureName, org.springframework.javapoet.ClassName targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Add a new generated class for the specifiedfeatureNametargeting the specifiedcomponent.- Parameters:
- featureName- the name of the feature to associate with the generated class
- targetComponent- the target component
- type- a- Consumerused to build the type
- Returns:
- the newly generated class
 
- 
addForFeatureComponentpublic GeneratedClass addForFeatureComponent(String featureName, Class<?> targetComponent, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Add a new generated class for the specifiedfeatureNametargeting the specifiedcomponent.- Parameters:
- featureName- the name of the feature to associate with the generated class
- targetComponent- the target component
- type- a- Consumerused to build the type
- Returns:
- the newly generated class
 
 
-