blob: f1193070b94edac7a1124b4574e1d906688615d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package org.jetbrains.dokka.model
public sealed class ExtraModifiers(public val name: String) {
public sealed class KotlinOnlyModifiers(name: String) : ExtraModifiers(name) {
public object Inline : KotlinOnlyModifiers("inline")
public object Value : KotlinOnlyModifiers("value")
public object Infix : KotlinOnlyModifiers("infix")
public object External : KotlinOnlyModifiers("external")
public object Suspend : KotlinOnlyModifiers("suspend")
public object Reified : KotlinOnlyModifiers("reified")
public object CrossInline : KotlinOnlyModifiers("crossinline")
public object NoInline : KotlinOnlyModifiers("noinline")
public object Override : KotlinOnlyModifiers("override")
public object Data : KotlinOnlyModifiers("data")
public object Const : KotlinOnlyModifiers("const")
public object Inner : KotlinOnlyModifiers("inner")
public object LateInit : KotlinOnlyModifiers("lateinit")
public object Operator : KotlinOnlyModifiers("operator")
public object TailRec : KotlinOnlyModifiers("tailrec")
public object VarArg : KotlinOnlyModifiers("vararg")
public object Fun : KotlinOnlyModifiers("fun")
}
public sealed class JavaOnlyModifiers(name: String) : ExtraModifiers(name) {
public object Static : JavaOnlyModifiers("static")
public object Native : JavaOnlyModifiers("native")
public object Synchronized : JavaOnlyModifiers("synchronized")
public object StrictFP : JavaOnlyModifiers("strictfp")
public object Transient : JavaOnlyModifiers("transient")
public object Volatile : JavaOnlyModifiers("volatile")
public object Transitive : JavaOnlyModifiers("transitive")
}
public companion object {
public fun valueOf(str: String): ExtraModifiers = when (str) {
"inline" -> KotlinOnlyModifiers.Inline
"value" -> KotlinOnlyModifiers.Value
"infix" -> KotlinOnlyModifiers.Infix
"external" -> KotlinOnlyModifiers.External
"suspend" -> KotlinOnlyModifiers.Suspend
"reified" -> KotlinOnlyModifiers.Reified
"crossinline" -> KotlinOnlyModifiers.CrossInline
"noinline" -> KotlinOnlyModifiers.NoInline
"override" -> KotlinOnlyModifiers.Override
"data" -> KotlinOnlyModifiers.Data
"const" -> KotlinOnlyModifiers.Const
"inner" -> KotlinOnlyModifiers.Inner
"lateinit" -> KotlinOnlyModifiers.LateInit
"operator" -> KotlinOnlyModifiers.Operator
"tailrec" -> KotlinOnlyModifiers.TailRec
"vararg" -> KotlinOnlyModifiers.VarArg
"static" -> JavaOnlyModifiers.Static
"native" -> JavaOnlyModifiers.Native
"synchronized" -> JavaOnlyModifiers.Synchronized
"strictfp" -> JavaOnlyModifiers.StrictFP
"transient" -> JavaOnlyModifiers.Transient
"volatile" -> JavaOnlyModifiers.Volatile
"transitive" -> JavaOnlyModifiers.Transitive
"fun" -> KotlinOnlyModifiers.Fun
else -> throw IllegalArgumentException("There is no Extra Modifier for given name $str")
}
}
}
|