public class ClsMethodImpl extends ClsMemberImpl<PsiMethodStub> implements PsiAnnotationMethod
ClsElementImpl.InvalidMirrorException
Iconable.IconFlags, Iconable.LastComputedIcon
COMPILED_ELEMENT, NEXT_LINE
FLAGS_LOCKED, ICON_PLACEHOLDER
EMPTY_ARRAY
ARRAY_FACTORY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Constructor and Description |
---|
ClsMethodImpl(PsiMethodStub stub) |
Modifier and Type | Method and Description |
---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
void |
appendMirrorText(int indentLevel,
java.lang.StringBuilder buffer) |
PsiMethod |
findDeepestSuperMethod()
Returns the method in the deepest base superclass or interface of the containing class which
this method overrides or implements.
|
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.
|
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
PsiClass |
getContainingClass()
Returns the class containing the member.
|
PsiAnnotationMemberValue |
getDefaultValue()
Returns the default value of the annotation element defined by the method.
|
javax.swing.Icon |
getElementIcon(int flags) |
HierarchicalMethodSignature |
getHierarchicalMethodSignature() |
PsiModifierList |
getModifierList()
Returns the list of modifiers for the element.
|
PsiElement |
getNavigationElement()
Returns the PSI element which should be used as a navigation target
when navigation to this PSI element is requested.
|
PsiParameterList |
getParameterList()
Returns the parameter list for the method.
|
ItemPresentation |
getPresentation() |
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.
|
PsiMethod |
getSourceMirrorMethod() |
PsiReferenceList |
getThrowsList()
Returns the list of thrown exceptions for the method.
|
PsiTypeParameterList |
getTypeParameterList()
Returns the type parameter list for the element.
|
PsiTypeParameter [] |
getTypeParameters()
Returns the array of type parameters for the element.
|
SearchScope |
getUseScope()
Returns the scope in which references to this element are searched.
|
boolean |
hasModifierProperty(java.lang.String name)
Checks if the element has the specified modifier.
|
boolean |
hasTypeParameters()
Checks if the element has any type parameters.
|
boolean |
isConstructor()
Checks if the method is a constructor.
|
boolean |
isDeprecated()
Returns
true if the element is marked as deprecated via an annotation or a JavaDoc tag. |
boolean |
isEquivalentTo(PsiElement another)
This method shouldn't be called by clients directly, because there are no guarantees of it being symmetric.
|
boolean |
isVarArgs()
Checks if the method accepts a variable number of arguments.
|
protected boolean |
isVisibilitySupported() |
boolean |
processDeclarations(PsiScopeProcessor processor,
ResolveState state,
PsiElement lastParent,
PsiElement place)
Passes the declarations contained in this PSI element and its children
for processing to the specified scope processor.
|
void |
setMirror(TreeElement element) |
java.lang.String |
toString()
toString() should never be presented to the user.
|
getDocComment, getName, getNameIdentifier, setName
getContainingFile, getElementType, getFirstChild, getLastChild, getManager, getNextSibling, getParent, getPrevSibling, getStub, isPhysical
add, addAfter, addBefore, appendText, appendText, checkAdd, checkDelete, copy, delete, findElementAt, findReferenceAt, getChildren, getIndentSize, getLanguage, getMirror, getNode, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, isValid, isWritable, replace, setMirror, setMirrorCheckingType, setMirrorIfPresent, setMirrors, setMirrors, textMatches, textMatches, textToCharArray
acceptChildren, addRange, addRangeAfter, addRangeBefore, canNavigate, canNavigateToSource, deleteChildRange, findChildByClass, findChildrenByClass, findNotNullChildByClass, getContext, getOriginalElement, getProject, getReference, getReferences, getResolveScope, navigate, notNullChild, textContains
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getNameIdentifier, getParameters, getThrowsTypes, hasParameters, setName
getIdentifyingElement
getDocComment
canNavigate, canNavigateToSource, navigate
getAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifier
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, isPhysical, isValid, isWritable, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
getUserData, putUserData
isWritable
public ClsMethodImpl(PsiMethodStub stub)
public PsiElement [] getChildren()
PsiElement
getChildren
in interface PsiElement
getChildren
in class ClsRepositoryPsiElement<PsiMethodStub>
public PsiClass getContainingClass()
PsiMember
getContainingClass
in interface JvmMember
getContainingClass
in interface PsiJvmMember
getContainingClass
in interface PsiMember
Member.getDeclaringClass()
public PsiMethod [] findSuperMethods()
PsiMethod
findSuperMethods
in interface PsiMethod
public PsiMethod [] findSuperMethods(boolean checkAccess)
PsiMethod
findSuperMethods
in interface PsiMethod
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.public PsiMethod [] findSuperMethods(PsiClass parentClass)
PsiMethod
findSuperMethods
in interface PsiMethod
parentClass
- the class to search for super methods.public java.util.List<MethodSignatureBackedByPsiMethod> findSuperMethodSignaturesIncludingStatic(boolean checkAccess)
PsiMethod
findSuperMethodSignaturesIncludingStatic
in interface PsiMethod
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.public PsiMethod findDeepestSuperMethod()
PsiMethod
findDeepestSuperMethod
in interface PsiMethod
public PsiMethod [] findDeepestSuperMethods()
findDeepestSuperMethods
in interface PsiMethod
public HierarchicalMethodSignature getHierarchicalMethodSignature()
getHierarchicalMethodSignature
in interface PsiMethod
public PsiTypeElement getReturnTypeElement()
PsiMethod
getReturnTypeElement
in interface PsiMethod
public PsiType getReturnType()
PsiMethod
getReturnType
in interface JvmMethod
getReturnType
in interface PsiMethod
Method.getGenericReturnType()
,
Method.getAnnotatedReturnType()
public PsiModifierList getModifierList()
PsiModifierListOwner
getModifierList
in interface PsiMethod
getModifierList
in interface PsiModifierListOwner
public boolean hasModifierProperty(java.lang.String name)
PsiModifierListOwner
PsiModifier
class.hasModifierProperty
in interface PsiModifierListOwner
name
- the name of the modifier to check.public PsiParameterList getParameterList()
PsiMethod
getParameterList
in interface PsiMethod
getParameterList
in interface PsiParameterListOwner
public PsiReferenceList getThrowsList()
PsiMethod
getThrowsList
in interface PsiMethod
public PsiTypeParameterList getTypeParameterList()
PsiTypeParameterListOwner
getTypeParameterList
in interface PsiTypeParameterListOwner
public PsiCodeBlock getBody()
PsiMethod
getBody
in interface PsiMethod
getBody
in interface PsiParameterListOwner
public boolean isDeprecated()
PsiDocCommentOwner
true
if the element is marked as deprecated via an annotation or a JavaDoc tag.isDeprecated
in interface PsiDocCommentOwner
public PsiAnnotationMemberValue getDefaultValue()
PsiAnnotationMethod
getDefaultValue
in interface PsiAnnotationMethod
public boolean isConstructor()
PsiMethod
isConstructor
in interface JvmMethod
isConstructor
in interface PsiMethod
public boolean isVarArgs()
PsiMethod
public MethodSignature getSignature(PsiSubstitutor substitutor)
PsiMethod
getSignature
in interface PsiMethod
substitutor
- the substitutor.public void appendMirrorText(int indentLevel, java.lang.StringBuilder buffer)
appendMirrorText
in class ClsElementImpl
public void setMirror(TreeElement element) throws ClsElementImpl.InvalidMirrorException
setMirror
in class ClsElementImpl
ClsElementImpl.InvalidMirrorException
public void accept(PsiElementVisitor visitor)
PsiElement
accept
in interface PsiElement
accept
in class PsiElementBase
visitor
- the visitor to pass the element to.public boolean processDeclarations(PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place)
PsiElement
processDeclarations
in interface PsiElement
processDeclarations
in class PsiElementBase
processor
- the processor receiving the declarations.lastParent
- the child of this element has been processed during the previous
step of the tree up walk (declarations under this element do not need
to be processed again)place
- the original element from which the tree up walk was initiated.public PsiMethod getSourceMirrorMethod()
public PsiElement getNavigationElement()
PsiElement
this
or substitute a different element if this element
does not have an associated file and offset. (For example, if the source code
of a library is attached to a project, the navigation element for a compiled
library class is its source class.)getNavigationElement
in interface PsiElement
getNavigationElement
in interface PsiTarget
getNavigationElement
in class PsiElementBase
public boolean hasTypeParameters()
PsiTypeParameterListOwner
hasTypeParameters
in interface PsiTypeParameterListOwner
public PsiTypeParameter [] getTypeParameters()
PsiTypeParameterListOwner
getTypeParameters
in interface JvmTypeParametersOwner
getTypeParameters
in interface PsiTypeParameterListOwner
GenericDeclaration.getTypeParameters()
public ItemPresentation getPresentation()
getPresentation
in interface NavigationItem
getPresentation
in class PsiElementBase
public javax.swing.Icon getElementIcon(int flags)
getElementIcon
in class ElementBase
public boolean isEquivalentTo(PsiElement another)
PsiElement
PsiManager.areElementsEquivalent(PsiElement, PsiElement)
internally, which clients should invoke instead.
Implementations of this method should return true
if the parameter is resolve-equivalent to this
, i.e. it represents
the same entity from the language perspective. See also PsiManager.areElementsEquivalent(PsiElement, PsiElement)
documentation.isEquivalentTo
in interface PsiElement
isEquivalentTo
in class PsiElementBase
public SearchScope getUseScope()
PsiElement
getUseScope
in interface PsiElement
getUseScope
in class PsiElementBase
PsiSearchHelper.getUseScope(PsiElement)
protected boolean isVisibilitySupported()
isVisibilitySupported
in class ElementBase
public java.lang.String toString()
PsiElement
toString
in interface PsiElement
toString
in class java.lang.Object