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.


Field Summary
 
Fields inherited from interface com.intellij.psi.PsiExpression
EMPTY_ARRAY
 
Fields inherited from interface com.intellij.psi.PsiJavaCodeReferenceElement
EMPTY_ARRAY
 
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).
 
Methods inherited from interface com.intellij.psi.PsiExpression
getType
 
Methods inherited from interface com.intellij.psi.PsiJavaCodeReferenceElement
getParameterList, getQualifiedName, getQualifier, getReferenceName, getReferenceNameElement, getTypeParameters, isQualified
 
Methods inherited from interface com.intellij.psi.PsiJavaReference
advancedResolve, multiResolve, processVariants
 
Methods inherited from interface com.intellij.psi.PsiReference
bindToElement, getCanonicalText, getElement, getRangeInElement, getVariants, handleElementRename, isReferenceTo, isSoft, resolve
 

Method Detail

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.