Search in sources :

Example 1 with GrAnnotationStub

use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrAnnotationStub in project intellij-community by JetBrains.

the class GrAnnotationImpl method getShortName.

@Override
@NotNull
public String getShortName() {
    final GrAnnotationStub stub = getStub();
    if (stub != null) {
        return stub.getPsiElement().getShortName();
    }
    final String referenceName = getClassReference().getReferenceName();
    assert referenceName != null;
    return referenceName;
}
Also used : GrAnnotationStub(org.jetbrains.plugins.groovy.lang.psi.stubs.GrAnnotationStub) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with GrAnnotationStub

use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrAnnotationStub in project intellij-community by JetBrains.

the class GrAnnotationImpl method getQualifiedName.

@Override
@Nullable
@NonNls
public String getQualifiedName() {
    final GrAnnotationStub stub = getStub();
    if (stub != null) {
        return stub.getPsiElement().getQualifiedName();
    }
    final GrCodeReferenceElement nameRef = getClassReference();
    final PsiElement resolved = nameRef.resolve();
    if (resolved instanceof PsiClass)
        return ((PsiClass) resolved).getQualifiedName();
    return null;
}
Also used : GrCodeReferenceElement(org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement) GrAnnotationStub(org.jetbrains.plugins.groovy.lang.psi.stubs.GrAnnotationStub) NonNls(org.jetbrains.annotations.NonNls) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

GrAnnotationStub (org.jetbrains.plugins.groovy.lang.psi.stubs.GrAnnotationStub)2 NonNls (org.jetbrains.annotations.NonNls)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1 GrCodeReferenceElement (org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement)1