Support reading from class files of the type use annotations on type parameters and type arguments
^KT-11454 Fixed
This commit is contained in:
+12
-4
@@ -29,9 +29,9 @@ interface JavaNamedElement : JavaElement {
|
||||
|
||||
interface JavaAnnotationOwner : JavaElement {
|
||||
val annotations: Collection<JavaAnnotation>
|
||||
fun findAnnotation(fqName: FqName): JavaAnnotation?
|
||||
|
||||
val isDeprecatedInJavaDoc: Boolean
|
||||
|
||||
fun findAnnotation(fqName: FqName): JavaAnnotation?
|
||||
}
|
||||
|
||||
interface JavaModifierListOwner : JavaElement {
|
||||
@@ -56,9 +56,17 @@ interface JavaAnnotation : JavaElement {
|
||||
|
||||
interface MapBasedJavaAnnotationOwner : JavaAnnotationOwner {
|
||||
val annotationsByFqName: Map<FqName?, JavaAnnotation>
|
||||
|
||||
override val isDeprecatedInJavaDoc: Boolean get() = false
|
||||
override fun findAnnotation(fqName: FqName) = annotationsByFqName[fqName]
|
||||
override val isDeprecatedInJavaDoc: Boolean
|
||||
get() = false
|
||||
}
|
||||
|
||||
interface ListBasedJavaAnnotationOwner : JavaAnnotationOwner {
|
||||
override fun findAnnotation(fqName: FqName) = annotations.find { it.classId?.asSingleFqName() == fqName }
|
||||
}
|
||||
|
||||
interface MutableJavaAnnotationOwner : JavaAnnotationOwner {
|
||||
override val annotations: MutableCollection<JavaAnnotation>
|
||||
}
|
||||
|
||||
fun JavaAnnotationOwner.buildLazyValueForMap() = lazy {
|
||||
|
||||
@@ -18,13 +18,13 @@ package org.jetbrains.kotlin.load.java.structure
|
||||
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType
|
||||
|
||||
interface JavaType
|
||||
interface JavaType : ListBasedJavaAnnotationOwner
|
||||
|
||||
interface JavaArrayType : JavaType {
|
||||
val componentType: JavaType
|
||||
}
|
||||
|
||||
interface JavaClassifierType : JavaType, JavaAnnotationOwner {
|
||||
interface JavaClassifierType : JavaType {
|
||||
val classifier: JavaClassifier?
|
||||
val typeArguments: List<JavaType?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user