public class PsiMethodReferenceExpressionImpl extends JavaStubPsiElement<FunctionalExpressionStub<PsiMethodReferenceExpression>> implements PsiMethodReferenceExpression
Iconable.IconFlags, Iconable.LastComputedIconCREATION_TRACE, ourTraceStubAstBindingFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYEMPTY_ARRAYARRAY_FACTORY, EXPRESSION_TO_TYPEICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYEMPTY_NAVIGATABLE_ELEMENT_ARRAYEMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
PsiMethodReferenceExpressionImpl(ASTNode node) |
PsiMethodReferenceExpressionImpl(FunctionalExpressionStub<PsiMethodReferenceExpression> stub) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
JavaResolveResult |
advancedResolve(boolean incompleteCode)
Resolves the reference and returns the result as a
JavaResolveResult
instead of a plain PsiElement. |
PsiElement |
bindToElement(PsiElement element)
Changes the reference so that it starts to point to the specified element.
|
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. |
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.
|
PsiType |
getFunctionalInterfaceType() |
PsiType |
getGroundTargetType(PsiType functionalInterfaceType)
JLS 9.9.
|
javax.swing.Icon |
getIcon(int flags) |
PsiReferenceParameterList |
getParameterList()
Returns the list of type arguments specified on the reference.
|
PsiMember |
getPotentiallyApplicableMember() |
java.lang.String |
getQualifiedName()
Returns the text of the reference including its qualifier.
|
PsiElement |
getQualifier()
Returns the qualifier of the reference (the element representing the content up to the
last period).
|
PsiExpression |
getQualifierExpression()
Returns the expression used as the qualifier of the reference (the content up to the
last period).
|
PsiTypeElement |
getQualifierType()
Returns the type element used as the qualifier of the reference.
|
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.
|
PsiElement |
getReferenceNameElement()
Returns the element representing the name of the referenced element.
|
PsiType |
getType()
Returns the type of the expression.
|
PsiType [] |
getTypeParameters()
Returns the array of types for the type arguments specified on the reference.
|
java.lang.Object [] |
getVariants()
Returns the array of String,
PsiElement and/or LookupElement
instances representing all identifiers that are visible at the location of the reference. |
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.
|
boolean |
isAcceptable(PsiType left,
PsiMethod method)
Potentially compatible, and if exact - congruent
|
boolean |
isConstructor() |
boolean |
isExact() |
boolean |
isPotentiallyCompatible(PsiType functionalInterfaceType)
15.12.2.1 Identify Potentially Applicable Methods
.................................................
|
boolean |
isQualified()
Checks if the reference is qualified (consists of elements separated with periods).
|
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. |
JavaResolveResult [] |
multiResolve(boolean incompleteCode)
Returns the results of resolving the reference.
|
void |
processVariants(PsiScopeProcessor processor)
Passes all variants to which the reference may resolve to the specified
processor.
|
PsiElement |
resolve()
Returns the element which is the target of the reference.
|
void |
setQualifierExpression(PsiExpression newQualifier) |
java.lang.String |
toString()
toString() should never be presented to the user.
|
acceptChildren, add, addAfter, addBefore, calcTreeElement, checkAdd, clone, cloneImpl, delete, deleteChildRange, getChildren, getLanguage, getTextOffset, replacegetContainingFile, getContext, getElementType, getGreenStub, getManager, getNode, getParent, getParentByStub, getParentByTree, getProject, getRequiredStubOrPsiChild, getStub, getStubOrPsiChild, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiParentOfType, isPhysical, isValid, isWritable, setNode, setSubstrateRefaddInternal, addRange, addRangeAfter, addRangeBefore, checkDelete, copy, deleteChildInternal, findChildByFilter, findChildByType, findChildByType, findChildrenByType, findChildrenByType, findChildrenByType, findChildrenByType, findElementAt, findLastChildByType, findNotNullChildByType, findNotNullChildByType, getCopyableUserData, getFirstChild, getLastChild, getNextSibling, getPrevSibling, getStartOffsetInParent, getText, getTextLength, getTextRange, putCopyableUserData, replaceChildInternal, subtreeChanged, textContains, textMatches, textToCharArraycanNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getName, getNavigationElement, getOriginalElement, getPresentation, getReferences, getResolveScope, getUseScope, isEquivalentTo, navigate, notNullChild, processDeclarations, textMatchesbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitresolveReferenceresolvesTogetAbsoluteRangeisAcceptableacceptChildren, 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, textToCharArraygetUserData, putUserDatagetName, getPresentationcanNavigate, canNavigateToSource, navigategetElementType, getStubpublic PsiMethodReferenceExpressionImpl(FunctionalExpressionStub<PsiMethodReferenceExpression> stub)
public PsiMethodReferenceExpressionImpl(ASTNode node)
public PsiTypeElement getQualifierType()
PsiMethodReferenceExpressiongetQualifierType in interface PsiMethodReferenceExpressionpublic PsiType getFunctionalInterfaceType()
getFunctionalInterfaceType in interface PsiFunctionalExpressionpublic boolean isExact()
isExact in interface PsiMethodReferenceExpressionpublic boolean isPotentiallyCompatible(PsiType functionalInterfaceType)
PsiMethodReferenceExpressionisPotentiallyCompatible in interface PsiFunctionalExpressionisPotentiallyCompatible in interface PsiMethodReferenceExpressionpublic PsiType getGroundTargetType(PsiType functionalInterfaceType)
PsiFunctionalExpressiongetGroundTargetType in interface PsiFunctionalExpressionpublic PsiMember getPotentiallyApplicableMember()
getPotentiallyApplicableMember in interface PsiMethodReferenceExpressionpublic PsiExpression getQualifierExpression()
PsiReferenceExpressiongetQualifierExpression in interface PsiReferenceExpressionpublic PsiType getType()
PsiExpressiongetType in interface PsiExpressionpublic PsiElement getReferenceNameElement()
PsiJavaCodeReferenceElementgetReferenceNameElement in interface PsiJavaCodeReferenceElementpublic void processVariants(PsiScopeProcessor processor)
PsiJavaReferenceprocessVariants in interface PsiJavaReferenceprocessor - the processor accepting the variantspublic void setQualifierExpression(PsiExpression newQualifier) throws IncorrectOperationException
setQualifierExpression in interface PsiReferenceExpressionIncorrectOperationExceptionpublic JavaResolveResult [] multiResolve(boolean incompleteCode)
PsiPolyVariantReferencemultiResolve in interface PsiJavaReferencemultiResolve 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 PsiElement getQualifier()
PsiQualifiedReferencegetQualifier in interface PsiQualifiedReferencepublic 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 getCanonicalText()
PsiReferencegetCanonicalText in interface PsiReferencepublic boolean isReferenceTo(PsiElement element)
PsiReferenceisReferenceTo in interface PsiReferenceelement - the element to check target for.true if the reference targets that element, false otherwise.public void accept(PsiElementVisitor visitor)
PsiElementaccept in interface PsiElementaccept in class PsiElementBasevisitor - the visitor to pass the element to.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.public 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 boolean isConstructor()
isConstructor in interface PsiMethodReferenceExpressionpublic java.lang.String toString()
PsiElementtoString in interface PsiElementtoString in class java.lang.Objectpublic boolean isAcceptable(PsiType left, PsiMethod method)
PsiMethodReferenceExpressionisAcceptable in interface PsiFunctionalExpressionisAcceptable in interface PsiMethodReferenceExpressionpublic javax.swing.Icon getIcon(int flags)
getIcon in interface IconablegetIcon in class ElementBasepublic PsiElement bindToElementViaStaticImport(PsiClass qualifierClass) throws IncorrectOperationException
PsiReferenceExpressionimport 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.bindToElementViaStaticImport in interface PsiReferenceExpressionqualifierClass - the class to import.IncorrectOperationException - if the modification failed for some reason.public PsiElement getElement()
PsiReferencegetElement in interface PsiSymbolReferencegetElement in interface PsiReferencepublic 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.Object [] getVariants()
PsiReferencePsiElement and/or LookupElement
instances representing all identifiers that are visible at the location of the reference. The contents
of the returned array is used to build the lookup list for basic code completion. (The list
of visible identifiers may not be filtered by the completion prefix string - the
filtering is performed later by the IDE.)
This method is default since 2018.3.
getVariants in interface PsiReferencepublic 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.public PsiReference getReference()
PsiElementPsiElement.getReferences()
for an example), returns the first associated reference.getReference in interface PsiElementgetReference in class PsiElementBaseReferencesSearchpublic JavaResolveResult advancedResolve(boolean incompleteCode)
PsiJavaReferenceJavaResolveResult
instead of a plain PsiElement.advancedResolve in interface PsiJavaReferenceincompleteCode - if true, the code in the context of which the reference is
being resolved is considered incomplete, and the method may return an invalid
result.public java.lang.String getReferenceName()
PsiQualifiedReferencegetReferenceName in interface PsiQualifiedReferencepublic PsiReferenceParameterList getParameterList()
PsiJavaCodeReferenceElementgetParameterList in interface PsiJavaCodeReferenceElementpublic PsiType [] getTypeParameters()
PsiJavaCodeReferenceElementgetTypeParameters in interface PsiJavaCodeReferenceElementpublic boolean isQualified()
PsiJavaCodeReferenceElementisQualified in interface PsiJavaCodeReferenceElementpublic java.lang.String getQualifiedName()
PsiJavaCodeReferenceElementgetQualifiedName in interface PsiJavaCodeReferenceElement