Make DescriptorVisibility delegate to Visibility
This commit is contained in:
+20
@@ -5,11 +5,14 @@
|
||||
|
||||
package org.jetbrains.kotlin.descriptors.java
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.EffectiveVisibility
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
|
||||
object JavaVisibilities {
|
||||
object PackageVisibility : Visibility("package", isPublicAPI = false) {
|
||||
override fun mustCheckInImports(): Boolean = true
|
||||
|
||||
override fun compareTo(visibility: Visibility): Int? {
|
||||
if (this === visibility) return 0
|
||||
if (Visibilities.isPrivate(visibility)) return 1
|
||||
@@ -22,15 +25,27 @@ object JavaVisibilities {
|
||||
|
||||
override val internalDisplayName: String
|
||||
get() = "public/*package*/"
|
||||
|
||||
override val externalDisplayName: String
|
||||
get() = "package-private"
|
||||
|
||||
override fun customEffectiveVisibility(): EffectiveVisibility? {
|
||||
return EffectiveVisibility.PackagePrivate
|
||||
}
|
||||
}
|
||||
|
||||
object ProtectedStaticVisibility : Visibility("protected_static", isPublicAPI = true) {
|
||||
override fun mustCheckInImports(): Boolean = false
|
||||
|
||||
override fun normalize(): Visibility {
|
||||
return Visibilities.Protected
|
||||
}
|
||||
|
||||
override val internalDisplayName: String
|
||||
get() = "protected/*protected static*/"
|
||||
|
||||
override val externalDisplayName: String
|
||||
get() = "protected"
|
||||
}
|
||||
|
||||
object ProtectedAndPackage : Visibility("protected_and_package", isPublicAPI = true) {
|
||||
@@ -44,7 +59,12 @@ object JavaVisibilities {
|
||||
return Visibilities.Protected
|
||||
}
|
||||
|
||||
override fun mustCheckInImports(): Boolean = false
|
||||
|
||||
override val internalDisplayName: String
|
||||
get() = "protected/*protected and package*/"
|
||||
|
||||
override val externalDisplayName: String
|
||||
get() = "protected"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user