@@ -13,19 +13,40 @@ import io.toolisticon.kotlin.generation.poet.PoetSpecSupplier
13
13
import io.toolisticon.kotlin.generation.poet.TypeSpecSupplier
14
14
import io.toolisticon.kotlin.generation.support.SUPPRESS_UNUSED
15
15
16
+ /* *
17
+ * A supplier for Kotlin generator specs, which can be used to provide a spec for code generation.
18
+ * This is typically used in conjunction with Kotlin generator specifications.
19
+ */
16
20
interface KotlinGeneratorSpecSupplier <GENERATOR_SPEC > {
17
21
fun spec (): GENERATOR_SPEC
18
22
}
19
23
24
+ /* *
25
+ * A Kotlin generator specification that provides a code generation spec.
26
+ * It extends the [PoetSpecSupplier] interface to provide the underlying spec.
27
+ *
28
+ * @param SELF The type of the generator spec itself, used for fluent API.
29
+ * @param SPEC The type of the spec being generated.
30
+ * @param SUPPLIER The type of the supplier for the spec.
31
+ */
20
32
sealed interface KotlinGeneratorSpec <SELF : KotlinGeneratorSpec <SELF , SPEC , SUPPLIER >, SPEC : PoetSpec , SUPPLIER : PoetSpecSupplier <SPEC >> : PoetSpecSupplier <SPEC >, KotlinGeneratorSpecSupplier <SELF > {
21
33
override fun spec (): SELF
22
34
val code: String get() = get().toString()
23
35
}
24
36
37
+ /* *
38
+ * A Kotlin generator type specification that provides a type spec.
39
+ * It extends the [KotlinGeneratorSpec] interface to provide the underlying type spec.
40
+ *
41
+ * @param SELF The type of the generator spec itself, used for fluent API.
42
+ */
25
43
sealed interface KotlinGeneratorTypeSpec <SELF : KotlinGeneratorTypeSpec <SELF >> : KotlinGeneratorSpec <SELF , TypeSpec , TypeSpecSupplier >, TypeSpecSupplier {
26
44
override fun spec (): SELF
27
45
}
28
46
47
+ /* *
48
+ * Marks a spec as documentable, meaning it can be documented with KDoc.
49
+ */
29
50
@ExperimentalKotlinPoetApi
30
51
sealed interface KotlinDocumentableSpec : WithTags {
31
52
val kdoc: KDoc
0 commit comments