Skip to content

Commit 8ec9d42

Browse files
committed
add docs
1 parent 21fcb54 commit 8ec9d42

File tree

1 file changed

+21
-0
lines changed
  • kotlin-code-generation/src/main/kotlin/spec

1 file changed

+21
-0
lines changed

kotlin-code-generation/src/main/kotlin/spec/_types.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,40 @@ import io.toolisticon.kotlin.generation.poet.PoetSpecSupplier
1313
import io.toolisticon.kotlin.generation.poet.TypeSpecSupplier
1414
import io.toolisticon.kotlin.generation.support.SUPPRESS_UNUSED
1515

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+
*/
1620
interface KotlinGeneratorSpecSupplier<GENERATOR_SPEC> {
1721
fun spec(): GENERATOR_SPEC
1822
}
1923

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+
*/
2032
sealed interface KotlinGeneratorSpec<SELF : KotlinGeneratorSpec<SELF, SPEC, SUPPLIER>, SPEC : PoetSpec, SUPPLIER : PoetSpecSupplier<SPEC>> : PoetSpecSupplier<SPEC>, KotlinGeneratorSpecSupplier<SELF> {
2133
override fun spec(): SELF
2234
val code: String get() = get().toString()
2335
}
2436

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+
*/
2543
sealed interface KotlinGeneratorTypeSpec<SELF : KotlinGeneratorTypeSpec<SELF>> : KotlinGeneratorSpec<SELF, TypeSpec, TypeSpecSupplier>, TypeSpecSupplier {
2644
override fun spec(): SELF
2745
}
2846

47+
/**
48+
* Marks a spec as documentable, meaning it can be documented with KDoc.
49+
*/
2950
@ExperimentalKotlinPoetApi
3051
sealed interface KotlinDocumentableSpec : WithTags {
3152
val kdoc: KDoc

0 commit comments

Comments
 (0)