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

org.jetbrains.kotlin.doc.templates.ClassTemplate.kt Maven / Gradle / Ivy

There is a newer version: 0.12.1230
Show newest version
package org.jetbrains.kotlin.doc.templates

import org.jetbrains.kotlin.doc.model.KClass
import org.jetbrains.kotlin.doc.model.KModel
import org.jetbrains.kotlin.doc.model.KPackage

open class ClassTemplate(open val model: KModel, pkg: KPackage, open val klass: KClass) : PackageTemplateSupport(pkg) {

    open fun pageTitle(): String = "${klass.name} (${model.title})"

    override fun render() {
        println("""



$generatedComment


${pageTitle()}




${stylesheets()}








""") printPrevNextClass() println("""
""") printBody() println(""" """) printPrevNextClass() println("""

Copyright © 2010-2012. All Rights Reserved. """) } open fun printBody(): Unit { println("""

${pkg.name}
Class ${klass.simpleName}

""")

        for (bc in klass.baseClasses) {
            println(link(bc, true))
        }
        println("""  extended by ${klass.name}

""")
        printAnnotations(klass.annotations)
        print("""${klass.visibility} ${klass.kindCode} ${klass.simpleName}
""") if (!klass.baseClasses.isEmpty()) { print("""extends """) for (bc in klass.baseClasses) { println(link(bc)) } } println("""

""") println(klass.detailedDescription(this)) if (klass.since.size > 0 || klass.authors.size > 0) { println("""

""") if (klass.since.size > 0) { println("""
Since:
${klass.since}
""") } for (author in klass.authors) { println("""
Author:
${author}
""") } println("""
""") } println("""

""") val nestedClasses = klass.nestedClasses if (!nestedClasses.isEmpty()) { println("""

""") for (nc in nestedClasses) { println("""""") } println("""
Nested Class Summary
static class ${klass.simpleName}.${nc.simpleName}
          ${nc.description(this)}
 """) } printPropertySummary(klass.properties) printFunctionSummary(klass.functions) printFunctionDetail(klass.functions) println("""
""") } open fun printPrevNextClass(): Unit { println("""""") val prev = pkg.previous(klass) if (prev != null) { println(""" PREV CLASS """) } val next = pkg.next(klass) if (next != null) { println(""" NEXT CLASS""") } println("""""") } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy