aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Java/JavadocParser.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/Java/JavadocParser.kt')
-rw-r--r--core/src/main/kotlin/Java/JavadocParser.kt15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt
index 21cc2bbdf..0c73e7661 100644
--- a/core/src/main/kotlin/Java/JavadocParser.kt
+++ b/core/src/main/kotlin/Java/JavadocParser.kt
@@ -25,6 +25,7 @@ data class JavadocParseResult(
val deprecatedContent: Content?,
val attributeRefs: List<String>,
val apiLevel: DocumentationNode? = null,
+ val sdkExtSince: DocumentationNode? = null,
val deprecatedLevel: DocumentationNode? = null,
val artifactId: DocumentationNode? = null,
val attribute: DocumentationNode? = null
@@ -35,6 +36,7 @@ data class JavadocParseResult(
emptyList(),
null,
null,
+ null,
null
)
}
@@ -109,6 +111,7 @@ class JavadocParser(
val attrRefSignatures = mutableListOf<String>()
var since: DocumentationNode? = null
+ var sdkextsince: DocumentationNode? = null
var deprecated: DocumentationNode? = null
var artifactId: DocumentationNode? = null
var attrName: String? = null
@@ -135,6 +138,9 @@ class JavadocParser(
"since", "apisince" -> {
since = DocumentationNode(tag.getApiLevel() ?: "", Content.Empty, NodeKind.ApiLevel)
}
+ "sdkextsince" -> {
+ sdkextsince = DocumentationNode(tag.getSdkExtSince() ?: "", Content.Empty, NodeKind.SdkExtSince)
+ }
"deprecatedsince" -> {
deprecated = DocumentationNode(tag.getApiLevel() ?: "", Content.Empty, NodeKind.DeprecatedLevel)
}
@@ -153,7 +159,7 @@ class JavadocParser(
attrName?.let { name ->
attr = DocumentationNode(name, attrDesc ?: Content.Empty, NodeKind.AttributeRef)
}
- return JavadocParseResult(result, deprecatedContent, attrRefSignatures, since, deprecated, artifactId, attr)
+ return JavadocParseResult(result, deprecatedContent, attrRefSignatures, since, sdkextsince, deprecated, artifactId, attr)
}
private val tagsToInherit = setOf("param", "return", "throws")
@@ -182,6 +188,13 @@ class JavadocParser(
return null
}
+ fun PsiDocTag.getSdkExtSince(): String? {
+ if (dataElements.isNotEmpty()) {
+ return join(dataElements.map { it.text }, " ")
+ }
+ return null
+ }
+
private fun PsiDocTag.getAttrRef(element: PsiNamedElement): String? {
if (dataElements.size > 1) {
val elementText = dataElements[1].text