spi.processor.KotlinAnnotationSpecProcessor.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.
package io.toolisticon.kotlin.generation.spi.processor
import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi
import io.toolisticon.kotlin.generation.builder.KotlinAnnotationSpecBuilder
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.KotlinCodeGenerationProcessor]
* that will visit/modify a [KotlinAnnotationSpecBuilder].
*/
@ExperimentalKotlinPoetApi
abstract class KotlinAnnotationSpecProcessor, INPUT : Any>(
contextType: KClass,
inputType: KClass,
order: Int = KotlinCodeGenerationSpi.DEFAULT_ORDER
) : KotlinCodeGenerationProcessorBase(
contextType = contextType,
inputType = inputType,
order = order,
builderType = KotlinAnnotationSpecBuilder::class
) {
abstract override fun invoke(context: CONTEXT, input: INPUT, builder: KotlinAnnotationSpecBuilder): KotlinAnnotationSpecBuilder
override fun test(context: CONTEXT, input: Any): Boolean = super.test(context, input)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy