Interface StubGenerator

All Superinterfaces:
Generator
All Known Implementing Classes:
ControllerGenerator, MapperGenerator, RepositoryGenerator, ServiceGenerator

public interface StubGenerator extends Generator
Specialized generator for editable/non-editable stubs.
  • Method Details

    • build

      com.squareup.javapoet.JavaFile build(ModelDescriptor modelDescriptor, WriteContext ctx)
      Build the JavaFile representing the stub.
    • generate

      default List<com.squareup.javapoet.JavaFile> generate(ModelDescriptor modelDescriptor, WriteContext ctx)
      Generates the JavaFile for the given model descriptor. This method is called by the write method to produce the files.
      Specified by:
      generate in interface Generator
      Parameters:
      modelDescriptor - the model descriptor to generate code for
      ctx - shared write context
      Returns:
      a list of generated JavaFiles; never null
    • write

      default void write(ModelDescriptor modelDescriptor, WriteContext ctx)
      Writes the generated stub files to the context. Editable stubs are written just like non-editable ones; a subsequent tooling step will decide whether to keep or copy them into the user's source tree.
      Specified by:
      write in interface Generator
      Parameters:
      modelDescriptor - the model descriptor to generate code for
      ctx - shared write context