Search in sources :

Example 1 with JavaAnnotationImpl

use of org.jetbrains.kotlin.load.java.structure.impl.JavaAnnotationImpl in project kotlin by JetBrains.

the class PsiBasedExternalAnnotationResolver method findExternalAnnotation.

@Nullable
@Override
public JavaAnnotation findExternalAnnotation(@NotNull JavaAnnotationOwner owner, @NotNull FqName fqName) {
    if (owner instanceof JavaModifierListOwnerImpl) {
        PsiModifierListOwner psiOwner = ((JavaModifierListOwnerImpl) owner).getPsi();
        PsiAnnotation psiAnnotation = ExternalAnnotationsManager.getInstance(psiOwner.getProject()).findExternalAnnotation(psiOwner, fqName.asString());
        return psiAnnotation == null ? null : new JavaAnnotationImpl(psiAnnotation);
    }
    return null;
}
Also used : JavaModifierListOwnerImpl(org.jetbrains.kotlin.load.java.structure.impl.JavaModifierListOwnerImpl) PsiModifierListOwner(com.intellij.psi.PsiModifierListOwner) PsiAnnotation(com.intellij.psi.PsiAnnotation) JavaAnnotationImpl(org.jetbrains.kotlin.load.java.structure.impl.JavaAnnotationImpl) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsiAnnotation (com.intellij.psi.PsiAnnotation)1 PsiModifierListOwner (com.intellij.psi.PsiModifierListOwner)1 Nullable (org.jetbrains.annotations.Nullable)1 JavaAnnotationImpl (org.jetbrains.kotlin.load.java.structure.impl.JavaAnnotationImpl)1 JavaModifierListOwnerImpl (org.jetbrains.kotlin.load.java.structure.impl.JavaModifierListOwnerImpl)1