Class Codegen


public class Codegen extends Object
Central piece of code processing and generation. This type loads extension providers, and invokes each CodegenExtension with appropriate types and annotations.
  • Method Details

    • create

      public static Codegen create(CodegenContext ctx, TypeName generator)
      Create a new instance of the top level Codegen. This type discovers all CodegenExtensionProviders and invokes the provided CodegenExtensions as needed.
      ctx - code processing and generation context
      generator - type name of the invoking generator (such as maven plugin, annotation procesor, command line tool)
      a new codegen instance
    • supportedOptions

      public static Set<Option<?>> supportedOptions()
      Set of supported options by all extensions.
      supported options
    • process

      public void process(List<TypeInfo> allTypes)
      Process all types discovered. This method analyzes the types and invokes each extension with the correct subset.
      allTypes - all types for this processing round
    • processingOver

      public void processingOver()
      Finish processing. No additional rounds will be done.
    • supportedAnnotations

      public Set<TypeName> supportedAnnotations()
      A set of annotation types.
      set of annotations that should be processed
    • supportedAnnotationPackagePrefixes

      public Set<String> supportedAnnotationPackagePrefixes()
      A set of package prefixes (expected to end with a .).
      set of package prefixes of annotations that should be processed