Class GeneratedClasses

java.lang.Object
org.springframework.aot.generate.GeneratedClasses

public class GeneratedClasses extends Object
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:
  • Constructor Details

    • GeneratedClasses

      public GeneratedClasses(ClassNameGenerator classNameGenerator)
      Create a new instance using the specified naming conventions.
      Parameters:
      classNameGenerator - the class name generator to use
  • Method Details

    • forFeatureComponent

      public GeneratedClasses.Builder forFeatureComponent(String featureName, Class<?> component)
      Prepare a GeneratedClass for the specified featureName targeting the specified component.
      Parameters:
      featureName - the name of the feature to associate with the generated class
      component - the target component
      Returns:
      a GeneratedClasses.Builder for further configuration
    • forFeature

      public GeneratedClasses.Builder forFeature(String featureName)
      Prepare a GeneratedClass for the specified featureName 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

      public void writeTo(GeneratedFiles generatedFiles) throws IOException
      Write the generated classes using the given GeneratedFiles instance.
      Parameters:
      generatedFiles - where to write the generated classes
      Throws:
      IOException - on IO error