Spring Support: Implement bean references in @Qualifier annotations

#KT-12092 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-27 15:41:05 +03:00
parent 4a65b1c65c
commit df46a8c67a
20 changed files with 328 additions and 4 deletions
@@ -132,10 +132,14 @@ private fun isNonAbstractMember(member: KtDeclaration?): Boolean {
private val DEFAULT_IMPLS_CLASS_NAME = Name.identifier(JvmAbi.DEFAULT_IMPLS_CLASS_NAME)
fun FqName.defaultImplsChild() = child(DEFAULT_IMPLS_CLASS_NAME)
@Suppress("unused")
fun KtAnnotationEntry.toLightAnnotation(): PsiAnnotation? {
val ktDeclaration = getStrictParentOfType<KtModifierList>()?.parent as? KtDeclaration ?: return null
val lightElement = ktDeclaration.toLightElements().firstOrNull() as? PsiModifierListOwner ?: return null
return lightElement.modifierList?.annotations?.firstOrNull { it is KtLightAnnotation && it.kotlinOrigin == this }
for (lightElement in ktDeclaration.toLightElements()) {
if (lightElement !is PsiModifierListOwner) continue
lightElement.modifierList?.annotations?.firstOrNull { it is KtLightAnnotation && it.kotlinOrigin == this }?.let { return it }
}
return null
}
fun propertyNameByAccessor(name: String, accessor: KtLightMethod): String? {