public abstract class AbstractQualifiedReference<T extends AbstractQualifiedReference<T>> extends ASTWrapperPsiElement implements PsiPolyVariantReference, PsiQualifiedReferenceElement
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractQualifiedReference.AbstractQualifiedReferenceResolvingProcessor |
Iconable.IconFlags, Iconable.LastComputedIconFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYEMPTY_NAVIGATABLE_ELEMENT_ARRAYEMPTY_NAVIGATION_ITEM_ARRAY| Modifier | Constructor and Description |
|---|---|
protected |
AbstractQualifiedReference(ASTNode node) |
| Modifier and Type | Method and Description |
|---|---|
PsiElement |
bindToElement(PsiElement element)
Changes the reference so that it starts to point to the specified element.
|
java.lang.String |
getCanonicalText()
Returns the name of the reference target element which does not depend on import statements
and other context (for example, the full-qualified name of the class if the reference targets
a Java class).
|
PsiElement |
getElement()
Returns the underlying (referencing) element of the reference.
|
T |
getQualifier()
Returns the qualifier of the reference (the element representing the content up to the
last period).
|
TextRange |
getRangeInElement()
Returns the part of the underlying element which serves as a reference, or the complete
text range of the element if the entire element is a reference.
|
PsiReference |
getReference()
Returns the reference from this PSI element to another PSI element (or elements), if one exists.
|
java.lang.String |
getReferenceName()
Returns the text of the reference not including its qualifier.
|
protected abstract PsiElement |
getReferenceNameElement() |
protected abstract PsiElement |
getSeparator() |
PsiElement |
handleElementRename(java.lang.String newElementName)
Called when the reference target element has been renamed, in order to change the reference
text according to the new name.
|
protected boolean |
isAccessible(PsiElement element) |
boolean |
isReferenceTo(PsiElement element)
Checks if the reference targets the specified element.
|
boolean |
isSoft()
Returns
false if the underlying element is guaranteed to be a reference, or true
if the underlying element is a possible reference which should not be reported as
an error if it fails to resolve. |
ResolveResult [] |
multiResolve(boolean incompleteCode)
Returns the results of resolving the reference.
|
protected abstract T |
parseReference(java.lang.String newText) |
protected boolean |
processUnqualifiedVariants(PsiScopeProcessor processor) |
protected boolean |
processVariantsInner(PsiScopeProcessor processor) |
protected AbstractQualifiedReference |
replaceReference(java.lang.String newText) |
PsiElement |
resolve()
Returns the element which is the target of the reference.
|
protected abstract ResolveResult [] |
resolveInner() |
protected AbstractQualifiedReference |
shortenReferences() |
getNode, getParent, toStringadd, addAfter, addBefore, addInternal, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildInternal, deleteChildRange, findChildByFilter, findChildByType, findChildByType, findChildrenByType, findChildrenByType, findChildrenByType, findChildrenByType, findElementAt, findLastChildByType, findNotNullChildByType, findNotNullChildByType, getChildren, getContainingFile, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNextSibling, getPrevSibling, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, putCopyableUserData, replace, replaceChildInternal, subtreeChanged, textContains, textMatches, textToCharArrayaccept, acceptChildren, canNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getContext, getName, getNavigationElement, getOriginalElement, getPresentation, getProject, getReferences, getResolveScope, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, navigate, notNullChild, processDeclarations, textMatchesbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitresolveReferenceaccept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toStringgetUserData, putUserDatagetVariants, resolvesTogetAbsoluteRangeprotected AbstractQualifiedReference(ASTNode node)
public final PsiReference getReference()
PsiElementPsiElement.getReferences()
for an example), returns the first associated reference.getReference in interface PsiElementgetReference in class PsiElementBaseReferencesSearchpublic final PsiElement getElement()
PsiReferencegetElement in interface PsiSymbolReferencegetElement in interface PsiReferenceprotected abstract ResolveResult [] resolveInner()
public final ResolveResult [] multiResolve(boolean incompleteCode)
PsiPolyVariantReferencemultiResolve in interface PsiPolyVariantReferenceincompleteCode - if true, the code in the context of which the reference is
being resolved is considered incomplete, and the method may return additional
invalid results.public final PsiElement resolve()
PsiReferenceresolve in interface PsiReferencenull if it was not possible to resolve the reference to a valid target.PsiPolyVariantReference.multiResolve(boolean)protected boolean processVariantsInner(PsiScopeProcessor processor)
protected boolean processUnqualifiedVariants(PsiScopeProcessor processor)
public java.lang.String getCanonicalText()
PsiReferencegetCanonicalText in interface PsiReferencepublic T getQualifier()
PsiQualifiedReferencegetQualifier in interface PsiQualifiedReferencepublic PsiElement handleElementRename(java.lang.String newElementName) throws IncorrectOperationException
PsiReferencehandleElementRename in interface PsiReferencenewElementName - the new name of the target element.IncorrectOperationException - if the rename cannot be handled for some reason.public PsiElement bindToElement(PsiElement element) throws IncorrectOperationException
PsiReferencebindToElement in interface PsiReferenceelement - the element which should become the target of the reference.IncorrectOperationException - if the rebind cannot be handled for some reason.protected final AbstractQualifiedReference replaceReference(java.lang.String newText)
protected abstract T parseReference(java.lang.String newText)
protected boolean isAccessible(PsiElement element)
protected AbstractQualifiedReference shortenReferences()
public boolean isReferenceTo(PsiElement element)
PsiReferenceisReferenceTo in interface PsiReferenceelement - the element to check target for.true if the reference targets that element, false otherwise.protected abstract PsiElement getSeparator()
protected abstract PsiElement getReferenceNameElement()
public TextRange getRangeInElement()
PsiReferencePsiElement text: qualified.LongName PsiReferences: [Ref1---]X[Ref2--]where
Ref1 would resolve to a "namespace" and Ref2 to an "element".getRangeInElement in interface PsiSymbolReferencegetRangeInElement in interface PsiReferencepublic java.lang.String getReferenceName()
PsiQualifiedReferencegetReferenceName in interface PsiQualifiedReferencepublic final boolean isSoft()
PsiReferencefalse if the underlying element is guaranteed to be a reference, or true
if the underlying element is a possible reference which should not be reported as
an error if it fails to resolve. For example, a text in an XML file which looks
like a full-qualified Java class name is a soft reference.isSoft in interface PsiReferencetrue if the reference is soft, false otherwise.