public class PsiDynaReference<T extends PsiElement> extends PsiReferenceBase<T> implements FileReferenceOwner, PsiPolyVariantReference, LocalQuickFixProvider, EmptyResolveMessageProvider
PsiReferenceBase.Immediate<T extends PsiElement>, PsiReferenceBase.Poly<T extends PsiElement>myElement, mySoftARRAY_FACTORY, EMPTY_ARRAY| Constructor and Description |
|---|
PsiDynaReference(T psiElement) |
| Modifier and Type | Method and Description |
|---|---|
void |
addReference(PsiReference reference) |
void |
addReferences(java.util.Collection<? extends PsiReference> references) |
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).
|
PsiFileReference |
getLastFileReference() |
LocalQuickFix[] |
getQuickFixes() |
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.
|
java.util.List<PsiReference> |
getReferences() |
java.lang.String |
getUnresolvedMessagePattern()
Returns custom unresolved message pattern.
|
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 ResolveResult[] |
innerResolve(boolean incompleteCode) |
boolean |
isReferenceTo(PsiElement element)
Checks if the reference targets the specified element.
|
ResolveResult [] |
multiResolve(boolean incompleteCode)
Returns the results of resolving the reference.
|
PsiElement |
resolve()
Returns the element which is the target of the reference.
|
java.lang.String |
toString() |
calculateDefaultRangeInElement, createSelfReference, createSelfReference, getElement, getValue, isSoft, setRangeInElementclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitresolveReferencegetElement, getVariants, isSoft, resolvesTogetAbsoluteRangepublic PsiDynaReference(T psiElement)
public void addReferences(java.util.Collection<? extends PsiReference> references)
public java.util.List<PsiReference> getReferences()
public void addReference(PsiReference reference)
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 PsiReferencegetRangeInElement in class PsiReferenceBase<T extends PsiElement>public PsiElement resolve()
PsiReferenceresolve in interface PsiReferencenull if it was not possible to resolve the reference to a valid target.PsiPolyVariantReference.multiResolve(boolean)public java.lang.String getCanonicalText()
PsiReferencegetCanonicalText in interface PsiReferencegetCanonicalText in class PsiReferenceBase<T extends PsiElement>public PsiElement handleElementRename(java.lang.String newElementName) throws IncorrectOperationException
PsiReferencehandleElementRename in interface PsiReferencehandleElementRename in class PsiReferenceBase<T extends PsiElement>newElementName - 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 PsiReferencebindToElement in class PsiReferenceBase<T extends PsiElement>element - the element which should become the target of the reference.IncorrectOperationException - if the rebind cannot be handled for some reason.public boolean isReferenceTo(PsiElement element)
PsiReferenceisReferenceTo in interface PsiReferenceisReferenceTo in class PsiReferenceBase<T extends PsiElement>element - the element to check target for.true if the reference targets that element, false otherwise.public 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.protected ResolveResult[] innerResolve(boolean incompleteCode)
public java.lang.String getUnresolvedMessagePattern()
EmptyResolveMessageProviderMessageFormat.format() call.
If the call fails, returned value is used as is.
Resulting text should have Sentence capitalization.getUnresolvedMessagePattern in interface EmptyResolveMessageProviderpublic LocalQuickFix[] getQuickFixes()
getQuickFixes in interface LocalQuickFixProviderpublic java.lang.String toString()
toString in class PsiReferenceBase<T extends PsiElement>public PsiFileReference getLastFileReference()
getLastFileReference in interface FileReferenceOwner