diff options
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 12 | ||||
-rw-r--r-- | core/src/main/kotlin/model/documentableProperties.kt | 17 | ||||
-rw-r--r-- | core/src/main/kotlin/pages/PageNodes.kt | 4 |
3 files changed, 23 insertions, 10 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 17b49f97..90958210 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -114,7 +114,7 @@ data class DPackage( ) : Documentable(), WithScope, WithExtraProperties<DPackage> { override val name = dri.packageName.orEmpty() override val children: List<Documentable> - get() = (properties + functions + classlikes) as List<Documentable> + get() = (properties + functions + classlikes) override fun withNewExtras(newExtras: PropertyContainer<DPackage>) = copy(extra = newExtras) } @@ -140,7 +140,7 @@ data class DClass( WithExtraProperties<DClass> { override val children: List<Documentable> - get() = (functions + properties + classlikes + constructors) as List<Documentable> + get() = (functions + properties + classlikes + constructors) override fun withNewExtras(newExtras: PropertyContainer<DClass>) = copy(extra = newExtras) } @@ -163,7 +163,7 @@ data class DEnum( override val extra: PropertyContainer<DEnum> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties<DEnum> { override val children: List<Documentable> - get() = (entries + functions + properties + classlikes + constructors) as List<Documentable> + get() = (entries + functions + properties + classlikes + constructors) override fun withNewExtras(newExtras: PropertyContainer<DEnum>) = copy(extra = newExtras) } @@ -180,7 +180,7 @@ data class DEnumEntry( override val extra: PropertyContainer<DEnumEntry> = PropertyContainer.empty() ) : Documentable(), WithScope, WithExtraProperties<DEnumEntry> { override val children: List<Documentable> - get() = (functions + properties + classlikes) as List<Documentable> + get() = (functions + properties + classlikes) override fun withNewExtras(newExtras: PropertyContainer<DEnumEntry>) = copy(extra = newExtras) } @@ -224,7 +224,7 @@ data class DInterface( override val extra: PropertyContainer<DInterface> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties<DInterface> { override val children: List<Documentable> - get() = (functions + properties + classlikes) as List<Documentable> + get() = (functions + properties + classlikes) override fun withNewExtras(newExtras: PropertyContainer<DInterface>) = copy(extra = newExtras) } @@ -266,7 +266,7 @@ data class DAnnotation( override val extra: PropertyContainer<DAnnotation> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithExtraProperties<DAnnotation>, WithGenerics { override val children: List<Documentable> - get() = (functions + properties + classlikes + constructors) as List<Documentable> + get() = (functions + properties + classlikes + constructors) override fun withNewExtras(newExtras: PropertyContainer<DAnnotation>) = copy(extra = newExtras) } diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index f630ba3b..699a1df1 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -1,13 +1,28 @@ package org.jetbrains.dokka.model +import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.model.properties.MergeStrategy -data class InheritedFunction(val isInherited: Boolean): ExtraProperty<DFunction> { +data class InheritedFunction(val inheritedFrom: DRI?): ExtraProperty<DFunction> { companion object : ExtraProperty.Key<DFunction, InheritedFunction> { override fun mergeStrategyFor(left: InheritedFunction, right: InheritedFunction) = MergeStrategy.Fail { throw IllegalArgumentException("Function inheritance should be consistent!") } } + + val isInherited: Boolean + get() = inheritedFrom != null + override val key: ExtraProperty.Key<DFunction, *> = InheritedFunction +} + +data class ImplementedInterfaces(val interfaces: List<DRI>): ExtraProperty<Documentable> { + companion object : ExtraProperty.Key<Documentable, ImplementedInterfaces> { + override fun mergeStrategyFor(left: ImplementedInterfaces, right: ImplementedInterfaces) = MergeStrategy.Fail { + throw IllegalArgumentException("Implemented interfaces should be consistent!") + } + } + + override val key: ExtraProperty.Key<Documentable, *> = ImplementedInterfaces }
\ No newline at end of file diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt index 42ca25cc..b9f1025f 100644 --- a/core/src/main/kotlin/pages/PageNodes.kt +++ b/core/src/main/kotlin/pages/PageNodes.kt @@ -1,9 +1,7 @@ package org.jetbrains.dokka.pages -import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.model.Documentable -import org.jetbrains.dokka.Platform import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.Documentable import java.util.* interface PageNode { |