public interface PsiMethod extends PsiMember, PsiNameIdentifierOwner, PsiModifierListOwner, PsiDocCommentOwner, PsiTypeParameterListOwner, PomRenameableTarget<PsiElement>, PsiTarget, PsiParameterListOwner, JvmMethod
PsiClass.getMethods()
Iconable.IconFlags, Iconable.LastComputedIcon
Modifier and Type | Field and Description |
---|---|
static ArrayFactory<PsiMethod> |
ARRAY_FACTORY |
static PsiMethod[] |
EMPTY_ARRAY
The empty array of PSI methods which can be reused to avoid unnecessary allocations.
|
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Modifier and Type | Method and Description |
---|---|
PsiMethod |
findDeepestSuperMethod()
Deprecated.
use
findDeepestSuperMethods() instead |
PsiMethod [] |
findDeepestSuperMethods() |
PsiMethod [] |
findSuperMethods()
Searches the superclasses and base interfaces of the containing class to find
the methods which this method overrides or implements.
|
PsiMethod [] |
findSuperMethods(boolean checkAccess)
Searches the superclasses and base interfaces of the containing class to find
the methods which this method overrides or implements, optionally omitting
the accessibility check.
|
PsiMethod [] |
findSuperMethods(PsiClass parentClass)
Searches the superclasses and base interfaces of the specified class to find
the methods which this method can override or implement.
|
java.util.List<MethodSignatureBackedByPsiMethod> |
findSuperMethodSignaturesIncludingStatic(boolean checkAccess)
Searches the superclasses and base interfaces of the containing class to find
static and instance methods with the signature matching the signature of this method.
|
PsiCodeBlock |
getBody()
Returns the body of the method.
|
HierarchicalMethodSignature |
getHierarchicalMethodSignature() |
PsiModifierList |
getModifierList()
Returns the list of modifiers for the element.
|
java.lang.String |
getName()
Returns the name of the element.
|
PsiIdentifier |
getNameIdentifier()
Returns the name identifier for the method.
|
PsiParameterList |
getParameterList()
Returns the parameter list for the method.
|
default JvmParameter [] |
getParameters() |
PsiType |
getReturnType()
Returns the return type of the method.
|
PsiTypeElement |
getReturnTypeElement()
Returns the type element for the return type of the method.
|
MethodSignature |
getSignature(PsiSubstitutor substitutor)
Returns the signature of this method, using the specified substitutor to specify
values of generic type parameters.
|
PsiReferenceList |
getThrowsList()
Returns the list of thrown exceptions for the method.
|
default JvmReferenceType [] |
getThrowsTypes() |
default boolean |
hasParameters() |
boolean |
isConstructor()
Checks if the method is a constructor.
|
boolean |
isVarArgs()
Checks if the method accepts a variable number of arguments.
|
PsiElement |
setName(java.lang.String name)
Renames the element.
|
getIdentifyingElement
isDeprecated
getDocComment
getTypeParameterList, getTypeParameters, hasTypeParameters
getContainingClass
getPresentation
canNavigate, canNavigateToSource, navigate
getAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifier
hasModifierProperty
accept, 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, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toString
getUserData, putUserData
isWritable
getNavigationElement
static final PsiMethod[] EMPTY_ARRAY
static final ArrayFactory<PsiMethod> ARRAY_FACTORY
PsiType getReturnType()
getReturnType
in interface JvmMethod
Method.getGenericReturnType()
,
Method.getAnnotatedReturnType()
PsiTypeElement getReturnTypeElement()
PsiParameterList getParameterList()
getParameterList
in interface PsiParameterListOwner
PsiReferenceList getThrowsList()
PsiCodeBlock getBody()
getBody
in interface PsiParameterListOwner
boolean isConstructor()
isConstructor
in interface JvmMethod
boolean isVarArgs()
MethodSignature getSignature(PsiSubstitutor substitutor)
substitutor
- the substitutor.PsiIdentifier getNameIdentifier()
getNameIdentifier
in interface PsiNameIdentifierOwner
PsiMethod [] findSuperMethods()
PsiMethod [] findSuperMethods(boolean checkAccess)
checkAccess
- if false, the super methods are searched even if this method
is private. If true, an empty result list is returned for private methods.PsiMethod [] findSuperMethods(PsiClass parentClass)
parentClass
- the class to search for super methods.java.util.List<MethodSignatureBackedByPsiMethod> findSuperMethodSignaturesIncludingStatic(boolean checkAccess)
checkAccess
- if false, the super methods are searched even if this method
is private. If true, an empty result list is returned for private methods.@Deprecated PsiMethod findDeepestSuperMethod()
findDeepestSuperMethods()
insteadPsiMethod [] findDeepestSuperMethods()
PsiModifierList getModifierList()
PsiModifierListOwner
getModifierList
in interface PsiModifierListOwner
java.lang.String getName()
PsiNamedElement
getName
in interface JvmMember
getName
in interface JvmMethod
getName
in interface JvmNamedElement
getName
in interface NavigationItem
getName
in interface PomNamedTarget
getName
in interface PsiNamedElement
Member.getName()
PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElement
setName
in interface PomRenameableTarget<PsiElement>
setName
in interface PsiNamedElement
name
- the new element name.this
or a different element if the rename caused the element to be replaced).IncorrectOperationException
- if the modification is not supported or not possible for some reason.HierarchicalMethodSignature getHierarchicalMethodSignature()
default boolean hasParameters()
hasParameters
in interface JvmMethod
default JvmParameter [] getParameters()
getParameters
in interface JvmMethod
Executable.getParameters()
default JvmReferenceType [] getThrowsTypes()
getThrowsTypes
in interface JvmMethod
Method.getGenericExceptionTypes()
,
Executable.getAnnotatedExceptionTypes()