From 433b8965b040c0d4ccb690c08489a9a4a89c4f8b Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 14 Jul 2014 19:33:43 +0400 Subject: Add renderName for formatting names of entities in lists, links, etc --- src/Generation/JavaSignatureGenerator.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Generation/JavaSignatureGenerator.kt') diff --git a/src/Generation/JavaSignatureGenerator.kt b/src/Generation/JavaSignatureGenerator.kt index e7458eba..01e51d74 100644 --- a/src/Generation/JavaSignatureGenerator.kt +++ b/src/Generation/JavaSignatureGenerator.kt @@ -23,6 +23,13 @@ class JavaSignatureGenerator : SignatureGenerator { } } + override fun renderName(node: DocumentationNode): String { + return when (node.kind) { + Kind.Constructor -> node.owner!!.name + else -> node.name + } + } + override fun renderPackage(node: DocumentationNode): String { return "package ${node.name}" } @@ -99,9 +106,7 @@ class JavaSignatureGenerator : SignatureGenerator { override fun renderFunction(node: DocumentationNode): String { return StringBuilder { when (node.kind) { - Kind.Constructor -> { - append(node.owner?.name) - } + Kind.Constructor -> append(node.owner?.name) Kind.Function -> { append(renderTypeParametersForNode(node)) append(renderType(node.detail(Kind.Type))) -- cgit