diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-02-26 13:16:31 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-03-04 14:28:14 +0100 |
commit | 10874a53b0db00c45d4ab44dfd226672dcf75115 (patch) | |
tree | 0ae29fcd867bf5c559d635d7d8e38183f10e25d0 /core/src/main/kotlin/model | |
parent | d41b4c65a0ace7e60f19fc9211947d894a0442f1 (diff) | |
download | dokka-10874a53b0db00c45d4ab44dfd226672dcf75115.tar.gz dokka-10874a53b0db00c45d4ab44dfd226672dcf75115.tar.bz2 dokka-10874a53b0db00c45d4ab44dfd226672dcf75115.zip |
Sketch of default signature provider
Diffstat (limited to 'core/src/main/kotlin/model')
-rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 15 | ||||
-rw-r--r-- | core/src/main/kotlin/model/SignatureProvider.kt | 7 |
2 files changed, 16 insertions, 6 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index c16f8a87..4190edc3 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -315,7 +315,7 @@ data class TypeParameter( override val dri: DRI, override val name: String, override val documentation: PlatformDependent<DocumentationNode>, - val bounds: List<Projection>, + val bounds: List<Bound>, override val platformData: List<PlatformData>, override val extra: PropertyContainer<TypeParameter> = PropertyContainer.empty() ) : Documentable(), WithExtraProperties<TypeParameter> { @@ -325,11 +325,14 @@ data class TypeParameter( override fun withNewExtras(newExtras: PropertyContainer<TypeParameter>) = copy(extra = newExtras) } -sealed class Projection { - data class OtherParameter(val name: String) : Projection() - object Star : Projection() - data class TypeConstructor(val dri: DRI, val projections: List<Projection>) : Projection() - data class Nullable(val inner: Projection) : Projection() +sealed class Projection +sealed class Bound : Projection() +data class OtherParameter(val name: String) : Bound() +object Star : Projection() +data class TypeConstructor(val dri: DRI, val projections: List<Projection>) : Bound() +data class Nullable(val inner: Bound) : Bound() +data class Variance(val kind: Kind, val inner: Bound): Projection() { + enum class Kind { In, Out } } enum class ExtraModifiers { diff --git a/core/src/main/kotlin/model/SignatureProvider.kt b/core/src/main/kotlin/model/SignatureProvider.kt new file mode 100644 index 00000000..2df0f4b6 --- /dev/null +++ b/core/src/main/kotlin/model/SignatureProvider.kt @@ -0,0 +1,7 @@ +package org.jetbrains.dokka.model + +import org.jetbrains.dokka.pages.ContentNode + +interface SignatureProvider { + fun signature(documentable: Documentable): List<ContentNode> +}
\ No newline at end of file |