Interface KotlinCodeGenerationProcessor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract BUILDER invoke(CONTEXT context, INPUT input, BUILDER builder) Input is nullable because we could use processors solely based on context.
      Boolean test(CONTEXT context, Object input) If true, the spi instance is executed, else ignored.
      BUILDER execute(CONTEXT context, INPUT input, BUILDER builder) Checks if this strategy should be applied (using test) and then runs invoke.
      abstract KClass<CONTEXT> getContextType() The type of the generic CONTEXT, used to filter relevant instances.
      abstract KClass<INPUT> getInputType() The type of the generic INPUT, used to filter relevant instances.
      abstract Integer getOrder() Order is used to sort spi instances.
      abstract String getName() The name that is used when the implementing class is listed in a META-INF/services/ file.
      abstract KClass<BUILDER> getBuilderType()
      • Methods inherited from class io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi

        compareTo
      • Methods inherited from class java.util.function.BiPredicate

        and, negate, or
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • test

         Boolean test(CONTEXT context, Object input)

        If true, the spi instance is executed, else ignored.

        Parameters:
        context - the context we are operating in
        input - the concrete work item, for the check this is unbound and nullable, so we can check against calling with unsupported types.
        Returns:

        true when the spi shoud be applied.

      • execute

         BUILDER execute(CONTEXT context, INPUT input, BUILDER builder)

        Checks if this strategy should be applied (using test) and then runs invoke.

        Parameters:
        context - the context we are operating in
        input - the concrete work item, nullable for test.
        builder - the builder to modify
        Returns:

        the passed builder instance for fluent usage

      • getInputType

         abstract KClass<INPUT> getInputType()

        The type of the generic INPUT, used to filter relevant instances.

      • getOrder

         abstract Integer getOrder()

        Order is used to sort spi instances.

      • getName

         abstract String getName()

        The name that is used when the implementing class is listed in a META-INF/services/ file. Attention: SPI uses java naming, so inner classes have to be separated by $.