spi.strategy.KotlinFunSpecStrategy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-code-generation Show documentation
Show all versions of kotlin-code-generation Show documentation
Wrapping core components for kotlin code generation with kotlin-poet.
The newest version!
package io.toolisticon.kotlin.generation.spi.strategy
import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi
import io.toolisticon.kotlin.generation.spec.KotlinFunSpec
import io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationContext
import io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi
import kotlin.reflect.KClass
/**
* Used to implement a [io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy]
* that will generate a [KotlinFunSpec].
*/
@ExperimentalKotlinPoetApi
abstract class KotlinFunSpecStrategy, INPUT : Any>(
contextType: KClass,
override val inputType: KClass,
order: Int = KotlinCodeGenerationSpi.DEFAULT_ORDER,
) : KotlinCodeGenerationStrategyBase(
contextType = contextType,
inputType = inputType,
specType = KotlinFunSpec::class,
order = order
) {
abstract override fun invoke(context: CONTEXT, input: INPUT): KotlinFunSpec
override fun test(context: CONTEXT, input: Any): Boolean = super.test(context, input)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy