Interface ClassGenerator

All Known Implementing Classes:
AbstractClassGenerator, AbstractMapperClassGenerator, AbstractSchemaClassGenerator, CodeInterfaceClassGenerator, DataFetcherClassGenerator, DBClassGenerator, DTOGenerator, EnumDTOGenerator, ExceptionStrategyConfigurationGenerator, ExceptionToErrorMappingProviderGenerator, InputDTOGenerator, InterfaceDTOGenerator, JavaRecordMapperClassGenerator, OperationClassGenerator, RecordMapperClassGenerator, SelectHelperDBClassGenerator, TransformerClassGenerator, TypeDTOGenerator, TypeRegistryClassGenerator, TypeResolverClassGenerator, UnionDTOGenerator, WiringClassGenerator

public interface ClassGenerator
A class generator generates a set of classes for any purpose.
  • Method Details

    • generateAll

      List<no.sikt.graphitron.javapoet.TypeSpec> generateAll()
      Generate the classes and return the list of TypeSpecs.
    • generateAllToDirectory

      void generateAllToDirectory(String path, String packagePath)
      Parameters:
      path - The path to the output directory.
      packagePath - The package path that this class should be written to.
    • writeToFile

      void writeToFile(no.sikt.graphitron.javapoet.TypeSpec generatedClass, String path, String packagePath)
      Create the JavaFile for this class, add any common static imports and write it to file.
      Parameters:
      generatedClass - A complete javapoet TypeSpec.
      path - The path to the output directory.
      packagePath - The package path that this class should be written to.
    • writeToFile

      void writeToFile(no.sikt.graphitron.javapoet.TypeSpec generatedClass, String path, String packagePath, String directoryOverride)
      Create the JavaFile for this class, add any common static imports and write it to file.
      Parameters:
      generatedClass - A complete javapoet TypeSpec.
      path - The path to the output directory.
      packagePath - The package path that this class should be written to.
      directoryOverride - Override the directory within the package where the class is saved to.
    • generateAllAsMap

      Map<String,String> generateAllAsMap()
      Generate the classes and write them to a String.
    • writeToString

      String writeToString(no.sikt.graphitron.javapoet.TypeSpec generatedClass)
      Create the JavaFile for this class, add any common static imports and render the file as a string.
      Parameters:
      generatedClass - A complete javapoet TypeSpec.
    • getDefaultSaveDirectoryName

      String getDefaultSaveDirectoryName()
      Returns:
      The final directory path within the package where the classes are ultimately saved.
    • getFileNameSuffix

      String getFileNameSuffix()
      Returns:
      The suffix that is to be added to the end of file names generated by this class.
    • getSpec

      no.sikt.graphitron.javapoet.TypeSpec.Builder getSpec(String className, List<? extends MethodGenerator> generators)
      Parameters:
      className - The name of the class.
      generators - List of method generators that this class should use to generate its methods.
      Returns:
      A completed TypeSpec.Builder for this class, where all methods have already been added.