Class CodegenParams

  • All Implemented Interfaces:

    
    public final class CodegenParams
    
                        

    Code generation parameters container.

    Parameters should be passed in an object of any class. The param object should have a parameterless constructor. Only one param object of a given class can be set.

    • Constructor Detail

      • CodegenParams

        CodegenParams()
    • Method Detail

      • getDryRun

         final Boolean getDryRun()

        Determines that module files will not be generated.

      • setDryRun

         final Unit setDryRun(Boolean dryRun)

        Determines that module files will not be generated.

      • getAllowDuplicateClasses

         final Boolean getAllowDuplicateClasses()

        Specifies whether to allow duplicate classes. If not, the generation process will end with an error when a class with the same name and package is declared. Otherwise, the class reported first will be generated and a warning will be logged.

      • setAllowDuplicateClasses

         final Unit setAllowDuplicateClasses(Boolean allowDuplicateClasses)

        Specifies whether to allow duplicate classes. If not, the generation process will end with an error when a class with the same name and package is declared. Otherwise, the class reported first will be generated and a warning will be logged.

      • get

         final <T extends Any> T get(Class<T> clazz)

        Retrieves an object with parameters of the given class.

        If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).

      • get

         final <T extends Any> T get(KClass<T> clazz)

        Retrieves an object with parameters of the given class.

        If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).

      • set

         final <T extends Any> CodegenParams set(T params)

        Set params object. If an object of the same class was previously added, it will be overwritten.

      • set

         final <T extends Any> CodegenParams set(KClass<T> clazz, Function1<T, Unit> updater)

        Set or update params object.

        If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).

      • set

         final <T extends Any> CodegenParams set(Class<T> clazz, Consumer<T> updater)

        Set or update params object.

        If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).