Class BuilderGenerator

java.lang.Object
io.micronaut.sourcegen.generator.visitors.BuilderGenerator

public class BuilderGenerator extends Object
Exposes methods that can be used to create builders from other processors.
  • Constructor Details

    • BuilderGenerator

      public BuilderGenerator()
  • Method Details

    • createBuilder

      @NonNull public static ClassDef.ClassDefBuilder createBuilder(String packageName, @NonNull @NonNull ClassTypeDef elementType, @Nullable @Nullable io.micronaut.core.annotation.AnnotationValue<Builder> builderAnnotationValue, @NonNull @NonNull List<io.micronaut.inject.ast.PropertyElement> properties, @NonNull @NonNull List<io.micronaut.inject.ast.ParameterElement> constructorParameters)
      Create a builder for the given arguments.
      Parameters:
      packageName - The package name
      elementType - The element type
      builderAnnotationValue - The builder annotation value.
      properties - The properties
      constructorParameters - The constructor parameters
      Returns:
      A class definition builder for the builder
    • createBuilder

      public static ClassDef.ClassDefBuilder createBuilder(String packageName, ClassTypeDef elementType, io.micronaut.core.annotation.AnnotationValue<Builder> builderAnnotationValue, List<io.micronaut.inject.ast.PropertyElement> properties, List<io.micronaut.inject.ast.ParameterElement> constructorParameters, Function<BuilderGenerator.BuildContext,StatementDef> buildReturnStatement)
      Create a builder for the given arguments.
      Parameters:
      packageName - The package name
      elementType - The element type
      builderAnnotationValue - The builder annotation value.
      properties - The properties
      constructorParameters - The constructor parameters
      buildReturnStatement - The return statement to use for building.
      Returns:
      A class definition builder for the builder