com.intellij.psi
Interface PsiReferenceExpression
- All Superinterfaces:
- Iconable, PsiAnnotationMemberValue, PsiElement, PsiExpression, PsiJavaCodeReferenceElement, PsiJavaReference, PsiPolyVariantReference, PsiReference, UserDataHolder
public interface PsiReferenceExpression
- extends PsiExpression, PsiJavaCodeReferenceElement
Represents a reference in Java code used as part of an expression.
|
Method Summary |
PsiElement |
bindToElementViaStaticImport(PsiClass qualifierClass)
Creates an import static statement importing the referenced member
from the specified class, or qualifies the reference with the class name if
that class is already imported by a regular import statement. |
PsiExpression |
getQualifierExpression()
Returns the expression used as the qualifier of the reference (the content up to the
last period). |
getQualifierExpression
@Nullable
PsiExpression getQualifierExpression()
- Returns the expression used as the qualifier of the reference (the content up to the
last period).
- Returns:
- the qualifier, or null if the reference is not qualified.
bindToElementViaStaticImport
PsiElement bindToElementViaStaticImport(PsiClass qualifierClass)
throws IncorrectOperationException
- Creates an
import static statement importing the referenced member
from the specified class, or qualifies the reference with the class name if
that class is already imported by a regular import statement.
- Parameters:
qualifierClass - the class to import.
- Returns:
- the element corresponding to this element in the PSI tree after the modification.
- Throws:
IncorrectOperationException - if the modification failed for some reason.