All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spi.processor.KotlinDataClassSpecProcessor.kt Maven / Gradle / Ivy

There is a newer version: 0.1.0
Show newest version
package io.toolisticon.kotlin.generation.spi.processor

import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi
import io.toolisticon.kotlin.generation.builder.KotlinDataClassSpecBuilder
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 [KotlinDataClassSpecBuilder].
 */
@ExperimentalKotlinPoetApi
abstract class KotlinDataClassSpecProcessor, INPUT : Any>(
  contextType: KClass,
  inputType: KClass,
  order: Int = KotlinCodeGenerationSpi.DEFAULT_ORDER
) : KotlinCodeGenerationProcessorBase(
  contextType = contextType,
  inputType = inputType,
  builderType = KotlinDataClassSpecBuilder::class,
  order = order
) {
  abstract override fun invoke(context: CONTEXT, input: INPUT, builder: KotlinDataClassSpecBuilder): KotlinDataClassSpecBuilder
  override fun test(context: CONTEXT, input: Any): Boolean = super.test(context, input)
}







© 2015 - 2024 Weber Informatics LLC | Privacy Policy