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_ARRAYEMPTY_NAVIGATION_ITEM_ARRAYICON_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.
|
getIdentifyingElementisDeprecatedgetDocCommentgetTypeParameterList, getTypeParameters, hasTypeParametersgetContainingClassgetPresentationcanNavigate, canNavigateToSource, navigategetAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifierhasModifierPropertyaccept, 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, toStringgetUserData, putUserDataisWritablegetNavigationElementstatic final PsiMethod[] EMPTY_ARRAY
static final ArrayFactory<PsiMethod> ARRAY_FACTORY
PsiType getReturnType()
getReturnType in interface JvmMethodMethod.getGenericReturnType(),
Method.getAnnotatedReturnType()PsiTypeElement getReturnTypeElement()
PsiParameterList getParameterList()
getParameterList in interface PsiParameterListOwnerPsiReferenceList getThrowsList()
PsiCodeBlock getBody()
getBody in interface PsiParameterListOwnerboolean isConstructor()
isConstructor in interface JvmMethodboolean isVarArgs()
MethodSignature getSignature(PsiSubstitutor substitutor)
substitutor - the substitutor.PsiIdentifier getNameIdentifier()
getNameIdentifier in interface PsiNameIdentifierOwnerPsiMethod [] 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()
PsiModifierListOwnergetModifierList in interface PsiModifierListOwnerjava.lang.String getName()
PsiNamedElementgetName in interface JvmMembergetName in interface JvmMethodgetName in interface JvmNamedElementgetName in interface NavigationItemgetName in interface PomNamedTargetgetName in interface PsiNamedElementMember.getName()PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElementsetName in interface PomRenameableTarget<PsiElement>setName in interface PsiNamedElementname - 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 JvmMethoddefault JvmParameter [] getParameters()
getParameters in interface JvmMethodExecutable.getParameters()default JvmReferenceType [] getThrowsTypes()
getThrowsTypes in interface JvmMethodMethod.getGenericExceptionTypes(),
Executable.getAnnotatedExceptionTypes()